diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index a8b5fdbcf7cea..132f5ffaccfc4 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -179,19 +179,19 @@ interface ObjectConstructor { * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - seal(o: any): any; + seal(o: T): T; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: any): any; + freeze(o: T): T; /** * Prevents the addition of new properties to an object. * @param o Object to make non-extensible. */ - preventExtensions(o: any): any; + preventExtensions(o: T): T; /** * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. @@ -425,6 +425,9 @@ interface String { */ substr(from: number, length?: number): string; + /** Returns the primitive value of the specified object. */ + valueOf(): string; + [index: number]: string; } @@ -477,6 +480,9 @@ interface Number { * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. */ toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; } interface NumberConstructor { diff --git a/bin/lib.core.es6.d.ts b/bin/lib.core.es6.d.ts index b3c400f11a2d0..c6f3d1d1f9751 100644 --- a/bin/lib.core.es6.d.ts +++ b/bin/lib.core.es6.d.ts @@ -179,19 +179,19 @@ interface ObjectConstructor { * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - seal(o: any): any; + seal(o: T): T; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: any): any; + freeze(o: T): T; /** * Prevents the addition of new properties to an object. * @param o Object to make non-extensible. */ - preventExtensions(o: any): any; + preventExtensions(o: T): T; /** * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. @@ -425,6 +425,9 @@ interface String { */ substr(from: number, length?: number): string; + /** Returns the primitive value of the specified object. */ + valueOf(): string; + [index: number]: string; } @@ -477,6 +480,9 @@ interface Number { * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. */ toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; } interface NumberConstructor { diff --git a/bin/lib.d.ts b/bin/lib.d.ts index 02c45824aa84b..e22c7351931a5 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -179,19 +179,19 @@ interface ObjectConstructor { * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - seal(o: any): any; + seal(o: T): T; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: any): any; + freeze(o: T): T; /** * Prevents the addition of new properties to an object. * @param o Object to make non-extensible. */ - preventExtensions(o: any): any; + preventExtensions(o: T): T; /** * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. @@ -425,6 +425,9 @@ interface String { */ substr(from: number, length?: number): string; + /** Returns the primitive value of the specified object. */ + valueOf(): string; + [index: number]: string; } @@ -477,6 +480,9 @@ interface Number { * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. */ toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; } interface NumberConstructor { diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index 935f78f160350..cf849d5c72d75 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -179,19 +179,19 @@ interface ObjectConstructor { * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - seal(o: any): any; + seal(o: T): T; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: any): any; + freeze(o: T): T; /** * Prevents the addition of new properties to an object. * @param o Object to make non-extensible. */ - preventExtensions(o: any): any; + preventExtensions(o: T): T; /** * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. @@ -425,6 +425,9 @@ interface String { */ substr(from: number, length?: number): string; + /** Returns the primitive value of the specified object. */ + valueOf(): string; + [index: number]: string; } @@ -477,6 +480,9 @@ interface Number { * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. */ toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; } interface NumberConstructor { diff --git a/bin/tsc.js b/bin/tsc.js index 32d4e894340af..a19101dc546ec 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -254,8 +254,11 @@ var ts; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { + var end = start + length; Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); + Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); @@ -1188,7 +1191,6 @@ var ts; Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: 1, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." }, The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, @@ -1199,6 +1201,9 @@ var ts; The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 1, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: 1, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, + Type_0_is_not_an_array_type_or_a_string_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type or a string type." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, key: "Import declaration '{0}' is using private name '{1}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, @@ -1324,6 +1329,7 @@ var ts; File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, + Preserve_new_lines_when_emitting_code: { code: 6057, category: 2, key: "Preserve new-lines when emitting code." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -2608,7 +2614,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 220) { + while (node && node.kind !== 221) { node = node.parent; } return node; @@ -2683,11 +2689,35 @@ var ts; isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function getEnclosingBlockScopeContainer(node) { + var current = node; + while (current) { + if (isFunctionLike(current)) { + return current; + } + switch (current.kind) { + case 221: + case 202: + case 217: + case 200: + case 181: + case 182: + case 183: + return current; + case 174: + if (!isFunctionLike(current.parent)) { + return current; + } + } + current = current.parent; + } + } + ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && declaration.kind === 193 && declaration.parent && - declaration.parent.kind === 216; + declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -2730,7 +2760,7 @@ var ts; case 197: case 200: case 199: - case 219: + case 220: case 195: case 160: errorNode = node.name; @@ -2817,6 +2847,7 @@ var ts; switch (node.kind) { case 186: return visitor(node); + case 202: case 174: case 178: case 179: @@ -2826,11 +2857,11 @@ var ts; case 183: case 187: case 188: - case 213: case 214: + case 215: case 189: case 191: - case 216: + case 217: return ts.forEachChild(node, traverse); } } @@ -2840,12 +2871,12 @@ var ts; if (node) { switch (node.kind) { case 150: - case 219: + case 220: case 128: - case 217: + case 218: case 130: case 129: - case 218: + case 219: case 193: return true; } @@ -2923,7 +2954,7 @@ var ts; case 134: case 135: case 199: - case 220: + case 221: return node; } } @@ -3014,8 +3045,8 @@ var ts; case 128: case 130: case 129: - case 219: - case 217: + case 220: + case 218: case 150: return parent.initializer === node; case 177: @@ -3025,7 +3056,7 @@ var ts; case 186: case 187: case 188: - case 213: + case 214: case 190: case 188: return parent.expression === node; @@ -3061,7 +3092,7 @@ var ts; } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind === 212; + return node.kind === 203 && node.moduleReference.kind === 213; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3070,20 +3101,20 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind !== 212; + return node.kind === 203 && node.moduleReference.kind !== 213; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 203) { + if (node.kind === 204) { return node.moduleSpecifier; } - if (node.kind === 202) { + if (node.kind === 203) { var reference = node.moduleReference; - if (reference.kind === 212) { + if (reference.kind === 213) { return reference.expression; } } - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } } @@ -3100,8 +3131,8 @@ var ts; case 132: case 131: return node.questionToken !== undefined; + case 219: case 218: - case 217: case 130: case 129: return node.questionToken !== undefined; @@ -3147,25 +3178,25 @@ var ts; case 196: case 133: case 199: - case 219: - case 211: + case 220: + case 212: case 195: case 160: case 134: - case 204: - case 202: - case 207: + case 205: + case 203: + case 208: case 197: case 132: case 131: case 200: - case 205: + case 206: case 128: - case 217: + case 218: case 130: case 129: case 135: - case 218: + case 219: case 198: case 127: case 193: @@ -3194,7 +3225,7 @@ var ts; case 175: case 180: case 187: - case 208: + case 209: return true; default: return false; @@ -3206,7 +3237,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 207 || parent.kind === 211) { + if (parent.kind === 208 || parent.kind === 212) { if (parent.propertyName) { return true; } @@ -3460,11 +3491,11 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 220; + return isFunctionLike(n) || n.kind === 200 || n.kind === 221; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { - return node.pos === -1 && node.end === -1; + return node.pos === -1; } ts.nodeIsSynthesized = nodeIsSynthesized; function createSynthesizedNode(kind, startsOnNewLine) { @@ -3598,7 +3629,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(222); + var nodeConstructors = new Array(223); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -3645,8 +3676,8 @@ var ts; case 128: case 130: case 129: - case 217: case 218: + case 219: case 193: case 150: return visitNodes(cbNodes, node.modifiers) || @@ -3751,7 +3782,7 @@ var ts; case 174: case 201: return visitNodes(cbNodes, node.statements); - case 220: + case 221: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); case 175: @@ -3794,11 +3825,13 @@ var ts; visitNode(cbNode, node.statement); case 188: return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.clauses); - case 213: + visitNode(cbNode, node.caseBlock); + case 202: + return visitNodes(cbNodes, node.clauses); + case 214: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 214: + case 215: return visitNodes(cbNodes, node.statements); case 189: return visitNode(cbNode, node.label) || @@ -3809,7 +3842,7 @@ var ts; return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 216: + case 217: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 196: @@ -3832,38 +3865,38 @@ var ts; return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 219: + case 220: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); case 200: return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 202: + case 203: return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 203: + case 204: return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 204: + case 205: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 205: - return visitNode(cbNode, node.name); case 206: - case 210: + return visitNode(cbNode, node.name); + case 207: + case 211: return visitNodes(cbNodes, node.elements); - case 209: + case 210: return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 207: - case 211: + case 208: + case 212: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 208: + case 209: return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); case 169: @@ -3872,9 +3905,9 @@ var ts; return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 126: return visitNode(cbNode, node.expression); - case 215: + case 216: return visitNodes(cbNodes, node.types); - case 212: + case 213: return visitNode(cbNode, node.expression); } } @@ -4228,7 +4261,7 @@ var ts; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(220, 0); + var sourceFile = createNode(221, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4778,10 +4811,10 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 196: case 197: case 200: @@ -4809,8 +4842,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 213: case 214: + case 215: return true; } } @@ -4845,7 +4878,7 @@ var ts; return false; } function isReusableEnumMember(node) { - return node.kind === 219; + return node.kind === 220; } function isReusableTypeMember(node) { if (node) { @@ -5967,13 +6000,13 @@ var ts; return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(218, fullStart); + var shorthandDeclaration = createNode(219, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(217, fullStart); + var propertyAssignment = createNode(218, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6139,7 +6172,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(213); + var node = createNode(214); parseExpected(66); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -6147,7 +6180,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(214); + var node = createNode(215); parseExpected(72); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -6162,9 +6195,11 @@ var ts; parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); + var caseBlock = createNode(202, scanner.getStartPos()); parseExpected(14); - node.clauses = parseList(3, false, parseCaseOrDefaultClause); + caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); + node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { @@ -6186,7 +6221,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(216); + var result = createNode(217); parseExpected(67); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -6616,7 +6651,7 @@ var ts; } function parseHeritageClause() { if (token === 78 || token === 102) { - var node = createNode(215); + var node = createNode(216); node.token = token; nextToken(); node.types = parseDelimitedList(8, parseTypeReference); @@ -6651,7 +6686,7 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(220, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); @@ -6723,7 +6758,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(202, fullStart); + var importEqualsDeclaration = createNode(203, fullStart); setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; parseExpected(52); @@ -6732,7 +6767,7 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(203, fullStart); + var importDeclaration = createNode(204, fullStart); setModifiers(importDeclaration, modifiers); if (identifier || token === 35 || @@ -6745,13 +6780,13 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(204, fullStart); + var importClause = createNode(205, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(206); + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); } return finishNode(importClause); } @@ -6761,7 +6796,7 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(212); + var node = createNode(213); parseExpected(117); parseExpected(16); node.expression = parseModuleSpecifier(); @@ -6776,7 +6811,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(205); + var namespaceImport = createNode(206); parseExpected(35); parseExpected(101); namespaceImport.name = parseIdentifier(); @@ -6784,14 +6819,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 206 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(211); + return parseImportOrExportSpecifier(212); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(207); + return parseImportOrExportSpecifier(208); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -6817,14 +6852,14 @@ var ts; return finishNode(node); } function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(209, fullStart); + var node = createNode(210, fullStart); setModifiers(node, modifiers); if (parseOptional(35)) { parseExpected(123); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(210); + node.exportClause = parseNamedImportsOrExports(211); if (parseOptional(123)) { node.moduleSpecifier = parseModuleSpecifier(); } @@ -6833,7 +6868,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, modifiers) { - var node = createNode(208, fullStart); + var node = createNode(209, fullStart); setModifiers(node, modifiers); if (parseOptional(52)) { node.isExportEquals = true; @@ -7009,10 +7044,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return node.flags & 1 - || node.kind === 202 && node.moduleReference.kind === 212 - || node.kind === 203 - || node.kind === 208 + || node.kind === 203 && node.moduleReference.kind === 213 + || node.kind === 204 || node.kind === 209 + || node.kind === 210 ? node : undefined; }); @@ -7062,7 +7097,7 @@ var ts; else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 203 || node.kind === 202) && !(node.flags & 1)) { + else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { return 0; } else if (node.kind === 201) { @@ -7155,9 +7190,9 @@ var ts; return "__new"; case 138: return "__index"; - case 209: + case 210: return "__export"; - case 208: + case 209: return "default"; case 195: case 196: @@ -7215,7 +7250,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 211 || (node.kind === 202 && hasExportModifier)) { + if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -7252,7 +7287,7 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 220); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); } ts.forEachChild(node, bind); container = saveContainer; @@ -7264,7 +7299,7 @@ var ts; case 200: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -7342,7 +7377,7 @@ var ts; case 200: declareModuleMember(node, 2, 107455); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, 2, 107455); break; @@ -7383,11 +7418,11 @@ var ts; case 129: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 217: case 218: + case 219: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 219: + case 220: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; case 136: @@ -7425,7 +7460,7 @@ var ts; case 161: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 216: + case 217: bindCatchVariableDeclaration(node); break; case 196: @@ -7448,13 +7483,13 @@ var ts; case 200: bindModuleDeclaration(node); break; - case 202: - case 205: - case 207: - case 211: + case 203: + case 206: + case 208: + case 212: bindDeclaration(node, 8388608, 8388608, false); break; - case 204: + case 205: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -7462,13 +7497,13 @@ var ts; bindChildren(node, 0, false); } break; - case 209: + case 210: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 208: + case 209: if (node.expression.kind === 64) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); } @@ -7477,7 +7512,7 @@ var ts; } bindChildren(node, 0, false); break; - case 220: + case 221: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; @@ -7485,11 +7520,11 @@ var ts; case 174: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 216: + case 217: case 181: case 182: case 183: - case 188: + case 202: bindChildren(node, 0, true); break; default: @@ -7777,10 +7812,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 220); + return ts.getAncestor(node, 221); } function isGlobalSourceFile(node) { - return node.kind === 220 && !ts.isExternalModule(node); + return node.kind === 221 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -7821,12 +7856,12 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 211)) { + if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { break loop; } result = undefined; @@ -7910,28 +7945,57 @@ var ts; return undefined; } if (result.flags & 2) { - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); - } + checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert((result.flags & 2) !== 0); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); + if (!isUsedBeforeDeclaration) { + var variableDeclaration = ts.getAncestor(declaration, 193); + var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); + if (variableDeclaration.parent.parent.kind === 175 || + variableDeclaration.parent.parent.kind === 181) { + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); + } + else if (variableDeclaration.parent.parent.kind === 183 || + variableDeclaration.parent.parent.kind === 182) { + var expression = variableDeclaration.parent.parent.expression; + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); + } + } + if (isUsedBeforeDeclaration) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + if (!parent) { + return false; + } + for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { + if (current === parent) { + return true; + } + } + return false; + } function isAliasSymbolDeclaration(node) { - return node.kind === 202 || - node.kind === 204 && !!node.name || - node.kind === 205 || - node.kind === 207 || - node.kind === 211 || - node.kind === 208; + return node.kind === 203 || + node.kind === 205 && !!node.name || + node.kind === 206 || + node.kind === 208 || + node.kind === 212 || + node.kind === 209; } function getDeclarationOfAliasSymbol(symbol) { return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 212) { + if (node.moduleReference.kind === 213) { var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); return exportAssignmentSymbol || moduleSymbol; @@ -7978,17 +8042,17 @@ var ts; } function getTargetOfImportDeclaration(node) { switch (node.kind) { - case 202: + case 203: return getTargetOfImportEqualsDeclaration(node); - case 204: - return getTargetOfImportClause(node); case 205: + return getTargetOfImportClause(node); + case 206: return getTargetOfNamespaceImport(node); - case 207: + case 208: return getTargetOfImportSpecifier(node); - case 211: + case 212: return getTargetOfExportSpecifier(node); - case 208: + case 209: return getTargetOfExportAssignment(node); } } @@ -8023,10 +8087,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 208) { + if (node.kind === 209) { checkExpressionCached(node.expression); } - else if (node.kind === 211) { + else if (node.kind === 212) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8036,7 +8100,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 202); + importDeclaration = ts.getAncestor(entityName, 203); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -8046,7 +8110,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 202); + ts.Debug.assert(entityName.parent.kind === 203); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8271,7 +8335,7 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) { break; } @@ -8397,7 +8461,7 @@ var ts; } function hasExternalModuleSymbol(declaration) { return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 220 && ts.isExternalModule(declaration)); + (declaration.kind === 221 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -8407,7 +8471,7 @@ var ts; return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 202 && + if (declaration.kind === 203 && !(declaration.flags & 1) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; @@ -8432,7 +8496,7 @@ var ts; meaning = 107455 | 1048576; } else if (entityName.kind === 125 || - entityName.parent.kind === 202) { + entityName.parent.kind === 203) { meaning = 1536; } else { @@ -8650,7 +8714,7 @@ var ts; var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 220 || declaration.parent.kind === 201; + return declaration.parent.kind === 221 || declaration.parent.kind === 201; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2) || @@ -8884,7 +8948,7 @@ var ts; return node; } } - else if (node.kind === 220) { + else if (node.kind === 221) { return ts.isExternalModule(node) ? node : undefined; } } @@ -8934,10 +8998,10 @@ var ts; case 198: case 195: case 199: - case 202: + case 203: var parent = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 202 && parent.kind !== 220 && ts.isInAmbientContext(parent))) { + !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -8966,7 +9030,7 @@ var ts; case 147: return isDeclarationVisible(node.parent); case 127: - case 220: + case 221: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -9029,7 +9093,12 @@ var ts; var propName = "" + ts.indexOf(pattern.elements, declaration); var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + if (isTupleType(parentType)) { + error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); + } + else { + error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + } return unknownType; } } @@ -9044,7 +9113,7 @@ var ts; return anyType; } if (declaration.parent.parent.kind === 183) { - return getTypeForVariableDeclarationInForOfStatement(declaration.parent.parent); + return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); @@ -9068,7 +9137,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 218) { + if (declaration.kind === 219) { return checkIdentifier(declaration.name); } return undefined; @@ -9115,7 +9184,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 217 ? getWidenedType(type) : type; + return declaration.kind !== 218 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9136,10 +9205,10 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 216) { + if (declaration.parent.kind === 217) { return links.type = anyType; } - if (declaration.kind === 208) { + if (declaration.kind === 209) { return links.type = checkExpression(declaration.expression); } links.type = resolvingType; @@ -10486,7 +10555,7 @@ var ts; case 167: return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 217: + case 218: return isContextSensitive(node.initializer); case 132: case 131: @@ -11176,6 +11245,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isTupleType(type) { + return (type.flags & 8192) && !!type.elementTypes; + } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); var members = {}; @@ -11508,16 +11580,19 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind) { + function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { if (type.flags & 16384) { var types = type.types; if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (narrowedType !== emptyObjectType) { + if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; } } } + else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + return getUnionType(emptyArray); + } return type; } function hasInitializer(node) { @@ -11589,12 +11664,12 @@ var ts; case 186: case 187: case 188: - case 213: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: return ts.forEachChild(node, isAssignedIn); } return false; @@ -11650,7 +11725,7 @@ var ts; } } break; - case 220: + case 221: case 200: case 195: case 132: @@ -11684,16 +11759,16 @@ var ts; } if (assumeTrue) { if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true); + return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); } if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } - return removeTypesFromUnionType(type, typeInfo.flags, false); + return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true); + return removeTypesFromUnionType(type, typeInfo.flags, true, false); } return type; } @@ -11795,7 +11870,7 @@ var ts; function checkBlockScopedBindingCapturedInLoop(node, symbol) { if (languageVersion >= 2 || (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 216) { + symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -12136,7 +12211,7 @@ var ts; return getTypeFromTypeNode(parent.type); case 167: return getContextualTypeForBinaryOperand(node); - case 217: + case 218: return getContextualTypeForObjectLiteralElement(parent); case 151: return getContextualTypeForElementExpression(node); @@ -12212,7 +12287,7 @@ var ts; if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { return true; } - if (parent.kind === 217) { + if (parent.kind === 218) { return isAssignmentTarget(parent.parent); } if (parent.kind === 151) { @@ -12284,17 +12359,17 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 217 || - memberDecl.kind === 218 || + if (memberDecl.kind === 218 || + memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { - if (memberDecl.kind === 217) { + if (memberDecl.kind === 218) { var type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { var type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 218); + ts.Debug.assert(memberDecl.kind === 219); var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); @@ -13309,7 +13384,7 @@ var ts; var properties = node.properties; for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var name = p.name; var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name.text) || @@ -13346,7 +13421,12 @@ var ts; checkDestructuringAssignment(e, type, contextualMapper); } else { - error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + if (isTupleType(sourceType)) { + error(e, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), sourceType.elementTypes.length, elements.length); + } + else { + error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + } } } else { @@ -14156,7 +14236,7 @@ var ts; case 196: case 199: return 2097152 | 1048576; - case 202: + case 203: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); @@ -14290,7 +14370,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 220 && ts.isExternalModule(parent)) { + if (parent.kind === 221 && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -14309,7 +14389,7 @@ var ts; var namesShareScope = container && (container.kind === 174 && ts.isFunctionLike(container.parent) || (container.kind === 201 && container.kind === 200) || - container.kind === 220); + container.kind === 221); 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); @@ -14468,18 +14548,13 @@ var ts; checkSourceElement(node.statement); } function checkForOfStatement(node) { - if (languageVersion < 2) { - grammarErrorOnFirstToken(node, ts.Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); - return; - } checkGrammarForInOrForOfStatement(node); if (node.initializer.kind === 194) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var rightType = checkExpression(node.expression); - var iteratedType = checkIteratedType(rightType, node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression); if (varExpr.kind === 151 || varExpr.kind === 152) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } @@ -14528,12 +14603,11 @@ var ts; checkVariableDeclaration(decl); } } - function getTypeForVariableDeclarationInForOfStatement(forOfStatement) { - if (languageVersion < 2) { - return anyType; - } - var expressionType = getTypeOfExpression(forOfStatement.expression); - return checkIteratedType(expressionType, forOfStatement.expression) || anyType; + function checkRightHandSideOfForOf(rhsExpression) { + var expressionType = getTypeOfExpression(rhsExpression); + return languageVersion >= 2 + ? checkIteratedType(expressionType, rhsExpression) + : checkElementTypeOfArrayOrString(expressionType, rhsExpression); } function checkIteratedType(iterable, expressionForError) { ts.Debug.assert(languageVersion >= 2); @@ -14589,6 +14663,38 @@ var ts; return iteratorNextValue; } } + function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + ts.Debug.assert(languageVersion < 2); + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var hasStringConstituent = arrayOrStringType !== arrayType; + var reportedError = false; + if (hasStringConstituent) { + if (languageVersion < 1) { + error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + if (arrayType === emptyObjectType) { + return stringType; + } + } + if (!isArrayLikeType(arrayType)) { + if (!reportedError) { + var diagnostic = hasStringConstituent + ? ts.Diagnostics.Type_0_is_not_an_array_type + : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(expressionForError, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : unknownType; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + if (hasStringConstituent) { + if (arrayElementType.flags & 258) { + return stringType; + } + return getUnionType([arrayElementType, stringType]); + } + return arrayElementType; + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } @@ -14637,8 +14743,8 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (clause.kind === 214 && !hasDuplicateDefaultClause) { + ts.forEach(node.caseBlock.clauses, function (clause) { + if (clause.kind === 215 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -14650,7 +14756,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 213) { + if (produceDiagnostics && clause.kind === 214) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15236,8 +15342,8 @@ var ts; return false; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 220 && !inAmbientExternalModule) { - error(moduleName, node.kind === 209 ? + if (node.parent.kind !== 221 && !inAmbientExternalModule) { + error(moduleName, node.kind === 210 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; @@ -15256,7 +15362,7 @@ var ts; (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 211 ? + var message = node.kind === 212 ? 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)); @@ -15279,7 +15385,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { checkImportBinding(importClause.namedBindings); } else { @@ -15329,7 +15435,7 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 220 ? node.parent : node.parent.parent; + var container = node.parent.kind === 221 ? node.parent : node.parent.parent; if (container.kind === 200 && container.name.kind === 64) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; @@ -15346,7 +15452,7 @@ var ts; checkExternalModuleExports(container); } function getModuleStatements(node) { - if (node.kind === 220) { + if (node.kind === 221) { return node.statements; } if (node.kind === 200 && node.body.kind === 201) { @@ -15360,7 +15466,7 @@ var ts; var statements = getModuleStatements(declarations[i]); for (var j = 0; j < statements.length; j++) { var node = statements[j]; - if (node.kind === 209) { + if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; @@ -15373,7 +15479,7 @@ var ts; } } } - else if (node.kind !== 208 && node.flags & 1 && !(node.flags & 256)) { + else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { return true; } } @@ -15483,13 +15589,13 @@ var ts; return checkEnumDeclaration(node); case 200: return checkModuleDeclaration(node); - case 203: + case 204: return checkImportDeclaration(node); - case 202: + case 203: return checkImportEqualsDeclaration(node); - case 209: + case 210: return checkExportDeclaration(node); - case 208: + case 209: return checkExportAssignment(node); case 176: checkGrammarStatementInAmbientContext(node); @@ -15530,7 +15636,7 @@ var ts; case 150: case 151: case 152: - case 217: + case 218: case 153: case 154: case 155: @@ -15562,19 +15668,20 @@ var ts; case 185: case 186: case 188: - case 213: + case 202: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: case 193: case 194: case 196: case 199: - case 219: - case 208: case 220: + case 209: + case 221: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15662,7 +15769,7 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: @@ -15774,10 +15881,10 @@ var ts; while (nodeOnRightSide.parent.kind === 125) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 202) { + if (nodeOnRightSide.parent.kind === 203) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -15793,7 +15900,7 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 208) { + if (entityName.parent.kind === 209) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } if (entityName.kind !== 153) { @@ -15842,7 +15949,7 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 208 + return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } @@ -15865,7 +15972,7 @@ var ts; var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 203 || node.parent.kind === 209) && + ((node.parent.kind === 204 || node.parent.kind === 210) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } @@ -15884,7 +15991,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 218) { + if (location && location.kind === 219) { return resolveEntityName(location.name, 107455); } return undefined; @@ -15958,7 +16065,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 220; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15999,16 +16106,16 @@ var ts; case 199: generateNameForModuleOrEnum(node); break; - case 203: + case 204: generateNameForImportDeclaration(node); break; - case 209: + case 210: generateNameForExportDeclaration(node); break; - case 208: + case 209: generateNameForExportAssignment(node); break; - case 220: + case 221: case 201: ts.forEach(node.statements, generateNames); break; @@ -16042,7 +16149,7 @@ var ts; assignGeneratedName(node, makeUniqueName(baseName)); } function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 206) { + if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { generateNameForImportOrExportDeclaration(node); } } @@ -16072,7 +16179,7 @@ var ts; } function getAliasNameSubstitution(symbol) { var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 207) { + if (declaration && declaration.kind === 208) { var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); var propertyName = declaration.propertyName || declaration.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -16111,7 +16218,7 @@ var ts; return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 220 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } return isAliasResolvedToValue(getSymbolOfNode(node)); @@ -16149,14 +16256,14 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 219) { + if (node.kind === 220) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 219) { + if (declaration.kind === 220) { return getEnumMemberValue(declaration); } } @@ -16174,6 +16281,7 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } function isUnknownIdentifier(location, name) { + ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); return !resolveName(location, name, 107455, undefined, undefined) && !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); } @@ -16196,7 +16304,7 @@ var ts; resolveName(n, n.text, 2 | 8388608, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 216; + symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -16273,10 +16381,10 @@ var ts; case 175: case 195: case 198: + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 128: break; default: @@ -16311,7 +16419,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -16320,7 +16428,7 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 128) { @@ -16373,7 +16481,7 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 203 || node.kind === 202) && flags & 2) { + else if ((node.kind === 204 || node.kind === 203) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 197 && flags & 2) { @@ -16604,7 +16712,7 @@ var ts; continue; } var currentKind; - if (prop.kind === 217 || prop.kind === 218) { + if (prop.kind === 218 || prop.kind === 219) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 7) { checkGrammarNumbericLiteral(name); @@ -16998,10 +17106,10 @@ var ts; } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { if (node.kind === 197 || + node.kind === 204 || node.kind === 203 || - node.kind === 202 || + node.kind === 210 || node.kind === 209 || - node.kind === 208 || (node.flags & 2)) { return false; } @@ -17029,7 +17137,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 220) { + if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 221) { var links = getNodeLinks(node.parent); if (!links.hasReportedStatementInAmbientContext) { return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -17520,7 +17628,7 @@ var ts; ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 202 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -18260,17 +18368,17 @@ var ts; return emitClassDeclaration(node); case 198: return emitTypeAliasDeclaration(node); - case 219: + case 220: return emitEnumMemberDeclaration(node); case 199: return emitEnumDeclaration(node); case 200: return emitModuleDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 208: + case 209: return emitExportAssignment(node); - case 220: + case 221: return emitSourceFile(node); } } @@ -18330,6 +18438,7 @@ var ts; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; var lastFrame; var currentScopeNames; @@ -18347,9 +18456,10 @@ var ts; var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { } : emitPinnedOrTripleSlashCommentsOfNode; var writeComment = writeCommentRange; - var emit = emitNode; + var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var emit = emitNodeWithoutSourceMap; + var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; var emitStart = function (node) { }; var emitEnd = function (node) { }; var emitToken = emitTokenText; @@ -18360,18 +18470,22 @@ var ts; initializeEmitterWithSourceMaps(); } if (root) { - emit(root); + emitSourceFile(root); } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); + emitSourceFile(sourceFile); } }); } writeLine(); writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); return; + function emitSourceFile(sourceFile) { + currentSourceFile = sourceFile; + emit(sourceFile); + } function enterNameScope() { var names = currentScopeNames; currentScopeNames = undefined; @@ -18398,6 +18512,9 @@ var ts; else { name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); } + return recordNameInCurrentScope(name); + } + function recordNameInCurrentScope(name) { if (!currentScopeNames) { currentScopeNames = {}; } @@ -18652,21 +18769,32 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithMap(node) { + function emitNodeWithSourceMap(node) { if (node) { - if (node.kind != 220) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node); + } + if (node.kind != 221) { recordEmitNodeStartSpan(node); - emitNode(node); + emitNodeWithoutSourceMap(node); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNode(node); + emitNodeWithoutSourceMap(node); } } } + function emitNodeWithSourceMapWithoutComments(node) { + if (node) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMapWithoutComments(node); + recordEmitNodeEndSpan(node); + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; + emit = emitNodeWithSourceMap; + emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -18686,6 +18814,7 @@ var ts; name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); tempCount++; } + recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); result.text = name; return result; @@ -18747,7 +18876,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -18757,7 +18886,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -18767,12 +18896,11 @@ var ts; } emit(nodes[i]); } - var closeTokenIsOnSameLineAsLastElement = nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes)); if (nodes.hasTrailingComma && allowTrailingComma) { write(","); } decreaseIndent(); - if (closeTokenIsOnSameLineAsLastElement) { + if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19012,9 +19140,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 195: @@ -19025,11 +19153,11 @@ var ts; case 197: case 199: case 200: - case 202: + case 203: return parent.name === node; case 185: case 184: - case 208: + case 209: return false; case 189: return node.parent.label === node; @@ -19217,9 +19345,9 @@ var ts; } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 217: - return property.initializer; case 218: + return property.initializer; + case 219: return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); case 132: return createFunctionExpression(property.parameters, property.body); @@ -19273,6 +19401,11 @@ var ts; result.right = right; return result; } + function createExpressionStatement(expression) { + var result = ts.createSynthesizedNode(177); + result.expression = expression; + return result; + } function createMemberAccessForPropertyName(expression, memberName) { if (memberName.kind === 64) { return createPropertyAccessExpression(expression, memberName); @@ -19288,7 +19421,7 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(217); + var result = ts.createSynthesizedNode(218); result.name = name; result.initializer = initializer; return result; @@ -19383,29 +19516,31 @@ var ts; } return false; } - function indentIfOnDifferentLines(parent, node1, node2) { - var isSynthesized = ts.nodeIsSynthesized(parent); - var realNodesAreOnDifferentLines = !isSynthesized && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { + var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); writeLine(); return true; } - return false; + else { + if (valueToWriteWhenNotIndenting) { + write(valueToWriteWhenNotIndenting); + } + return false; + } } function emitPropertyAccess(node) { if (tryEmitConstantValue(node)) { return; } emit(node.expression); - var indented = indentIfOnDifferentLines(node, node.expression, node.dotToken); + var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); - indented = indented || indentIfOnDifferentLines(node, node.dotToken, node.name); + var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); emit(node.name); - if (indented) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { emit(node.left); @@ -19587,25 +19722,15 @@ var ts; function emitBinaryExpression(node) { if (languageVersion < 2 && node.operatorToken.kind === 52 && (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node); + emitDestructuring(node, node.parent.kind === 177); } else { emit(node.left); - var indented1 = indentIfOnDifferentLines(node, node.left, node.operatorToken); - if (!indented1 && node.operatorToken.kind !== 23) { - write(" "); - } + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); - if (!indented1) { - var indented2 = indentIfOnDifferentLines(node, node.operatorToken, node.right); - } - if (!indented2) { - write(" "); - } + var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); - if (indented1 || indented2) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); } } function synthesizedNodeStartsOnNewLine(node) { @@ -19613,34 +19738,22 @@ var ts; } function emitConditionalExpression(node) { emit(node.condition); - var indent1 = indentIfOnDifferentLines(node, node.condition, node.questionToken); - if (!indent1) { - write(" "); - } + var indentedBeforeQuestion = indentIfOnDifferentLines(node, node.condition, node.questionToken, " "); write("?"); - if (!indent1) { - var indent2 = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue); - } - if (!indent2) { - write(" "); - } + var indentedAfterQuestion = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue, " "); emit(node.whenTrue); - if (indent1 || indent2) { - decreaseIndent(); - } - var indent3 = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken); - if (!indent3) { - write(" "); - } + decreaseIndentIf(indentedBeforeQuestion, indentedAfterQuestion); + var indentedBeforeColon = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken, " "); write(":"); - if (!indent3) { - var indent4 = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse); - } - if (!indent4) { - write(" "); - } + var indentedAfterColon = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse, " "); emit(node.whenFalse); - if (indent3 || indent4) { + decreaseIndentIf(indentedBeforeColon, indentedAfterColon); + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { decreaseIndent(); } } @@ -19651,7 +19764,7 @@ var ts; } } function emitBlock(node) { - if (isSingleLineEmptyBlock(node)) { + if (preserveNewLines && isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -19773,6 +19886,9 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { + if (languageVersion < 2 && node.kind === 183) { + return emitDownLevelForOfStatement(node); + } var endPos = emitToken(81, node.pos); write(" "); endPos = emitToken(16, endPos); @@ -19798,6 +19914,86 @@ var ts; emitToken(17, node.expression.end); emitEmbeddedStatement(node.statement); } + function emitDownLevelForOfStatement(node) { + var endPos = emitToken(81, node.pos); + write(" "); + endPos = emitToken(16, endPos); + var rhsIsIdentifier = node.expression.kind === 64; + var counter = createTempVariable(node, true); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + emitStart(node.expression); + write("var "); + emitNodeWithoutSourceMap(counter); + write(" = 0"); + emitEnd(node.expression); + if (!rhsIsIdentifier) { + write(", "); + emitStart(node.expression); + emitNodeWithoutSourceMap(rhsReference); + write(" = "); + emitNodeWithoutSourceMap(node.expression); + emitEnd(node.expression); + } + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write(" < "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + emitEnd(node.initializer); + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write("++"); + emitEnd(node.initializer); + emitToken(17, node.expression.end); + write(" {"); + writeLine(); + increaseIndent(); + var rhsIterationValue = createElementAccessExpression(rhsReference, counter); + emitStart(node.initializer); + if (node.initializer.kind === 194) { + write("var "); + var variableDeclarationList = node.initializer; + if (variableDeclarationList.declarations.length > 0) { + var declaration = variableDeclarationList.declarations[0]; + if (ts.isBindingPattern(declaration.name)) { + emitDestructuring(declaration, false, rhsIterationValue); + } + else { + emitNodeWithoutSourceMap(declaration); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + emitNodeWithoutSourceMap(createTempVariable(node, false)); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); + if (node.initializer.kind === 151 || node.initializer.kind === 152) { + emitDestructuring(assignmentExpression, true, undefined, node); + } + else { + emitNodeWithoutSourceMap(assignmentExpression); + } + } + emitEnd(node.initializer); + write(";"); + if (node.statement.kind === 174) { + emitLines(node.statement.statements); + } + else { + writeLine(); + emit(node.statement); + } + writeLine(); + decreaseIndent(); + write("}"); + } function emitBreakOrContinueStatement(node) { emitToken(node.kind === 185 ? 65 : 70, node.pos); emitOptional(" ", node.label); @@ -19821,7 +20017,10 @@ var ts; emit(node.expression); endPos = emitToken(17, node.expression.end); write(" "); - emitToken(14, endPos); + emitCaseBlock(node.caseBlock, endPos); + } + function emitCaseBlock(node, startPos) { + emitToken(14, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); @@ -19841,7 +20040,7 @@ var ts; getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 213) { + if (node.kind === 214) { write("case "); emit(node.expression); write(":"); @@ -19849,7 +20048,7 @@ var ts; else { write("default:"); } - if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -19909,7 +20108,7 @@ var ts; emitContainingModuleName(node); write("."); } - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { @@ -19926,21 +20125,22 @@ var ts; emitStart(specifier.name); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNode(name); + emitNodeWithoutSourceMap(name); write(";"); }); } } - function emitDestructuring(root, value) { + function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } else { + ts.Debug.assert(!isAssignmentExpressionStatement); emitBindingElement(root, value); } function emitAssignment(name, value) { @@ -19959,7 +20159,7 @@ var ts; } function ensureIdentifier(expr) { if (expr.kind !== 64) { - var identifier = createTempVariable(root); + var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -20017,7 +20217,7 @@ var ts; } for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20062,7 +20262,7 @@ var ts; function emitAssignmentExpression(root) { var target = root.left; var value = root.right; - if (root.parent.kind === 177) { + if (isAssignmentExpressionStatement) { emitDestructuringAssignment(target, value); } else { @@ -20119,7 +20319,7 @@ var ts; function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { if (languageVersion < 2) { - emitDestructuring(node); + emitDestructuring(node, false); } else { emit(node.name); @@ -20127,7 +20327,7 @@ var ts; } } else { - var isLet = renameNonTopLevelLetAndConst(node.name); + renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { @@ -20151,29 +20351,6 @@ var ts; ts.forEach(name.elements, emitExportVariableAssignments); } } - function getEnclosingBlockScopeContainer(node) { - var current = node; - while (current) { - if (ts.isFunctionLike(current)) { - return current; - } - switch (current.kind) { - case 220: - case 91: - case 216: - case 200: - case 181: - case 182: - case 183: - return current; - case 174: - if (!ts.isFunctionLike(current.parent)) { - return current; - } - } - current = current.parent; - } - } function getCombinedFlagsForIdentifier(node) { if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return 0; @@ -20192,11 +20369,11 @@ var ts; return; } var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 220) { + if (list.parent.kind === 175 && list.parent.parent.kind === 221) { return; } - var blockScopeContainer = getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 220 + var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); + var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; var generatedName = generateUniqueNameForLocation(parent, node.text); @@ -20245,7 +20422,7 @@ var ts; if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); - emitDestructuring(p, tempParameters[tempIndex]); + emitDestructuring(p, false, tempParameters[tempIndex]); write(";"); tempIndex++; } @@ -20253,14 +20430,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitNode(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -20276,7 +20453,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -20297,7 +20474,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -20315,7 +20492,7 @@ var ts; } function emitDeclarationName(node) { if (node.name) { - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(resolver.getGeneratedNameForNode(node)); @@ -20432,11 +20609,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitNode(body, true); + emitWithoutComments(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -20447,7 +20624,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emit(node.body, true); + emitWithoutComments(node.body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -20469,7 +20646,7 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { for (var i = 0, n = body.statements.length; i < n; i++) { write(" "); emit(body.statements[i]); @@ -20510,7 +20687,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitNode(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -20522,7 +20699,7 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } else if (memberName.kind === 126) { @@ -20530,7 +20707,7 @@ var ts; } else { write("."); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); } } function emitMemberAssignments(node, staticFlag) { @@ -20989,11 +21166,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitNode(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); }); @@ -21011,15 +21188,15 @@ var ts; } } function createExternalImportInfo(node) { - if (node.kind === 202) { - if (node.moduleReference.kind === 212) { + if (node.kind === 203) { + if (node.moduleReference.kind === 213) { return { rootNode: node, declarationNode: node }; } } - else if (node.kind === 203) { + else if (node.kind === 204) { var importClause = node.importClause; if (importClause) { if (importClause.name) { @@ -21028,7 +21205,7 @@ var ts; declarationNode: importClause }; } - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { return { rootNode: node, declarationNode: importClause.namedBindings @@ -21044,7 +21221,7 @@ var ts; rootNode: node }; } - else if (node.kind === 209) { + else if (node.kind === 210) { if (node.moduleSpecifier) { return { rootNode: node @@ -21057,7 +21234,7 @@ var ts; exportSpecifiers = {}; exportDefault = undefined; ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209 && !node.moduleSpecifier) { + if (node.kind === 210 && !node.moduleSpecifier) { ts.forEach(node.exportClause.elements, function (specifier) { if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; @@ -21066,7 +21243,7 @@ var ts; (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); }); } - else if (node.kind === 208) { + else if (node.kind === 209) { exportDefault = exportDefault || node; } else if (node.kind === 195 || node.kind === 196) { @@ -21096,7 +21273,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } }); @@ -21174,10 +21351,10 @@ var ts; writeLine(); emitStart(exportDefault); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 208) { + if (exportDefault.kind === 209) { emit(exportDefault.expression); } - else if (exportDefault.kind === 211) { + else if (exportDefault.kind === 212) { emit(exportDefault.propertyName); } else { @@ -21201,8 +21378,7 @@ var ts; } return statements.length; } - function emitSourceFile(node) { - currentSourceFile = node; + function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); @@ -21242,14 +21418,14 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emitNode(node, disableComments) { + function emitNodeWithoutSourceMapWithComments(node) { if (!node) { return; } if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = !disableComments && shouldEmitLeadingAndTrailingComments(node); + var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } @@ -21258,14 +21434,23 @@ var ts; emitTrailingComments(node); } } + function emitNodeWithoutSourceMapWithoutComments(node) { + if (!node) { + return; + } + if (node.flags & 2) { + return emitPinnedOrTripleSlashComments(node); + } + emitJavaScriptWorker(node); + } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { case 197: case 195: + case 204: case 203: - case 202: case 198: - case 208: + case 209: return false; case 200: return shouldEmitModuleDeclaration(node); @@ -21320,9 +21505,9 @@ var ts; return emitArrayLiteral(node); case 152: return emitObjectLiteral(node); - case 217: - return emitPropertyAssignment(node); case 218: + return emitPropertyAssignment(node); + case 219: return emitShorthandPropertyAssignment(node); case 126: return emitComputedPropertyName(node); @@ -21391,8 +21576,8 @@ var ts; return emitWithStatement(node); case 188: return emitSwitchStatement(node); - case 213: case 214: + case 215: return emitCaseOrDefaultClause(node); case 189: return emitLabelledStatement(node); @@ -21400,7 +21585,7 @@ var ts; return emitThrowStatement(node); case 191: return emitTryStatement(node); - case 216: + case 217: return emitCatchClause(node); case 192: return emitDebuggerStatement(node); @@ -21412,18 +21597,18 @@ var ts; return emitInterfaceDeclaration(node); case 199: return emitEnumDeclaration(node); - case 219: + case 220: return emitEnumMember(node); case 200: return emitModuleDeclaration(node); - case 203: + case 204: return emitImportDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 209: + case 210: return emitExportDeclaration(node); - case 220: - return emitSourceFile(node); + case 221: + return emitSourceFileNode(node); } } function hasDetachedComments(pos) { @@ -21441,7 +21626,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 220 || node.pos !== node.parent.pos) { + if (node.parent.kind === 221 || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -21460,7 +21645,7 @@ var ts; } function emitTrailingDeclarationComments(node) { if (node.parent) { - if (node.parent.kind === 220 || node.end !== node.parent.end) { + if (node.parent.kind === 221 || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } @@ -21510,7 +21695,7 @@ var ts; } } } - function emitPinnedOrTripleSlashCommentsOfNode(node) { + function emitPinnedOrTripleSlashComments(node) { var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); function isPinnedOrTripleSlashComment(comment) { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { @@ -21556,6 +21741,7 @@ var ts; (function (ts) { ts.emitTime = 0; ts.ioReadTime = 0; + ts.version = "1.5.0.0"; function createCompilerHost(options) { var currentDirectory; var existingDirectories = {}; @@ -21846,7 +22032,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 203 || node.kind === 202 || node.kind === 209) { + if (node.kind === 204 || node.kind === 203 || node.kind === 210) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22087,6 +22273,12 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, + { + name: "preserveNewLines", + type: "boolean", + description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, + experimental: true + }, { name: "target", shortName: "t", @@ -22289,7 +22481,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var version = "1.5.0.0"; function validateLocaleAndSetLanguage(locale, errors) { var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); if (!matchResult) { @@ -22424,7 +22615,7 @@ var ts; return ts.sys.exit(1); } if (commandLine.options.version) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, version)); + reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, ts.version)); return ts.sys.exit(0); } if (commandLine.options.help) { @@ -22600,13 +22791,13 @@ var ts; return 1; } if (diagnostics.length > 0 || emitOutput.diagnostics.length > 0) { - 2; + return 2; } return 0; } } function printVersion() { - ts.sys.write(getDiagnosticText(ts.Diagnostics.Version_0, version) + ts.sys.newLine); + ts.sys.write(getDiagnosticText(ts.Diagnostics.Version_0, ts.version) + ts.sys.newLine); } function printHelp() { var output = ""; diff --git a/bin/tsserver.js b/bin/tsserver.js index 3c4c266cb7006..65a06ca9928e3 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -244,18 +244,21 @@ var ts; ts.arrayToMap = arrayToMap; function formatStringFromArgs(text, args, baseIndex) { baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + return text.replace(/{(\d+)}/g, function (match, index) { + return args[+index + baseIndex]; + }); } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] - ? ts.localizedDiagnosticMessages[message] - : message; + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { + var end = start + length; Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); + Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); @@ -318,12 +321,7 @@ var ts; return diagnostic.file ? diagnostic.file.fileName : undefined; } function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || - compareValues(d1.start, d2.start) || - compareValues(d1.length, d2.length) || - compareValues(d1.code, d2.code) || - compareMessageText(d1.messageText, d2.messageText) || - 0; + return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || 0; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { @@ -350,7 +348,9 @@ var ts; if (diagnostics.length < 2) { return diagnostics; } - var newDiagnostics = [diagnostics[0]]; + var newDiagnostics = [ + diagnostics[0] + ]; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; @@ -427,7 +427,9 @@ var ts; ts.isRootedDiskPath = isRootedDiskPath; function normalizedPathComponents(path, rootLength) { var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); + return [ + path.substr(0, rootLength) + ].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { var path = normalizeSlashes(path); @@ -461,7 +463,9 @@ var ts; } } if (rootLength === urlLength) { - return [url]; + return [ + url + ]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -469,7 +473,9 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [url + ts.directorySeparator]; + return [ + url + ts.directorySeparator + ]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -531,7 +537,11 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; + var supportedExtensions = [ + ".d.ts", + ".ts", + ".js" + ]; function removeFileExtension(path) { for (var i = 0; i < supportedExtensions.length; i++) { var ext = supportedExtensions[i]; @@ -585,9 +595,15 @@ var ts; }; return Node; }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } + getSymbolConstructor: function () { + return Symbol; + }, + getTypeConstructor: function () { + return Type; + }, + getSignatureConstructor: function () { + return Signature; + } }; var Debug; (function (Debug) { @@ -805,9 +821,14 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + _fs.watchFile(fileName, { + persistent: true, + interval: 250 + }, fileChanged); return { - close: function () { _fs.unwatchFile(fileName, fileChanged); } + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } }; function fileChanged(curr, prev) { if (+curr.mtime <= +prev.mtime) { @@ -858,493 +879,2436 @@ var ts; else { return undefined; } - })(); -})(ts || (ts = {})); -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: 1, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1, key: "'{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." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + })(); +})(ts || (ts = {})); +var ts; +(function (ts) { + ts.Diagnostics = { + Unterminated_string_literal: { + code: 1002, + category: 1, + key: "Unterminated string literal." + }, + Identifier_expected: { + code: 1003, + category: 1, + key: "Identifier expected." + }, + _0_expected: { + code: 1005, + category: 1, + key: "'{0}' expected." + }, + A_file_cannot_have_a_reference_to_itself: { + code: 1006, + category: 1, + key: "A file cannot have a reference to itself." + }, + Trailing_comma_not_allowed: { + code: 1009, + category: 1, + key: "Trailing comma not allowed." + }, + Asterisk_Slash_expected: { + code: 1010, + category: 1, + key: "'*/' expected." + }, + Unexpected_token: { + code: 1012, + category: 1, + key: "Unexpected token." + }, + A_rest_parameter_must_be_last_in_a_parameter_list: { + code: 1014, + category: 1, + key: "A rest parameter must be last in a parameter list." + }, + Parameter_cannot_have_question_mark_and_initializer: { + code: 1015, + category: 1, + key: "Parameter cannot have question mark and initializer." + }, + A_required_parameter_cannot_follow_an_optional_parameter: { + code: 1016, + category: 1, + key: "A required parameter cannot follow an optional parameter." + }, + An_index_signature_cannot_have_a_rest_parameter: { + code: 1017, + category: 1, + key: "An index signature cannot have a rest parameter." + }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { + code: 1018, + category: 1, + key: "An index signature parameter cannot have an accessibility modifier." + }, + An_index_signature_parameter_cannot_have_a_question_mark: { + code: 1019, + category: 1, + key: "An index signature parameter cannot have a question mark." + }, + An_index_signature_parameter_cannot_have_an_initializer: { + code: 1020, + category: 1, + key: "An index signature parameter cannot have an initializer." + }, + An_index_signature_must_have_a_type_annotation: { + code: 1021, + category: 1, + key: "An index signature must have a type annotation." + }, + An_index_signature_parameter_must_have_a_type_annotation: { + code: 1022, + category: 1, + key: "An index signature parameter must have a type annotation." + }, + An_index_signature_parameter_type_must_be_string_or_number: { + code: 1023, + category: 1, + key: "An index signature parameter type must be 'string' or 'number'." + }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { + code: 1024, + category: 1, + key: "A class or interface declaration can only have one 'extends' clause." + }, + An_extends_clause_must_precede_an_implements_clause: { + code: 1025, + category: 1, + key: "An 'extends' clause must precede an 'implements' clause." + }, + A_class_can_only_extend_a_single_class: { + code: 1026, + category: 1, + key: "A class can only extend a single class." + }, + A_class_declaration_can_only_have_one_implements_clause: { + code: 1027, + category: 1, + key: "A class declaration can only have one 'implements' clause." + }, + Accessibility_modifier_already_seen: { + code: 1028, + category: 1, + key: "Accessibility modifier already seen." + }, + _0_modifier_must_precede_1_modifier: { + code: 1029, + category: 1, + key: "'{0}' modifier must precede '{1}' modifier." + }, + _0_modifier_already_seen: { + code: 1030, + category: 1, + key: "'{0}' modifier already seen." + }, + _0_modifier_cannot_appear_on_a_class_element: { + code: 1031, + category: 1, + key: "'{0}' modifier cannot appear on a class element." + }, + An_interface_declaration_cannot_have_an_implements_clause: { + code: 1032, + category: 1, + key: "An interface declaration cannot have an 'implements' clause." + }, + super_must_be_followed_by_an_argument_list_or_member_access: { + code: 1034, + category: 1, + key: "'super' must be followed by an argument list or member access." + }, + Only_ambient_modules_can_use_quoted_names: { + code: 1035, + category: 1, + key: "Only ambient modules can use quoted names." + }, + Statements_are_not_allowed_in_ambient_contexts: { + code: 1036, + category: 1, + key: "Statements are not allowed in ambient contexts." + }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { + code: 1038, + category: 1, + key: "A 'declare' modifier cannot be used in an already ambient context." + }, + Initializers_are_not_allowed_in_ambient_contexts: { + code: 1039, + category: 1, + key: "Initializers are not allowed in ambient contexts." + }, + _0_modifier_cannot_appear_on_a_module_element: { + code: 1044, + category: 1, + key: "'{0}' modifier cannot appear on a module element." + }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { + code: 1045, + category: 1, + key: "A 'declare' modifier cannot be used with an interface declaration." + }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { + code: 1046, + category: 1, + key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." + }, + A_rest_parameter_cannot_be_optional: { + code: 1047, + category: 1, + key: "A rest parameter cannot be optional." + }, + A_rest_parameter_cannot_have_an_initializer: { + code: 1048, + category: 1, + key: "A rest parameter cannot have an initializer." + }, + A_set_accessor_must_have_exactly_one_parameter: { + code: 1049, + category: 1, + key: "A 'set' accessor must have exactly one parameter." + }, + A_set_accessor_cannot_have_an_optional_parameter: { + code: 1051, + category: 1, + key: "A 'set' accessor cannot have an optional parameter." + }, + A_set_accessor_parameter_cannot_have_an_initializer: { + code: 1052, + category: 1, + key: "A 'set' accessor parameter cannot have an initializer." + }, + A_set_accessor_cannot_have_rest_parameter: { + code: 1053, + category: 1, + key: "A 'set' accessor cannot have rest parameter." + }, + A_get_accessor_cannot_have_parameters: { + code: 1054, + category: 1, + key: "A 'get' accessor cannot have parameters." + }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { + code: 1056, + category: 1, + key: "Accessors are only available when targeting ECMAScript 5 and higher." + }, + Enum_member_must_have_initializer: { + code: 1061, + category: 1, + key: "Enum member must have initializer." + }, + An_export_assignment_cannot_be_used_in_an_internal_module: { + code: 1063, + category: 1, + key: "An export assignment cannot be used in an internal module." + }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { + code: 1066, + category: 1, + key: "Ambient enum elements can only have integer literal initializers." + }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { + code: 1068, + category: 1, + key: "Unexpected token. A constructor, method, accessor, or property was expected." + }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { + code: 1079, + category: 1, + key: "A 'declare' modifier cannot be used with an import declaration." + }, + Invalid_reference_directive_syntax: { + code: 1084, + category: 1, + key: "Invalid 'reference' directive syntax." + }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { + code: 1085, + category: 1, + key: "Octal literals are not available when targeting ECMAScript 5 and higher." + }, + An_accessor_cannot_be_declared_in_an_ambient_context: { + code: 1086, + category: 1, + key: "An accessor cannot be declared in an ambient context." + }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { + code: 1089, + category: 1, + key: "'{0}' modifier cannot appear on a constructor declaration." + }, + _0_modifier_cannot_appear_on_a_parameter: { + code: 1090, + category: 1, + key: "'{0}' modifier cannot appear on a parameter." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { + code: 1091, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...in' statement." + }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { + code: 1092, + category: 1, + key: "Type parameters cannot appear on a constructor declaration." + }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { + code: 1093, + category: 1, + key: "Type annotation cannot appear on a constructor declaration." + }, + An_accessor_cannot_have_type_parameters: { + code: 1094, + category: 1, + key: "An accessor cannot have type parameters." + }, + A_set_accessor_cannot_have_a_return_type_annotation: { + code: 1095, + category: 1, + key: "A 'set' accessor cannot have a return type annotation." + }, + An_index_signature_must_have_exactly_one_parameter: { + code: 1096, + category: 1, + key: "An index signature must have exactly one parameter." + }, + _0_list_cannot_be_empty: { + code: 1097, + category: 1, + key: "'{0}' list cannot be empty." + }, + Type_parameter_list_cannot_be_empty: { + code: 1098, + category: 1, + key: "Type parameter list cannot be empty." + }, + Type_argument_list_cannot_be_empty: { + code: 1099, + category: 1, + key: "Type argument list cannot be empty." + }, + Invalid_use_of_0_in_strict_mode: { + code: 1100, + category: 1, + key: "Invalid use of '{0}' in strict mode." + }, + with_statements_are_not_allowed_in_strict_mode: { + code: 1101, + category: 1, + key: "'with' statements are not allowed in strict mode." + }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { + code: 1102, + category: 1, + key: "'delete' cannot be called on an identifier in strict mode." + }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { + code: 1104, + category: 1, + key: "A 'continue' statement can only be used within an enclosing iteration statement." + }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { + code: 1105, + category: 1, + key: "A 'break' statement can only be used within an enclosing iteration or switch statement." + }, + Jump_target_cannot_cross_function_boundary: { + code: 1107, + category: 1, + key: "Jump target cannot cross function boundary." + }, + A_return_statement_can_only_be_used_within_a_function_body: { + code: 1108, + category: 1, + key: "A 'return' statement can only be used within a function body." + }, + Expression_expected: { + code: 1109, + category: 1, + key: "Expression expected." + }, + Type_expected: { + code: 1110, + category: 1, + key: "Type expected." + }, + A_class_member_cannot_be_declared_optional: { + code: 1112, + category: 1, + key: "A class member cannot be declared optional." + }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { + code: 1113, + category: 1, + key: "A 'default' clause cannot appear more than once in a 'switch' statement." + }, + Duplicate_label_0: { + code: 1114, + category: 1, + key: "Duplicate label '{0}'" + }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { + code: 1115, + category: 1, + key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." + }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { + code: 1116, + category: 1, + key: "A 'break' statement can only jump to a label of an enclosing statement." + }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { + code: 1117, + category: 1, + key: "An object literal cannot have multiple properties with the same name in strict mode." + }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { + code: 1118, + category: 1, + key: "An object literal cannot have multiple get/set accessors with the same name." + }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { + code: 1119, + category: 1, + key: "An object literal cannot have property and accessor with the same name." + }, + An_export_assignment_cannot_have_modifiers: { + code: 1120, + category: 1, + key: "An export assignment cannot have modifiers." + }, + Octal_literals_are_not_allowed_in_strict_mode: { + code: 1121, + category: 1, + key: "Octal literals are not allowed in strict mode." + }, + A_tuple_type_element_list_cannot_be_empty: { + code: 1122, + category: 1, + key: "A tuple type element list cannot be empty." + }, + Variable_declaration_list_cannot_be_empty: { + code: 1123, + category: 1, + key: "Variable declaration list cannot be empty." + }, + Digit_expected: { + code: 1124, + category: 1, + key: "Digit expected." + }, + Hexadecimal_digit_expected: { + code: 1125, + category: 1, + key: "Hexadecimal digit expected." + }, + Unexpected_end_of_text: { + code: 1126, + category: 1, + key: "Unexpected end of text." + }, + Invalid_character: { + code: 1127, + category: 1, + key: "Invalid character." + }, + Declaration_or_statement_expected: { + code: 1128, + category: 1, + key: "Declaration or statement expected." + }, + Statement_expected: { + code: 1129, + category: 1, + key: "Statement expected." + }, + case_or_default_expected: { + code: 1130, + category: 1, + key: "'case' or 'default' expected." + }, + Property_or_signature_expected: { + code: 1131, + category: 1, + key: "Property or signature expected." + }, + Enum_member_expected: { + code: 1132, + category: 1, + key: "Enum member expected." + }, + Type_reference_expected: { + code: 1133, + category: 1, + key: "Type reference expected." + }, + Variable_declaration_expected: { + code: 1134, + category: 1, + key: "Variable declaration expected." + }, + Argument_expression_expected: { + code: 1135, + category: 1, + key: "Argument expression expected." + }, + Property_assignment_expected: { + code: 1136, + category: 1, + key: "Property assignment expected." + }, + Expression_or_comma_expected: { + code: 1137, + category: 1, + key: "Expression or comma expected." + }, + Parameter_declaration_expected: { + code: 1138, + category: 1, + key: "Parameter declaration expected." + }, + Type_parameter_declaration_expected: { + code: 1139, + category: 1, + key: "Type parameter declaration expected." + }, + Type_argument_expected: { + code: 1140, + category: 1, + key: "Type argument expected." + }, + String_literal_expected: { + code: 1141, + category: 1, + key: "String literal expected." + }, + Line_break_not_permitted_here: { + code: 1142, + category: 1, + key: "Line break not permitted here." + }, + or_expected: { + code: 1144, + category: 1, + key: "'{' or ';' expected." + }, + Modifiers_not_permitted_on_index_signature_members: { + code: 1145, + category: 1, + key: "Modifiers not permitted on index signature members." + }, + Declaration_expected: { + code: 1146, + category: 1, + key: "Declaration expected." + }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { + code: 1147, + category: 1, + key: "Import declarations in an internal module cannot reference an external module." + }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { + code: 1148, + category: 1, + key: "Cannot compile external modules unless the '--module' flag is provided." + }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { + code: 1149, + category: 1, + key: "File name '{0}' differs from already included file name '{1}' only in casing" + }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { + code: 1150, + category: 1, + key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." + }, + var_let_or_const_expected: { + code: 1152, + category: 1, + key: "'var', 'let' or 'const' expected." + }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1153, + category: 1, + key: "'let' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1154, + category: 1, + key: "'const' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_must_be_initialized: { + code: 1155, + category: 1, + key: "'const' declarations must be initialized" + }, + const_declarations_can_only_be_declared_inside_a_block: { + code: 1156, + category: 1, + key: "'const' declarations can only be declared inside a block." + }, + let_declarations_can_only_be_declared_inside_a_block: { + code: 1157, + category: 1, + key: "'let' declarations can only be declared inside a block." + }, + Unterminated_template_literal: { + code: 1160, + category: 1, + key: "Unterminated template literal." + }, + Unterminated_regular_expression_literal: { + code: 1161, + category: 1, + key: "Unterminated regular expression literal." + }, + An_object_member_cannot_be_declared_optional: { + code: 1162, + category: 1, + key: "An object member cannot be declared optional." + }, + yield_expression_must_be_contained_within_a_generator_declaration: { + code: 1163, + category: 1, + key: "'yield' expression must be contained_within a generator declaration." + }, + Computed_property_names_are_not_allowed_in_enums: { + code: 1164, + category: 1, + key: "Computed property names are not allowed in enums." + }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { + code: 1165, + category: 1, + key: "A computed property name in an ambient context must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { + code: 1166, + category: 1, + key: "A computed property name in a class property declaration must directly refer to a built-in symbol." + }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1167, + category: 1, + key: "Computed property names are only available when targeting ECMAScript 6 and higher." + }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { + code: 1168, + category: 1, + key: "A computed property name in a method overload must directly refer to a built-in symbol." + }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { + code: 1169, + category: 1, + key: "A computed property name in an interface must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { + code: 1170, + category: 1, + key: "A computed property name in a type literal must directly refer to a built-in symbol." + }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { + code: 1171, + category: 1, + key: "A comma expression is not allowed in a computed property name." + }, + extends_clause_already_seen: { + code: 1172, + category: 1, + key: "'extends' clause already seen." + }, + extends_clause_must_precede_implements_clause: { + code: 1173, + category: 1, + key: "'extends' clause must precede 'implements' clause." + }, + Classes_can_only_extend_a_single_class: { + code: 1174, + category: 1, + key: "Classes can only extend a single class." + }, + implements_clause_already_seen: { + code: 1175, + category: 1, + key: "'implements' clause already seen." + }, + Interface_declaration_cannot_have_implements_clause: { + code: 1176, + category: 1, + key: "Interface declaration cannot have 'implements' clause." + }, + Binary_digit_expected: { + code: 1177, + category: 1, + key: "Binary digit expected." + }, + Octal_digit_expected: { + code: 1178, + category: 1, + key: "Octal digit expected." + }, + Unexpected_token_expected: { + code: 1179, + category: 1, + key: "Unexpected token. '{' expected." + }, + Property_destructuring_pattern_expected: { + code: 1180, + category: 1, + key: "Property destructuring pattern expected." + }, + Array_element_destructuring_pattern_expected: { + code: 1181, + category: 1, + key: "Array element destructuring pattern expected." + }, + A_destructuring_declaration_must_have_an_initializer: { + code: 1182, + category: 1, + key: "A destructuring declaration must have an initializer." + }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { + code: 1183, + category: 1, + key: "Destructuring declarations are not allowed in ambient contexts." + }, + An_implementation_cannot_be_declared_in_ambient_contexts: { + code: 1184, + category: 1, + key: "An implementation cannot be declared in ambient contexts." + }, + Modifiers_cannot_appear_here: { + code: 1184, + category: 1, + key: "Modifiers cannot appear here." + }, + Merge_conflict_marker_encountered: { + code: 1185, + category: 1, + key: "Merge conflict marker encountered." + }, + A_rest_element_cannot_have_an_initializer: { + code: 1186, + category: 1, + key: "A rest element cannot have an initializer." + }, + A_parameter_property_may_not_be_a_binding_pattern: { + code: 1187, + category: 1, + key: "A parameter property may not be a binding pattern." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { + code: 1188, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...of' statement." + }, + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { + code: 1189, + category: 1, + key: "The variable declaration of a 'for...in' statement cannot have an initializer." + }, + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { + code: 1190, + category: 1, + key: "The variable declaration of a 'for...of' statement cannot have an initializer." + }, + An_import_declaration_cannot_have_modifiers: { + code: 1191, + category: 1, + key: "An import declaration cannot have modifiers." + }, + External_module_0_has_no_default_export_or_export_assignment: { + code: 1192, + category: 1, + key: "External module '{0}' has no default export or export assignment." + }, + An_export_declaration_cannot_have_modifiers: { + code: 1193, + category: 1, + key: "An export declaration cannot have modifiers." + }, + Export_declarations_are_not_permitted_in_an_internal_module: { + code: 1194, + category: 1, + key: "Export declarations are not permitted in an internal module." + }, + Catch_clause_variable_name_must_be_an_identifier: { + code: 1195, + category: 1, + key: "Catch clause variable name must be an identifier." + }, + Catch_clause_variable_cannot_have_a_type_annotation: { + code: 1196, + category: 1, + key: "Catch clause variable cannot have a type annotation." + }, + Catch_clause_variable_cannot_have_an_initializer: { + code: 1197, + category: 1, + key: "Catch clause variable cannot have an initializer." + }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { + code: 1198, + category: 1, + key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." + }, + Unterminated_Unicode_escape_sequence: { + code: 1199, + category: 1, + key: "Unterminated Unicode escape sequence." + }, + Duplicate_identifier_0: { + code: 2300, + category: 1, + key: "Duplicate identifier '{0}'." + }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { + code: 2301, + category: 1, + key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." + }, + Static_members_cannot_reference_class_type_parameters: { + code: 2302, + category: 1, + key: "Static members cannot reference class type parameters." + }, + Circular_definition_of_import_alias_0: { + code: 2303, + category: 1, + key: "Circular definition of import alias '{0}'." + }, + Cannot_find_name_0: { + code: 2304, + category: 1, + key: "Cannot find name '{0}'." + }, + Module_0_has_no_exported_member_1: { + code: 2305, + category: 1, + key: "Module '{0}' has no exported member '{1}'." + }, + File_0_is_not_an_external_module: { + code: 2306, + category: 1, + key: "File '{0}' is not an external module." + }, + Cannot_find_external_module_0: { + code: 2307, + category: 1, + key: "Cannot find external module '{0}'." + }, + A_module_cannot_have_more_than_one_export_assignment: { + code: 2308, + category: 1, + key: "A module cannot have more than one export assignment." + }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { + code: 2309, + category: 1, + key: "An export assignment cannot be used in a module with other exported elements." + }, + Type_0_recursively_references_itself_as_a_base_type: { + code: 2310, + category: 1, + key: "Type '{0}' recursively references itself as a base type." + }, + A_class_may_only_extend_another_class: { + code: 2311, + category: 1, + key: "A class may only extend another class." + }, + An_interface_may_only_extend_a_class_or_another_interface: { + code: 2312, + category: 1, + key: "An interface may only extend a class or another interface." + }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { + code: 2313, + category: 1, + key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." + }, + Generic_type_0_requires_1_type_argument_s: { + code: 2314, + category: 1, + key: "Generic type '{0}' requires {1} type argument(s)." + }, + Type_0_is_not_generic: { + code: 2315, + category: 1, + key: "Type '{0}' is not generic." + }, + Global_type_0_must_be_a_class_or_interface_type: { + code: 2316, + category: 1, + key: "Global type '{0}' must be a class or interface type." + }, + Global_type_0_must_have_1_type_parameter_s: { + code: 2317, + category: 1, + key: "Global type '{0}' must have {1} type parameter(s)." + }, + Cannot_find_global_type_0: { + code: 2318, + category: 1, + key: "Cannot find global type '{0}'." + }, + Named_property_0_of_types_1_and_2_are_not_identical: { + code: 2319, + category: 1, + key: "Named property '{0}' of types '{1}' and '{2}' are not identical." + }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { + code: 2320, + category: 1, + key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." + }, + Excessive_stack_depth_comparing_types_0_and_1: { + code: 2321, + category: 1, + key: "Excessive stack depth comparing types '{0}' and '{1}'." + }, + Type_0_is_not_assignable_to_type_1: { + code: 2322, + category: 1, + key: "Type '{0}' is not assignable to type '{1}'." + }, + Property_0_is_missing_in_type_1: { + code: 2324, + category: 1, + key: "Property '{0}' is missing in type '{1}'." + }, + Property_0_is_private_in_type_1_but_not_in_type_2: { + code: 2325, + category: 1, + key: "Property '{0}' is private in type '{1}' but not in type '{2}'." + }, + Types_of_property_0_are_incompatible: { + code: 2326, + category: 1, + key: "Types of property '{0}' are incompatible." + }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { + code: 2327, + category: 1, + key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." + }, + Types_of_parameters_0_and_1_are_incompatible: { + code: 2328, + category: 1, + key: "Types of parameters '{0}' and '{1}' are incompatible." + }, + Index_signature_is_missing_in_type_0: { + code: 2329, + category: 1, + key: "Index signature is missing in type '{0}'." + }, + Index_signatures_are_incompatible: { + code: 2330, + category: 1, + key: "Index signatures are incompatible." + }, + this_cannot_be_referenced_in_a_module_body: { + code: 2331, + category: 1, + key: "'this' cannot be referenced in a module body." + }, + this_cannot_be_referenced_in_current_location: { + code: 2332, + category: 1, + key: "'this' cannot be referenced in current location." + }, + this_cannot_be_referenced_in_constructor_arguments: { + code: 2333, + category: 1, + key: "'this' cannot be referenced in constructor arguments." + }, + this_cannot_be_referenced_in_a_static_property_initializer: { + code: 2334, + category: 1, + key: "'this' cannot be referenced in a static property initializer." + }, + super_can_only_be_referenced_in_a_derived_class: { + code: 2335, + category: 1, + key: "'super' can only be referenced in a derived class." + }, + super_cannot_be_referenced_in_constructor_arguments: { + code: 2336, + category: 1, + key: "'super' cannot be referenced in constructor arguments." + }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { + code: 2337, + category: 1, + key: "Super calls are not permitted outside constructors or in nested functions inside constructors" + }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { + code: 2338, + category: 1, + key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" + }, + Property_0_does_not_exist_on_type_1: { + code: 2339, + category: 1, + key: "Property '{0}' does not exist on type '{1}'." + }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { + code: 2340, + category: 1, + key: "Only public and protected methods of the base class are accessible via the 'super' keyword" + }, + Property_0_is_private_and_only_accessible_within_class_1: { + code: 2341, + category: 1, + key: "Property '{0}' is private and only accessible within class '{1}'." + }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { + code: 2342, + category: 1, + key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." + }, + Type_0_does_not_satisfy_the_constraint_1: { + code: 2344, + category: 1, + key: "Type '{0}' does not satisfy the constraint '{1}'." + }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { + code: 2345, + category: 1, + key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." + }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { + code: 2346, + category: 1, + key: "Supplied parameters do not match any signature of call target." + }, + Untyped_function_calls_may_not_accept_type_arguments: { + code: 2347, + category: 1, + key: "Untyped function calls may not accept type arguments." + }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { + code: 2348, + category: 1, + key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" + }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { + code: 2349, + category: 1, + key: "Cannot invoke an expression whose type lacks a call signature." + }, + Only_a_void_function_can_be_called_with_the_new_keyword: { + code: 2350, + category: 1, + key: "Only a void function can be called with the 'new' keyword." + }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { + code: 2351, + category: 1, + key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." + }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { + code: 2352, + category: 1, + key: "Neither type '{0}' nor type '{1}' is assignable to the other." + }, + No_best_common_type_exists_among_return_expressions: { + code: 2354, + category: 1, + key: "No best common type exists among return expressions." + }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2355, + category: 1, + key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." + }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { + code: 2356, + category: 1, + key: "An arithmetic operand must be of type 'any', 'number' or an enum type." + }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { + code: 2357, + category: 1, + key: "The operand of an increment or decrement operator must be a variable, property or indexer." + }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2358, + category: 1, + key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." + }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { + code: 2359, + category: 1, + key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." + }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { + code: 2360, + category: 1, + key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." + }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2361, + category: 1, + key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" + }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2362, + category: 1, + key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2363, + category: 1, + key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + Invalid_left_hand_side_of_assignment_expression: { + code: 2364, + category: 1, + key: "Invalid left-hand side of assignment expression." + }, + Operator_0_cannot_be_applied_to_types_1_and_2: { + code: 2365, + category: 1, + key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." + }, + Type_parameter_name_cannot_be_0: { + code: 2368, + category: 1, + key: "Type parameter name cannot be '{0}'" + }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { + code: 2369, + category: 1, + key: "A parameter property is only allowed in a constructor implementation." + }, + A_rest_parameter_must_be_of_an_array_type: { + code: 2370, + category: 1, + key: "A rest parameter must be of an array type." + }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { + code: 2371, + category: 1, + key: "A parameter initializer is only allowed in a function or constructor implementation." + }, + Parameter_0_cannot_be_referenced_in_its_initializer: { + code: 2372, + category: 1, + key: "Parameter '{0}' cannot be referenced in its initializer." + }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { + code: 2373, + category: 1, + key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." + }, + Duplicate_string_index_signature: { + code: 2374, + category: 1, + key: "Duplicate string index signature." + }, + Duplicate_number_index_signature: { + code: 2375, + category: 1, + key: "Duplicate number index signature." + }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { + code: 2376, + category: 1, + key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." + }, + Constructors_for_derived_classes_must_contain_a_super_call: { + code: 2377, + category: 1, + key: "Constructors for derived classes must contain a 'super' call." + }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2378, + category: 1, + key: "A 'get' accessor must return a value or consist of a single 'throw' statement." + }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { + code: 2379, + category: 1, + key: "Getter and setter accessors do not agree in visibility." + }, + get_and_set_accessor_must_have_the_same_type: { + code: 2380, + category: 1, + key: "'get' and 'set' accessor must have the same type." + }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { + code: 2381, + category: 1, + key: "A signature with an implementation cannot use a string literal type." + }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { + code: 2382, + category: 1, + key: "Specialized overload signature is not assignable to any non-specialized signature." + }, + Overload_signatures_must_all_be_exported_or_not_exported: { + code: 2383, + category: 1, + key: "Overload signatures must all be exported or not exported." + }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { + code: 2384, + category: 1, + key: "Overload signatures must all be ambient or non-ambient." + }, + Overload_signatures_must_all_be_public_private_or_protected: { + code: 2385, + category: 1, + key: "Overload signatures must all be public, private or protected." + }, + Overload_signatures_must_all_be_optional_or_required: { + code: 2386, + category: 1, + key: "Overload signatures must all be optional or required." + }, + Function_overload_must_be_static: { + code: 2387, + category: 1, + key: "Function overload must be static." + }, + Function_overload_must_not_be_static: { + code: 2388, + category: 1, + key: "Function overload must not be static." + }, + Function_implementation_name_must_be_0: { + code: 2389, + category: 1, + key: "Function implementation name must be '{0}'." + }, + Constructor_implementation_is_missing: { + code: 2390, + category: 1, + key: "Constructor implementation is missing." + }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { + code: 2391, + category: 1, + key: "Function implementation is missing or not immediately following the declaration." + }, + Multiple_constructor_implementations_are_not_allowed: { + code: 2392, + category: 1, + key: "Multiple constructor implementations are not allowed." + }, + Duplicate_function_implementation: { + code: 2393, + category: 1, + key: "Duplicate function implementation." + }, + Overload_signature_is_not_compatible_with_function_implementation: { + code: 2394, + category: 1, + key: "Overload signature is not compatible with function implementation." + }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { + code: 2395, + category: 1, + key: "Individual declarations in merged declaration {0} must be all exported or all local." + }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { + code: 2396, + category: 1, + key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." + }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { + code: 2399, + category: 1, + key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." + }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { + code: 2400, + category: 1, + key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." + }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { + code: 2401, + category: 1, + key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." + }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { + code: 2402, + category: 1, + key: "Expression resolves to '_super' that compiler uses to capture base class reference." + }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { + code: 2403, + category: 1, + key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." + }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { + code: 2404, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot use a type annotation." + }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { + code: 2405, + category: 1, + key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." + }, + Invalid_left_hand_side_in_for_in_statement: { + code: 2406, + category: 1, + key: "Invalid left-hand side in 'for...in' statement." + }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2407, + category: 1, + key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." + }, + Setters_cannot_return_a_value: { + code: 2408, + category: 1, + key: "Setters cannot return a value." + }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { + code: 2409, + category: 1, + key: "Return type of constructor signature must be assignable to the instance type of the class" + }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { + code: 2410, + category: 1, + key: "All symbols within a 'with' block will be resolved to 'any'." + }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { + code: 2411, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." + }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { + code: 2412, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." + }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { + code: 2413, + category: 1, + key: "Numeric index type '{0}' is not assignable to string index type '{1}'." + }, + Class_name_cannot_be_0: { + code: 2414, + category: 1, + key: "Class name cannot be '{0}'" + }, + Class_0_incorrectly_extends_base_class_1: { + code: 2415, + category: 1, + key: "Class '{0}' incorrectly extends base class '{1}'." + }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { + code: 2417, + category: 1, + key: "Class static side '{0}' incorrectly extends base class static side '{1}'." + }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { + code: 2419, + category: 1, + key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." + }, + Class_0_incorrectly_implements_interface_1: { + code: 2420, + category: 1, + key: "Class '{0}' incorrectly implements interface '{1}'." + }, + A_class_may_only_implement_another_class_or_interface: { + code: 2422, + category: 1, + key: "A class may only implement another class or interface." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { + code: 2423, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { + code: 2424, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." + }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2425, + category: 1, + key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." + }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2426, + category: 1, + key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." + }, + Interface_name_cannot_be_0: { + code: 2427, + category: 1, + key: "Interface name cannot be '{0}'" + }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { + code: 2428, + category: 1, + key: "All declarations of an interface must have identical type parameters." + }, + Interface_0_incorrectly_extends_interface_1: { + code: 2430, + category: 1, + key: "Interface '{0}' incorrectly extends interface '{1}'." + }, + Enum_name_cannot_be_0: { + code: 2431, + category: 1, + key: "Enum name cannot be '{0}'" + }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { + code: 2432, + category: 1, + key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." + }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { + code: 2433, + category: 1, + key: "A module declaration cannot be in a different file from a class or function with which it is merged" + }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { + code: 2434, + category: 1, + key: "A module declaration cannot be located prior to a class or function with which it is merged" + }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { + code: 2435, + category: 1, + key: "Ambient external modules cannot be nested in other modules." + }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { + code: 2436, + category: 1, + key: "Ambient external module declaration cannot specify relative module name." + }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { + code: 2437, + category: 1, + key: "Module '{0}' is hidden by a local declaration with the same name" + }, + Import_name_cannot_be_0: { + code: 2438, + category: 1, + key: "Import name cannot be '{0}'" + }, + Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { + code: 2439, + category: 1, + key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." + }, + Import_declaration_conflicts_with_local_declaration_of_0: { + code: 2440, + category: 1, + key: "Import declaration conflicts with local declaration of '{0}'" + }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { + code: 2441, + category: 1, + key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." + }, + Types_have_separate_declarations_of_a_private_property_0: { + code: 2442, + category: 1, + key: "Types have separate declarations of a private property '{0}'." + }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { + code: 2443, + category: 1, + key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." + }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { + code: 2444, + category: 1, + key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." + }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { + code: 2445, + category: 1, + key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." + }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { + code: 2446, + category: 1, + key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." + }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { + code: 2447, + category: 1, + key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." + }, + Block_scoped_variable_0_used_before_its_declaration: { + code: 2448, + category: 1, + key: "Block-scoped variable '{0}' used before its declaration." + }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { + code: 2449, + category: 1, + key: "The operand of an increment or decrement operator cannot be a constant." + }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { + code: 2450, + category: 1, + key: "Left-hand side of assignment expression cannot be a constant." + }, + Cannot_redeclare_block_scoped_variable_0: { + code: 2451, + category: 1, + key: "Cannot redeclare block-scoped variable '{0}'." + }, + An_enum_member_cannot_have_a_numeric_name: { + code: 2452, + category: 1, + key: "An enum member cannot have a numeric name." + }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { + code: 2453, + category: 1, + key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." + }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { + code: 2455, + category: 1, + key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." + }, + Type_alias_0_circularly_references_itself: { + code: 2456, + category: 1, + key: "Type alias '{0}' circularly references itself." + }, + Type_alias_name_cannot_be_0: { + code: 2457, + category: 1, + key: "Type alias name cannot be '{0}'" + }, + An_AMD_module_cannot_have_multiple_name_assignments: { + code: 2458, + category: 1, + key: "An AMD module cannot have multiple name assignments." + }, + Type_0_has_no_property_1_and_no_string_index_signature: { + code: 2459, + category: 1, + key: "Type '{0}' has no property '{1}' and no string index signature." + }, + Type_0_has_no_property_1: { + code: 2460, + category: 1, + key: "Type '{0}' has no property '{1}'." + }, + Type_0_is_not_an_array_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type." + }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { + code: 2462, + category: 1, + key: "A rest element must be last in an array destructuring pattern" + }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { + code: 2463, + category: 1, + key: "A binding pattern parameter cannot be optional in an implementation signature." + }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { + code: 2464, + category: 1, + key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." + }, + this_cannot_be_referenced_in_a_computed_property_name: { + code: 2465, + category: 1, + key: "'this' cannot be referenced in a computed property name." + }, + super_cannot_be_referenced_in_a_computed_property_name: { + code: 2466, + category: 1, + key: "'super' cannot be referenced in a computed property name." + }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { + code: 2467, + category: 1, + key: "A computed property name cannot reference a type parameter from its containing type." + }, + Cannot_find_global_value_0: { + code: 2468, + category: 1, + key: "Cannot find global value '{0}'." + }, + The_0_operator_cannot_be_applied_to_type_symbol: { + code: 2469, + category: 1, + key: "The '{0}' operator cannot be applied to type 'symbol'." + }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { + code: 2470, + category: 1, + key: "'Symbol' reference does not refer to the global Symbol constructor object." + }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { + code: 2471, + category: 1, + key: "A computed property name of the form '{0}' must be of type 'symbol'." + }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 2472, + category: 1, + key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." + }, + Enum_declarations_must_all_be_const_or_non_const: { + code: 2473, + category: 1, + key: "Enum declarations must all be const or non-const." + }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { + code: 2474, + category: 1, + key: "In 'const' enum declarations member initializer must be constant expression." + }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { + code: 2475, + category: 1, + key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." + }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { + code: 2476, + category: 1, + key: "A const enum member can only be accessed using a string literal." + }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { + code: 2477, + category: 1, + key: "'const' enum member initializer was evaluated to a non-finite value." + }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { + code: 2478, + category: 1, + key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." + }, + Property_0_does_not_exist_on_const_enum_1: { + code: 2479, + category: 1, + key: "Property '{0}' does not exist on 'const' enum '{1}'." + }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { + code: 2480, + category: 1, + key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." + }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { + code: 2481, + category: 1, + key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." + }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { + code: 2483, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot use a type annotation." + }, + Export_declaration_conflicts_with_exported_declaration_of_0: { + code: 2484, + category: 1, + key: "Export declaration conflicts with exported declaration of '{0}'" + }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { + code: 2485, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { + code: 2486, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." + }, + Invalid_left_hand_side_in_for_of_statement: { + code: 2487, + category: 1, + key: "Invalid left-hand side in 'for...of' statement." + }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { + code: 2488, + category: 1, + key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." + }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { + code: 2489, + category: 1, + key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." + }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { + code: 2490, + category: 1, + key: "The type returned by the 'next()' method of an iterator must have a 'value' property." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { + code: 2491, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." + }, + Cannot_redeclare_identifier_0_in_catch_clause: { + code: 2492, + category: 1, + key: "Cannot redeclare identifier '{0}' in catch clause" + }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { + code: 2493, + category: 1, + key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." + }, + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { + code: 2494, + category: 1, + key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." + }, + Type_0_is_not_an_array_type_or_a_string_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type or a string type." + }, + Import_declaration_0_is_using_private_name_1: { + code: 4000, + category: 1, + key: "Import declaration '{0}' is using private name '{1}'." + }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4002, + category: 1, + key: "Type parameter '{0}' of exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4004, + category: 1, + key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4006, + category: 1, + key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4008, + category: 1, + key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4010, + category: 1, + key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4012, + category: 1, + key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4014, + category: 1, + key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4016, + category: 1, + key: "Type parameter '{0}' of exported function has or is using private name '{1}'." + }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4019, + category: 1, + key: "Implements clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4020, + category: 1, + key: "Extends clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { + code: 4022, + category: 1, + key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." + }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4023, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." + }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { + code: 4024, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." + }, + Exported_variable_0_has_or_is_using_private_name_1: { + code: 4025, + category: 1, + key: "Exported variable '{0}' has or is using private name '{1}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4026, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4027, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4028, + category: 1, + key: "Public static property '{0}' of exported class has or is using private name '{1}'." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4029, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4030, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4031, + category: 1, + key: "Public property '{0}' of exported class has or is using private name '{1}'." + }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4032, + category: 1, + key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." + }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4033, + category: 1, + key: "Property '{0}' of exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4034, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4035, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4036, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4037, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4038, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4039, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4040, + category: 1, + key: "Return type of public static property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4041, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4042, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4043, + category: 1, + key: "Return type of public property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4044, + category: 1, + key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4045, + category: 1, + key: "Return type of constructor signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4046, + category: 1, + key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4047, + category: 1, + key: "Return type of call signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4048, + category: 1, + key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4049, + category: 1, + key: "Return type of index signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4050, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4051, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4052, + category: 1, + key: "Return type of public static method from exported class has or is using private name '{0}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4053, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4054, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4055, + category: 1, + key: "Return type of public method from exported class has or is using private name '{0}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4056, + category: 1, + key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { + code: 4057, + category: 1, + key: "Return type of method from exported interface has or is using private name '{0}'." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4058, + category: 1, + key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { + code: 4059, + category: 1, + key: "Return type of exported function has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { + code: 4060, + category: 1, + key: "Return type of exported function has or is using private name '{0}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4061, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4062, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { + code: 4063, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4064, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4065, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4066, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4067, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4068, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4069, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4070, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4071, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4072, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4073, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4074, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4075, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4076, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { + code: 4077, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4078, + category: 1, + key: "Parameter '{0}' of exported function has or is using private name '{1}'." + }, + Exported_type_alias_0_has_or_is_using_private_name_1: { + code: 4081, + category: 1, + key: "Exported type alias '{0}' has or is using private name '{1}'." + }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { + code: 4091, + category: 1, + key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." + }, + The_current_host_does_not_support_the_0_option: { + code: 5001, + category: 1, + key: "The current host does not support the '{0}' option." + }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { + code: 5009, + category: 1, + key: "Cannot find the common subdirectory path for the input files." + }, + Cannot_read_file_0_Colon_1: { + code: 5012, + category: 1, + key: "Cannot read file '{0}': {1}" + }, + Unsupported_file_encoding: { + code: 5013, + category: 1, + key: "Unsupported file encoding." + }, + Unknown_compiler_option_0: { + code: 5023, + category: 1, + key: "Unknown compiler option '{0}'." + }, + Compiler_option_0_requires_a_value_of_type_1: { + code: 5024, + category: 1, + key: "Compiler option '{0}' requires a value of type {1}." + }, + Could_not_write_file_0_Colon_1: { + code: 5033, + category: 1, + key: "Could not write file '{0}': {1}" + }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5038, + category: 1, + key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5039, + category: 1, + key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { + code: 5040, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." + }, + Option_noEmit_cannot_be_specified_with_option_declaration: { + code: 5041, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'declaration'." + }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { + code: 5042, + category: 1, + key: "Option 'project' cannot be mixed with source files on a command line." + }, + Concatenate_and_emit_output_to_single_file: { + code: 6001, + category: 2, + key: "Concatenate and emit output to single file." + }, + Generates_corresponding_d_ts_file: { + code: 6002, + category: 2, + key: "Generates corresponding '.d.ts' file." + }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { + code: 6003, + category: 2, + key: "Specifies the location where debugger should locate map files instead of generated locations." + }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { + code: 6004, + category: 2, + key: "Specifies the location where debugger should locate TypeScript files instead of source locations." + }, + Watch_input_files: { + code: 6005, + category: 2, + key: "Watch input files." + }, + Redirect_output_structure_to_the_directory: { + code: 6006, + category: 2, + key: "Redirect output structure to the directory." + }, + Do_not_erase_const_enum_declarations_in_generated_code: { + code: 6007, + category: 2, + key: "Do not erase const enum declarations in generated code." + }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { + code: 6008, + category: 2, + key: "Do not emit outputs if any type checking errors were reported." + }, + Do_not_emit_comments_to_output: { + code: 6009, + category: 2, + key: "Do not emit comments to output." + }, + Do_not_emit_outputs: { + code: 6010, + category: 2, + key: "Do not emit outputs." + }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { + code: 6015, + category: 2, + key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" + }, + Specify_module_code_generation_Colon_commonjs_or_amd: { + code: 6016, + category: 2, + key: "Specify module code generation: 'commonjs' or 'amd'" + }, + Print_this_message: { + code: 6017, + category: 2, + key: "Print this message." + }, + Print_the_compiler_s_version: { + code: 6019, + category: 2, + key: "Print the compiler's version." + }, + Compile_the_project_in_the_given_directory: { + code: 6020, + category: 2, + key: "Compile the project in the given directory." + }, + Syntax_Colon_0: { + code: 6023, + category: 2, + key: "Syntax: {0}" + }, + options: { + code: 6024, + category: 2, + key: "options" + }, + file: { + code: 6025, + category: 2, + key: "file" + }, + Examples_Colon_0: { + code: 6026, + category: 2, + key: "Examples: {0}" + }, + Options_Colon: { + code: 6027, + category: 2, + key: "Options:" + }, + Version_0: { + code: 6029, + category: 2, + key: "Version {0}" + }, + Insert_command_line_options_and_files_from_a_file: { + code: 6030, + category: 2, + key: "Insert command line options and files from a file." + }, + File_change_detected_Starting_incremental_compilation: { + code: 6032, + category: 2, + key: "File change detected. Starting incremental compilation..." + }, + KIND: { + code: 6034, + category: 2, + key: "KIND" + }, + FILE: { + code: 6035, + category: 2, + key: "FILE" + }, + VERSION: { + code: 6036, + category: 2, + key: "VERSION" + }, + LOCATION: { + code: 6037, + category: 2, + key: "LOCATION" + }, + DIRECTORY: { + code: 6038, + category: 2, + key: "DIRECTORY" + }, + Compilation_complete_Watching_for_file_changes: { + code: 6042, + category: 2, + key: "Compilation complete. Watching for file changes." + }, + Generates_corresponding_map_file: { + code: 6043, + category: 2, + key: "Generates corresponding '.map' file." + }, + Compiler_option_0_expects_an_argument: { + code: 6044, + category: 1, + key: "Compiler option '{0}' expects an argument." + }, + Unterminated_quoted_string_in_response_file_0: { + code: 6045, + category: 1, + key: "Unterminated quoted string in response file '{0}'." + }, + Argument_for_module_option_must_be_commonjs_or_amd: { + code: 6046, + category: 1, + key: "Argument for '--module' option must be 'commonjs' or 'amd'." + }, + Argument_for_target_option_must_be_es3_es5_or_es6: { + code: 6047, + category: 1, + key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." + }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { + code: 6048, + category: 1, + key: "Locale must be of the form or -. For example '{0}' or '{1}'." + }, + Unsupported_locale_0: { + code: 6049, + category: 1, + key: "Unsupported locale '{0}'." + }, + Unable_to_open_file_0: { + code: 6050, + category: 1, + key: "Unable to open file '{0}'." + }, + Corrupted_locale_file_0: { + code: 6051, + category: 1, + key: "Corrupted locale file {0}." + }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { + code: 6052, + category: 2, + key: "Raise error on expressions and declarations with an implied 'any' type." + }, + File_0_not_found: { + code: 6053, + category: 1, + key: "File '{0}' not found." + }, + File_0_must_have_extension_ts_or_d_ts: { + code: 6054, + category: 1, + key: "File '{0}' must have extension '.ts' or '.d.ts'." + }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { + code: 6055, + category: 2, + key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." + }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { + code: 6056, + category: 2, + key: "Do not emit declarations for code that has an '@internal' annotation." + }, + Preserve_new_lines_when_emitting_code: { + code: 6057, + category: 2, + key: "Preserve new-lines when emitting code." + }, + Variable_0_implicitly_has_an_1_type: { + code: 7005, + category: 1, + key: "Variable '{0}' implicitly has an '{1}' type." + }, + Parameter_0_implicitly_has_an_1_type: { + code: 7006, + category: 1, + key: "Parameter '{0}' implicitly has an '{1}' type." + }, + Member_0_implicitly_has_an_1_type: { + code: 7008, + category: 1, + key: "Member '{0}' implicitly has an '{1}' type." + }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { + code: 7009, + category: 1, + key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." + }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { + code: 7010, + category: 1, + key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." + }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { + code: 7011, + category: 1, + key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." + }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7013, + category: 1, + key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { + code: 7016, + category: 1, + key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." + }, + Index_signature_of_object_type_implicitly_has_an_any_type: { + code: 7017, + category: 1, + key: "Index signature of object type implicitly has an 'any' type." + }, + Object_literal_s_property_0_implicitly_has_an_1_type: { + code: 7018, + category: 1, + key: "Object literal's property '{0}' implicitly has an '{1}' type." + }, + Rest_parameter_0_implicitly_has_an_any_type: { + code: 7019, + category: 1, + key: "Rest parameter '{0}' implicitly has an 'any[]' type." + }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7020, + category: 1, + key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { + code: 7021, + category: 1, + key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." + }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { + code: 7022, + category: 1, + key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." + }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7023, + category: 1, + key: "'{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." + }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7024, + category: 1, + key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." + }, + You_cannot_rename_this_element: { + code: 8000, + category: 1, + key: "You cannot rename this element." + }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { + code: 8001, + category: 1, + key: "You cannot rename elements that are defined in the standard TypeScript library." + }, + yield_expressions_are_not_currently_supported: { + code: 9000, + category: 1, + key: "'yield' expressions are not currently supported." + }, + Generators_are_not_currently_supported: { + code: 9001, + category: 1, + key: "Generators are not currently supported." + }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { + code: 9002, + category: 1, + key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." + } }; })(ts || (ts = {})); var ts; @@ -1461,10 +3425,2806 @@ var ts; "|=": 62, "^=": 63 }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1610, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1786, + 1788, + 1808, + 1808, + 1810, + 1836, + 1920, + 1957, + 2309, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2784, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3294, + 3294, + 3296, + 3297, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3424, + 3425, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3805, + 3840, + 3840, + 3904, + 3911, + 3913, + 3946, + 3976, + 3979, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4176, + 4181, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6067, + 6176, + 6263, + 6272, + 6312, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8319, + 8319, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12445, + 12446, + 12449, + 12538, + 12540, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES3IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 768, + 846, + 864, + 866, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1155, + 1158, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1441, + 1443, + 1465, + 1467, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1476, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1621, + 1632, + 1641, + 1648, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1773, + 1776, + 1788, + 1808, + 1836, + 1840, + 1866, + 1920, + 1968, + 2305, + 2307, + 2309, + 2361, + 2364, + 2381, + 2384, + 2388, + 2392, + 2403, + 2406, + 2415, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2492, + 2494, + 2500, + 2503, + 2504, + 2507, + 2509, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2562, + 2562, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2649, + 2652, + 2654, + 2654, + 2662, + 2676, + 2689, + 2691, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2784, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2876, + 2883, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2913, + 2918, + 2927, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3031, + 3031, + 3047, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3134, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3168, + 3169, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3262, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3297, + 3302, + 3311, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3390, + 3395, + 3398, + 3400, + 3402, + 3405, + 3415, + 3415, + 3424, + 3425, + 3430, + 3439, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3805, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3946, + 3953, + 3972, + 3974, + 3979, + 3984, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4140, + 4146, + 4150, + 4153, + 4160, + 4169, + 4176, + 4185, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 4969, + 4977, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6099, + 6112, + 6121, + 6160, + 6169, + 6176, + 6263, + 6272, + 6313, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8255, + 8256, + 8319, + 8319, + 8400, + 8412, + 8417, + 8417, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12441, + 12442, + 12445, + 12446, + 12449, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65056, + 65059, + 65075, + 65076, + 65101, + 65103, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65381, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 880, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1568, + 1610, + 1646, + 1647, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1774, + 1775, + 1786, + 1788, + 1791, + 1791, + 1808, + 1808, + 1810, + 1839, + 1869, + 1957, + 1969, + 1969, + 1994, + 2026, + 2036, + 2037, + 2042, + 2042, + 2048, + 2069, + 2074, + 2074, + 2084, + 2084, + 2088, + 2088, + 2112, + 2136, + 2208, + 2208, + 2210, + 2220, + 2308, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2417, + 2423, + 2425, + 2431, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2493, + 2493, + 2510, + 2510, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2785, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2929, + 2929, + 2947, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3024, + 3024, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3133, + 3160, + 3161, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3261, + 3261, + 3294, + 3294, + 3296, + 3297, + 3313, + 3314, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3389, + 3406, + 3406, + 3424, + 3425, + 3450, + 3455, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3807, + 3840, + 3840, + 3904, + 3911, + 3913, + 3948, + 3976, + 3980, + 4096, + 4138, + 4159, + 4159, + 4176, + 4181, + 4186, + 4189, + 4193, + 4193, + 4197, + 4198, + 4206, + 4208, + 4213, + 4225, + 4238, + 4238, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5905, + 5920, + 5937, + 5952, + 5969, + 5984, + 5996, + 5998, + 6000, + 6016, + 6067, + 6103, + 6103, + 6108, + 6108, + 6176, + 6263, + 6272, + 6312, + 6314, + 6314, + 6320, + 6389, + 6400, + 6428, + 6480, + 6509, + 6512, + 6516, + 6528, + 6571, + 6593, + 6599, + 6656, + 6678, + 6688, + 6740, + 6823, + 6823, + 6917, + 6963, + 6981, + 6987, + 7043, + 7072, + 7086, + 7087, + 7098, + 7141, + 7168, + 7203, + 7245, + 7247, + 7258, + 7293, + 7401, + 7404, + 7406, + 7409, + 7413, + 7414, + 7424, + 7615, + 7680, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11502, + 11506, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11648, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11823, + 11823, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42527, + 42538, + 42539, + 42560, + 42606, + 42623, + 42647, + 42656, + 42735, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43009, + 43011, + 43013, + 43015, + 43018, + 43020, + 43042, + 43072, + 43123, + 43138, + 43187, + 43250, + 43255, + 43259, + 43259, + 43274, + 43301, + 43312, + 43334, + 43360, + 43388, + 43396, + 43442, + 43471, + 43471, + 43520, + 43560, + 43584, + 43586, + 43588, + 43595, + 43616, + 43638, + 43642, + 43642, + 43648, + 43695, + 43697, + 43697, + 43701, + 43702, + 43705, + 43709, + 43712, + 43712, + 43714, + 43714, + 43739, + 43741, + 43744, + 43754, + 43762, + 43764, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44002, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 768, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1155, + 1159, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1477, + 1479, + 1479, + 1488, + 1514, + 1520, + 1522, + 1552, + 1562, + 1568, + 1641, + 1646, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1788, + 1791, + 1791, + 1808, + 1866, + 1869, + 1969, + 1984, + 2037, + 2042, + 2042, + 2048, + 2093, + 2112, + 2139, + 2208, + 2208, + 2210, + 2220, + 2276, + 2302, + 2304, + 2403, + 2406, + 2415, + 2417, + 2423, + 2425, + 2431, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2500, + 2503, + 2504, + 2507, + 2510, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2561, + 2563, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2641, + 2641, + 2649, + 2652, + 2654, + 2654, + 2662, + 2677, + 2689, + 2691, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2787, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2876, + 2884, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2915, + 2918, + 2927, + 2929, + 2929, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3024, + 3024, + 3031, + 3031, + 3046, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3160, + 3161, + 3168, + 3171, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3260, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3299, + 3302, + 3311, + 3313, + 3314, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3396, + 3398, + 3400, + 3402, + 3406, + 3415, + 3415, + 3424, + 3427, + 3430, + 3439, + 3450, + 3455, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3807, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3948, + 3953, + 3972, + 3974, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4169, + 4176, + 4253, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4957, + 4959, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5908, + 5920, + 5940, + 5952, + 5971, + 5984, + 5996, + 5998, + 6000, + 6002, + 6003, + 6016, + 6099, + 6103, + 6103, + 6108, + 6109, + 6112, + 6121, + 6155, + 6157, + 6160, + 6169, + 6176, + 6263, + 6272, + 6314, + 6320, + 6389, + 6400, + 6428, + 6432, + 6443, + 6448, + 6459, + 6470, + 6509, + 6512, + 6516, + 6528, + 6571, + 6576, + 6601, + 6608, + 6617, + 6656, + 6683, + 6688, + 6750, + 6752, + 6780, + 6783, + 6793, + 6800, + 6809, + 6823, + 6823, + 6912, + 6987, + 6992, + 7001, + 7019, + 7027, + 7040, + 7155, + 7168, + 7223, + 7232, + 7241, + 7245, + 7293, + 7376, + 7378, + 7380, + 7414, + 7424, + 7654, + 7676, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8204, + 8205, + 8255, + 8256, + 8276, + 8276, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8400, + 8412, + 8417, + 8417, + 8421, + 8432, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11647, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11744, + 11775, + 11823, + 11823, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12441, + 12442, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42539, + 42560, + 42607, + 42612, + 42621, + 42623, + 42647, + 42655, + 42737, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43047, + 43072, + 43123, + 43136, + 43204, + 43216, + 43225, + 43232, + 43255, + 43259, + 43259, + 43264, + 43309, + 43312, + 43347, + 43360, + 43388, + 43392, + 43456, + 43471, + 43481, + 43520, + 43574, + 43584, + 43597, + 43600, + 43609, + 43616, + 43638, + 43642, + 43643, + 43648, + 43714, + 43739, + 43741, + 43744, + 43759, + 43762, + 43766, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44010, + 44012, + 44013, + 44016, + 44025, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65024, + 65039, + 65056, + 65062, + 65075, + 65076, + 65101, + 65103, + 65136, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -1488,15 +6248,11 @@ var ts; return false; } function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierStart) : - lookupInUnicodeMap(code, unicodeES3IdentifierStart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierPart) : - lookupInUnicodeMap(code, unicodeES3IdentifierPart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } function makeReverseMap(source) { var result = []; @@ -1569,9 +6325,7 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { @@ -1658,8 +6412,7 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -1739,7 +6492,11 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ + pos: startPos, + end: pos, + hasTrailingNewLine: hasTrailingNewLine + }); } continue; } @@ -1766,15 +6523,11 @@ var ts; } ts.getTrailingCommentRanges = getTrailingCommentRanges; function isIdentifierStart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } ts.isIdentifierStart = isIdentifierStart; function isIdentifierPart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; function createScanner(languageVersion, skipTrivia, text, onError) { @@ -1793,14 +6546,10 @@ var ts; } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } function isIdentifierPart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; @@ -2523,17 +7272,39 @@ var ts; } setText(text); return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, - isUnterminated: function () { return tokenIsUnterminated; }, + getStartPos: function () { + return startPos; + }, + getTextPos: function () { + return pos; + }, + getToken: function () { + return token; + }, + getTokenPos: function () { + return tokenPos; + }, + getTokenText: function () { + return text.substring(tokenPos, pos); + }, + getTokenValue: function () { + return tokenValue; + }, + hasExtendedUnicodeEscape: function () { + return hasExtendedUnicodeEscape; + }, + hasPrecedingLineBreak: function () { + return precedingLineBreak; + }, + isIdentifier: function () { + return token === 64 || token > 100; + }, + isReservedWord: function () { + return token >= 65 && token <= 100; + }, + isUnterminated: function () { + return tokenIsUnterminated; + }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -2684,10 +7455,20 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, + { + name: "preserveNewLines", + type: "boolean", + description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, + experimental: true + }, { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + type: { + "es3": 0, + "es5": 1, + "es6": 2 + }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -2867,7 +7648,9 @@ var ts; var files = []; if (ts.hasProperty(json, "files")) { if (json["files"] instanceof Array) { - var files = ts.map(json["files"], function (s) { return ts.combinePaths(basePath, s); }); + var files = ts.map(json["files"], function (s) { + return ts.combinePaths(basePath, s); + }); } } else { @@ -2901,9 +7684,13 @@ var ts; function getSingleLineStringWriter() { if (stringWriters.length == 0) { var str = ""; - var writeText = function (text) { return str += text; }; + var writeText = function (text) { + return str += text; + }; return { - string: function () { return str; }, + string: function () { + return str; + }, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, @@ -2911,11 +7698,18 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, - writeLine: function () { return str += " "; }, - increaseIndent: function () { }, - decreaseIndent: function () { }, - clear: function () { return str = ""; }, - trackSymbol: function () { } + writeLine: function () { + return str += " "; + }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { + return str = ""; + }, + trackSymbol: function () { + } }; } return stringWriters.pop(); @@ -2937,8 +7731,7 @@ var ts; ts.containsParseError = containsParseError; function aggregateChildData(node) { if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || - ts.forEachChild(node, containsParseError); + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { node.parserContextFlags |= 32; } @@ -2946,7 +7739,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 220) { + while (node && node.kind !== 221) { node = node.parent; } return node; @@ -3017,15 +7810,35 @@ var ts; } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || - isCatchClauseVariableDeclaration(declaration); + return (getCombinedNodeFlags(declaration) & 12288) !== 0 || isCatchClauseVariableDeclaration(declaration); + } + ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function getEnclosingBlockScopeContainer(node) { + var current = node; + while (current) { + if (isFunctionLike(current)) { + return current; + } + switch (current.kind) { + case 221: + case 202: + case 217: + case 200: + case 181: + case 182: + case 183: + return current; + case 174: + if (!isFunctionLike(current.parent)) { + return current; + } + } + current = current.parent; + } } - ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && - declaration.kind === 193 && - declaration.parent && - declaration.parent.kind === 216; + return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3068,7 +7881,7 @@ var ts; case 197: case 200: case 199: - case 219: + case 220: case 195: case 160: errorNode = node.name; @@ -3077,9 +7890,7 @@ var ts; if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); + var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); return createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -3142,9 +7953,7 @@ var ts; function getJsDocComments(node, sourceFileOfNode) { return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), isJsDocComment); function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; } } ts.getJsDocComments = getJsDocComments; @@ -3155,6 +7964,7 @@ var ts; switch (node.kind) { case 186: return visitor(node); + case 202: case 174: case 178: case 179: @@ -3164,11 +7974,11 @@ var ts; case 183: case 187: case 188: - case 213: case 214: + case 215: case 189: case 191: - case 216: + case 217: return ts.forEachChild(node, traverse); } } @@ -3178,12 +7988,12 @@ var ts; if (node) { switch (node.kind) { case 150: - case 219: + case 220: case 128: - case 217: + case 218: case 130: case 129: - case 218: + case 219: case 193: return true; } @@ -3261,7 +8071,7 @@ var ts; case 134: case 135: case 199: - case 220: + case 221: return node; } } @@ -3352,8 +8162,8 @@ var ts; case 128: case 130: case 129: - case 219: - case 217: + case 220: + case 218: case 150: return parent.initializer === node; case 177: @@ -3363,20 +8173,17 @@ var ts; case 186: case 187: case 188: - case 213: + case 214: case 190: case 188: return parent.expression === node; case 181: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; case 182: case 183: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || - forInStatement.expression === node; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || forInStatement.expression === node; case 158: return node === parent.expression; case 173: @@ -3394,12 +8201,11 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 || (preserveConstEnums && moduleState === 2); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind === 212; + return node.kind === 203 && node.moduleReference.kind === 213; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3408,20 +8214,20 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind !== 212; + return node.kind === 203 && node.moduleReference.kind !== 213; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 203) { + if (node.kind === 204) { return node.moduleSpecifier; } - if (node.kind === 202) { + if (node.kind === 203) { var reference = node.moduleReference; - if (reference.kind === 212) { + if (reference.kind === 213) { return reference.expression; } } - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } } @@ -3438,8 +8244,8 @@ var ts; case 132: case 131: return node.questionToken !== undefined; + case 219: case 218: - case 217: case 130: case 129: return node.questionToken !== undefined; @@ -3485,25 +8291,25 @@ var ts; case 196: case 133: case 199: - case 219: - case 211: + case 220: + case 212: case 195: case 160: case 134: - case 204: - case 202: - case 207: + case 205: + case 203: + case 208: case 197: case 132: case 131: case 200: - case 205: + case 206: case 128: - case 217: + case 218: case 130: case 129: case 135: - case 218: + case 219: case 198: case 127: case 193: @@ -3532,7 +8338,7 @@ var ts; case 175: case 180: case 187: - case 208: + case 209: return true; default: return false; @@ -3544,7 +8350,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 207 || parent.kind === 211) { + if (parent.kind === 208 || parent.kind === 212) { if (parent.propertyName) { return true; } @@ -3642,9 +8448,7 @@ var ts; } ts.isTrivia = isTrivia; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 126 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && declaration.name.kind === 126 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { @@ -3748,7 +8552,10 @@ var ts; if (length < 0) { throw new Error("length < 0"); } - return { start: start, length: length }; + return { + start: start, + length: length + }; } ts.createTextSpan = createTextSpan; function createTextSpanFromBounds(start, end) { @@ -3767,7 +8574,10 @@ var ts; if (newLength < 0) { throw new Error("newLength < 0"); } - return { span: span, newLength: newLength }; + return { + span: span, + newLength: newLength + }; } ts.createTextChangeRange = createTextChangeRange; ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); @@ -3798,11 +8608,11 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 220; + return isFunctionLike(n) || n.kind === 200 || n.kind === 221; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { - return node.pos === -1 && node.end === -1; + return node.pos === -1; } ts.nodeIsSynthesized = nodeIsSynthesized; function createSynthesizedNode(kind, startsOnNewLine) { @@ -3928,15 +8738,15 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; + return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { + return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + }) : s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(222); + var nodeConstructors = new Array(223); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -3974,35 +8784,23 @@ var ts; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { case 125: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); case 127: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.constraint) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); case 128: case 130: case 129: - case 217: case 218: + case 219: case 193: case 150: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.dotDotDotToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); case 140: case 141: case 136: case 137: case 138: - return visitNodes(cbNodes, node.modifiers) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); case 132: case 131: case 133: @@ -4011,17 +8809,9 @@ var ts; case 160: case 195: case 161: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); case 139: - return visitNode(cbNode, node.typeName) || - visitNodes(cbNodes, node.typeArguments); + return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); case 142: return visitNode(cbNode, node.exprName); case 143: @@ -4042,23 +8832,16 @@ var ts; case 152: return visitNodes(cbNodes, node.properties); case 153: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.dotToken) || - visitNode(cbNode, node.name); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); case 154: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); case 155: case 156: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments) || - visitNodes(cbNodes, node.arguments); + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); case 157: - return visitNode(cbNode, node.tag) || - visitNode(cbNode, node.template); + return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); case 158: - return visitNode(cbNode, node.type) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); case 159: return visitNode(cbNode, node.expression); case 162: @@ -4070,189 +8853,169 @@ var ts; case 165: return visitNode(cbNode, node.operand); case 170: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); case 166: return visitNode(cbNode, node.operand); case 167: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.operatorToken) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); case 168: - return visitNode(cbNode, node.condition) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.whenTrue) || - visitNode(cbNode, node.colonToken) || - visitNode(cbNode, node.whenFalse); + return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); case 171: return visitNode(cbNode, node.expression); case 174: case 201: return visitNodes(cbNodes, node.statements); - case 220: - return visitNodes(cbNodes, node.statements) || - visitNode(cbNode, node.endOfFileToken); + case 221: + return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); case 175: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.declarationList); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); case 194: return visitNodes(cbNodes, node.declarations); case 177: return visitNode(cbNode, node.expression); case 178: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.thenStatement) || - visitNode(cbNode, node.elseStatement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); case 179: - return visitNode(cbNode, node.statement) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); case 180: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 181: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 184: case 185: return visitNode(cbNode, node.label); case 186: return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 188: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.clauses); - case 213: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); + case 202: + return visitNodes(cbNodes, node.clauses); case 214: + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); + case 215: return visitNodes(cbNodes, node.statements); case 189: - return visitNode(cbNode, node.label) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); case 190: return visitNode(cbNode, node.expression); case 191: - return visitNode(cbNode, node.tryBlock) || - visitNode(cbNode, node.catchClause) || - visitNode(cbNode, node.finallyBlock); - case 216: - return visitNode(cbNode, node.variableDeclaration) || - visitNode(cbNode, node.block); + return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); + case 217: + return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 196: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 197: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 198: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); case 199: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 219: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); + case 220: + return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.body); - case 202: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.moduleReference); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); case 203: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.importClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); case 204: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.namedBindings); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); case 206: - case 210: - return visitNodes(cbNodes, node.elements); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.exportClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNode(cbNode, node.name); case 207: case 211: - return visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.elements); + case 210: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); case 208: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); + case 212: + return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + case 209: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 126: return visitNode(cbNode, node.expression); - case 215: + case 216: return visitNodes(cbNodes, node.types); - case 212: + case 213: return visitNode(cbNode, node.expression); } } ts.forEachChild = forEachChild; function parsingContextErrors(context) { switch (context) { - case 0: return ts.Diagnostics.Declaration_or_statement_expected; - case 1: return ts.Diagnostics.Declaration_or_statement_expected; - case 2: return ts.Diagnostics.Statement_expected; - case 3: return ts.Diagnostics.case_or_default_expected; - case 4: return ts.Diagnostics.Statement_expected; - case 5: return ts.Diagnostics.Property_or_signature_expected; - case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; - case 9: return ts.Diagnostics.Variable_declaration_expected; - case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; - case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; - case 12: return ts.Diagnostics.Argument_expression_expected; - case 13: return ts.Diagnostics.Property_assignment_expected; - case 14: return ts.Diagnostics.Expression_or_comma_expected; - case 15: return ts.Diagnostics.Parameter_declaration_expected; - case 16: return ts.Diagnostics.Type_parameter_declaration_expected; - case 17: return ts.Diagnostics.Type_argument_expected; - case 18: return ts.Diagnostics.Type_expected; - case 19: return ts.Diagnostics.Unexpected_token_expected; - case 20: return ts.Diagnostics.Identifier_expected; + case 0: + return ts.Diagnostics.Declaration_or_statement_expected; + case 1: + return ts.Diagnostics.Declaration_or_statement_expected; + case 2: + return ts.Diagnostics.Statement_expected; + case 3: + return ts.Diagnostics.case_or_default_expected; + case 4: + return ts.Diagnostics.Statement_expected; + case 5: + return ts.Diagnostics.Property_or_signature_expected; + case 6: + return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7: + return ts.Diagnostics.Enum_member_expected; + case 8: + return ts.Diagnostics.Type_reference_expected; + case 9: + return ts.Diagnostics.Variable_declaration_expected; + case 10: + return ts.Diagnostics.Property_destructuring_pattern_expected; + case 11: + return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 12: + return ts.Diagnostics.Argument_expression_expected; + case 13: + return ts.Diagnostics.Property_assignment_expected; + case 14: + return ts.Diagnostics.Expression_or_comma_expected; + case 15: + return ts.Diagnostics.Parameter_declaration_expected; + case 16: + return ts.Diagnostics.Type_parameter_declaration_expected; + case 17: + return ts.Diagnostics.Type_argument_expected; + case 18: + return ts.Diagnostics.Type_expected; + case 19: + return ts.Diagnostics.Unexpected_token_expected; + case 20: + return ts.Diagnostics.Identifier_expected; } } ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 109: + return 128; + case 108: + return 16; + case 107: + return 64; + case 106: + return 32; + case 77: + return 1; + case 114: + return 2; + case 69: + return 8192; + case 72: + return 256; } return 0; } @@ -4483,8 +9246,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && - (node.text === "eval" || node.text === "arguments"); + return node.kind === 64 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; function isUseStrictPrologueDirective(sourceFile, node) { @@ -4566,7 +9328,7 @@ var ts; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(220, 0); + var sourceFile = createNode(221, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4702,9 +9464,7 @@ var ts; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; var saveContextFlags = contextFlags; - var result = isLookAhead - ? scanner.lookAhead(callback) - : scanner.tryScan(callback); + var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); if (!result || isLookAhead) { token = saveToken; @@ -4755,8 +9515,7 @@ var ts; return undefined; } function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { - return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + return parseOptionalToken(t) || createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); } function parseTokenNode() { var node = createNode(token); @@ -4833,9 +9592,7 @@ var ts; return createIdentifier(isIdentifierOrKeyword()); } function isLiteralPropertyName() { - return isIdentifierOrKeyword() || - token === 8 || - token === 7; + return isIdentifierOrKeyword() || token === 8 || token === 7; } function parsePropertyName() { if (token === 8 || token === 7) { @@ -4888,10 +9645,7 @@ var ts; return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 - || isLiteralPropertyName(); + return token === 18 || token === 14 || token === 35 || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); @@ -4949,8 +9703,7 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { + if (token === 102 || token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -5116,10 +9869,10 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 196: case 197: case 200: @@ -5147,8 +9900,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 213: case 214: + case 215: return true; } } @@ -5183,7 +9936,7 @@ var ts; return false; } function isReusableEnumMember(node) { - return node.kind === 219; + return node.kind === 220; } function isReusableTypeMember(node) { if (node) { @@ -5331,9 +10084,7 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + if (node.kind === 7 && sourceText.charCodeAt(tokenPos) === 48 && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { node.flags |= 16384; } return node; @@ -5372,9 +10123,7 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 - ? parseLiteralNode(true) - : parseType(); + return token === 8 ? parseLiteralNode(true) : parseType(); } return undefined; } @@ -5532,11 +10281,7 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || - canParseSemicolon(); + return token === 16 || token === 24 || token === 50 || token === 51 || canParseSemicolon(); } function parseTypeMember() { switch (token) { @@ -5544,9 +10289,7 @@ var ts; case 24: return parseSignatureMember(136); case 18: - return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) - : parsePropertyOrMethodSignature(); + return isIndexSignature() ? parseIndexSignatureDeclaration(undefined) : parsePropertyOrMethodSignature(); case 87: if (lookAhead(isStartOfConstructSignature)) { return parseSignatureMember(137); @@ -5568,9 +10311,7 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) - : undefined; + return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -5676,7 +10417,9 @@ var ts; function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); if (token === 44) { - var types = [type]; + var types = [ + type + ]; types.pos = type.pos; while (parseOptional(44)) { types.push(parseArrayTypeOrHigher()); @@ -5701,9 +10444,7 @@ var ts; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 52 || - isIdentifier() || ts.isModifier(token)) { + if (token === 51 || token === 23 || token === 50 || token === 52 || isIdentifier() || ts.isModifier(token)) { return true; } if (token === 17) { @@ -5831,8 +10572,7 @@ var ts; function parseYieldExpression() { var node = createNode(170); nextToken(); - if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { + if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { node.asteriskToken = parseOptionalToken(35); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -5847,7 +10587,9 @@ var ts; var parameter = createNode(128, identifier.pos); parameter.name = identifier; finishNode(parameter); - node.parameters = [parameter]; + node.parameters = [ + parameter + ]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; parseExpected(32); @@ -5859,9 +10601,7 @@ var ts; if (triState === 0) { return undefined; } - var arrowFunction = triState === 1 - ? parseParenthesizedArrowFunctionExpressionHead(true) - : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); + var arrowFunction = triState === 1 ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { return undefined; } @@ -6083,9 +10823,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 - ? parseSuperExpression() - : parseMemberExpressionOrHigher(); + var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -6139,9 +10877,7 @@ var ts; if (token === 10 || token === 11) { var tagExpression = createNode(157, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 - ? parseLiteralNode() - : parseTemplateExpression(); + tagExpression.template = token === 10 ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); continue; } @@ -6187,9 +10923,7 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() - ? typeArguments - : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -6264,9 +10998,7 @@ var ts; return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : - parseAssignmentExpressionOrHigher(); + return token === 21 ? parseSpreadElement() : token === 23 ? createNode(172) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return allowInAnd(parseArgumentOrArrayLiteralElement); @@ -6305,13 +11037,13 @@ var ts; return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(218, fullStart); + var shorthandDeclaration = createNode(219, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(217, fullStart); + var propertyAssignment = createNode(218, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6477,7 +11209,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(213); + var node = createNode(214); parseExpected(66); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -6485,7 +11217,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(214); + var node = createNode(215); parseExpected(72); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -6500,9 +11232,11 @@ var ts; parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); + var caseBlock = createNode(202, scanner.getStartPos()); parseExpected(14); - node.clauses = parseList(3, false, parseCaseOrDefaultClause); + caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); + node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { @@ -6524,7 +11258,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(216); + var result = createNode(217); parseExpected(67); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -6914,11 +11648,7 @@ var ts; if (isIndexSignature()) { return parseIndexSignatureDeclaration(modifiers); } - if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { + if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { return parsePropertyOrMethodDeclaration(fullStart, modifiers); } ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -6931,9 +11661,7 @@ var ts; node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { - node.members = inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseClassMembers) - : parseClassMembers(); + node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); parseExpected(15); } else { @@ -6943,9 +11671,7 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseHeritageClausesWorker) - : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); } return undefined; } @@ -6954,7 +11680,7 @@ var ts; } function parseHeritageClause() { if (token === 78 || token === 102) { - var node = createNode(215); + var node = createNode(216); node.token = token; nextToken(); node.types = parseDelimitedList(8, parseTypeReference); @@ -6989,7 +11715,7 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(220, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); @@ -7024,9 +11750,7 @@ var ts; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) - : parseModuleBlock(); + node.body = parseOptional(20) ? parseInternalModuleTail(getNodePos(), undefined, 1) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { @@ -7038,21 +11762,17 @@ var ts; } function parseModuleDeclaration(fullStart, modifiers) { parseExpected(116); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + return token === 8 ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && - lookAhead(nextTokenIsOpenParen); + return token === 117 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { return nextToken() === 16; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 123; + return token === 23 || token === 123; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { parseExpected(84); @@ -7061,7 +11781,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(202, fullStart); + var importEqualsDeclaration = createNode(203, fullStart); setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; parseExpected(52); @@ -7070,11 +11790,9 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(203, fullStart); + var importDeclaration = createNode(204, fullStart); setModifiers(importDeclaration, modifiers); - if (identifier || - token === 35 || - token === 14) { + if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(123); } @@ -7083,23 +11801,20 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(204, fullStart); + var importClause = createNode(205, fullStart); if (identifier) { importClause.name = identifier; } - if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(206); + if (!importClause.name || parseOptional(23)) { + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); } return finishNode(importClause); } function parseModuleReference() { - return isExternalModuleReference() - ? parseExternalModuleReference() - : parseEntityName(false); + return isExternalModuleReference() ? parseExternalModuleReference() : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(212); + var node = createNode(213); parseExpected(117); parseExpected(16); node.expression = parseModuleSpecifier(); @@ -7114,7 +11829,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(205); + var namespaceImport = createNode(206); parseExpected(35); parseExpected(101); namespaceImport.name = parseIdentifier(); @@ -7122,14 +11837,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 206 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(211); + return parseImportOrExportSpecifier(212); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(207); + return parseImportOrExportSpecifier(208); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -7155,14 +11870,14 @@ var ts; return finishNode(node); } function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(209, fullStart); + var node = createNode(210, fullStart); setModifiers(node, modifiers); if (parseOptional(35)) { parseExpected(123); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(210); + node.exportClause = parseNamedImportsOrExports(211); if (parseOptional(123)) { node.moduleSpecifier = parseModuleSpecifier(); } @@ -7171,7 +11886,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, modifiers) { - var node = createNode(208, fullStart); + var node = createNode(209, fullStart); setModifiers(node, modifiers); if (parseOptional(52)) { node.isExportEquals = true; @@ -7226,13 +11941,11 @@ var ts; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 || token === 35 || token === 14; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 52 || token === 35 || token === 14 || token === 72 || isDeclarationStart(); } function nextTokenIsDeclarationStart() { nextToken(); @@ -7286,9 +11999,7 @@ var ts; return parseSourceElementOrModuleElement(); } function parseSourceElementOrModuleElement() { - return isDeclarationStart() - ? parseDeclaration() - : parseStatement(); + return isDeclarationStart() ? parseDeclaration() : parseStatement(); } function processReferenceComments(sourceFile) { var triviaScanner = ts.createScanner(sourceFile.languageVersion, false, sourceText); @@ -7303,7 +12014,10 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos() + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -7334,7 +12048,10 @@ var ts; var pathMatchResult = pathRegex.exec(comment); var nameMatchResult = nameRegex.exec(comment); if (pathMatchResult) { - var amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; + var amdDependency = { + path: pathMatchResult[2], + name: nameMatchResult ? nameMatchResult[2] : undefined + }; amdDependencies.push(amdDependency); } } @@ -7346,13 +12063,7 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 202 && node.moduleReference.kind === 212 - || node.kind === 203 - || node.kind === 208 - || node.kind === 209 - ? node - : undefined; + return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; }); } } @@ -7400,7 +12111,7 @@ var ts; else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 203 || node.kind === 202) && !(node.flags & 1)) { + else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { return 0; } else if (node.kind === 201) { @@ -7493,9 +12204,9 @@ var ts; return "__new"; case 138: return "__index"; - case 209: + case 210: return "__export"; - case 208: + case 209: return "default"; case 195: case 196: @@ -7514,9 +12225,7 @@ var ts; if (node.name) { node.name.parent = node; } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; + var message = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); }); @@ -7553,7 +12262,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 211 || (node.kind === 202 && hasExportModifier)) { + if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -7562,9 +12271,7 @@ var ts; } else { if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); node.localSymbol = local; @@ -7590,7 +12297,7 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 220); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); } ts.forEachChild(node, bind); container = saveContainer; @@ -7602,7 +12309,7 @@ var ts; case 200: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -7680,7 +12387,7 @@ var ts; case 200: declareModuleMember(node, 2, 107455); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, 2, 107455); break; @@ -7721,11 +12428,11 @@ var ts; case 129: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 217: case 218: + case 219: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 219: + case 220: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; case 136: @@ -7763,7 +12470,7 @@ var ts; case 161: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 216: + case 217: bindCatchVariableDeclaration(node); break; case 196: @@ -7786,13 +12493,13 @@ var ts; case 200: bindModuleDeclaration(node); break; - case 202: - case 205: - case 207: - case 211: + case 203: + case 206: + case 208: + case 212: bindDeclaration(node, 8388608, 8388608, false); break; - case 204: + case 205: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -7800,13 +12507,13 @@ var ts; bindChildren(node, 0, false); } break; - case 209: + case 210: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 208: + case 209: if (node.expression.kind === 64) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); } @@ -7815,7 +12522,7 @@ var ts; } bindChildren(node, 0, false); break; - case 220: + case 221: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; @@ -7823,11 +12530,11 @@ var ts; case 174: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 216: + case 217: case 181: case 182: case 183: - case 188: + case 202: bindChildren(node, 0, true); break; default: @@ -7844,9 +12551,7 @@ var ts; else { bindDeclaration(node, 1, 107455, false); } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { + if (node.flags & 112 && node.parent.kind === 133 && node.parent.parent.kind === 196) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -7878,12 +12583,24 @@ var ts; var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); var checker = { - getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getNodeCount: function () { + return ts.sum(host.getSourceFiles(), "nodeCount"); + }, + getIdentifierCount: function () { + return ts.sum(host.getSourceFiles(), "identifierCount"); + }, + getSymbolCount: function () { + return ts.sum(host.getSourceFiles(), "symbolCount"); + }, + getTypeCount: function () { + return typeCount; + }, + isUndefinedSymbol: function (symbol) { + return symbol === undefinedSymbol; + }, + isArgumentsSymbol: function (symbol) { + return symbol === argumentsSymbol; + }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, @@ -7979,9 +12696,7 @@ var ts; return emitResolver; } function error(location, message, arg0, arg1, arg2) { - var diagnostic = location - ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) - : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); diagnostics.add(diagnostic); } function createSymbol(flags, name) { @@ -8067,8 +12782,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); }); @@ -8115,10 +12829,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 220); + return ts.getAncestor(node, 221); } function isGlobalSourceFile(node) { - return node.kind === 220 && !ts.isExternalModule(node); + return node.kind === 221 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8159,12 +12873,12 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 211)) { + if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { break loop; } result = undefined; @@ -8248,28 +12962,54 @@ var ts; return undefined; } if (result.flags & 2) { - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); - } + checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert((result.flags & 2) !== 0); + var declaration = ts.forEach(result.declarations, function (d) { + return ts.isBlockOrCatchScoped(d) ? d : undefined; + }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); + if (!isUsedBeforeDeclaration) { + var variableDeclaration = ts.getAncestor(declaration, 193); + var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); + if (variableDeclaration.parent.parent.kind === 175 || variableDeclaration.parent.parent.kind === 181) { + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); + } + else if (variableDeclaration.parent.parent.kind === 183 || variableDeclaration.parent.parent.kind === 182) { + var expression = variableDeclaration.parent.parent.expression; + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); + } + } + if (isUsedBeforeDeclaration) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + if (!parent) { + return false; + } + for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { + if (current === parent) { + return true; + } + } + return false; + } function isAliasSymbolDeclaration(node) { - return node.kind === 202 || - node.kind === 204 && !!node.name || - node.kind === 205 || - node.kind === 207 || - node.kind === 211 || - node.kind === 208; + return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { + return isAliasSymbolDeclaration(d) ? d : undefined; + }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 212) { + if (node.moduleReference.kind === 213) { var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); return exportAssignmentSymbol || moduleSymbol; @@ -8307,26 +13047,24 @@ var ts; return getExternalModuleMember(node.parent.parent.parent, node); } function getTargetOfExportSpecifier(node) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { return resolveEntityName(node.expression, 107455 | 793056 | 1536); } function getTargetOfImportDeclaration(node) { switch (node.kind) { - case 202: + case 203: return getTargetOfImportEqualsDeclaration(node); - case 204: - return getTargetOfImportClause(node); case 205: + return getTargetOfImportClause(node); + case 206: return getTargetOfNamespaceImport(node); - case 207: + case 208: return getTargetOfImportSpecifier(node); - case 211: + case 212: return getTargetOfExportSpecifier(node); - case 208: + case 209: return getTargetOfExportAssignment(node); } } @@ -8361,10 +13099,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 208) { + if (node.kind === 209) { checkExpressionCached(node.expression); } - else if (node.kind === 211) { + else if (node.kind === 212) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8374,7 +13112,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 202); + importDeclaration = ts.getAncestor(entityName, 203); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -8384,7 +13122,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 202); + ts.Debug.assert(entityName.parent.kind === 203); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8524,9 +13262,7 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 - ? getMergedSymbol(symbol.exportSymbol) - : symbol; + return symbol && (symbol.flags & 1048576) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { if (symbol.flags & 16777216) { @@ -8565,10 +13301,7 @@ var ts; return type; } function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 && - name.charCodeAt(1) === 95 && - name.charCodeAt(2) !== 95 && - name.charCodeAt(2) !== 64; + return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && name.charCodeAt(2) !== 95 && name.charCodeAt(2) !== 64; } function getNamedMembers(members) { var result; @@ -8609,7 +13342,7 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) { break; } @@ -8642,24 +13375,28 @@ var ts; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; + return [ + symbol + ]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; + return [ + symbolFromSymbolTable + ]; } var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + return [ + symbolFromSymbolTable + ].concat(accessibleSymbolsFromExports); } } } @@ -8724,7 +13461,9 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { + accessibility: 0 + }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -8734,20 +13473,22 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 220 && ts.isExternalModule(declaration)); + return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + if (ts.forEach(symbol.declarations, function (declaration) { + return !getIsDeclarationVisible(declaration); + })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { + accessibility: 0, + aliasesToMakeVisible: aliasesToMakeVisible + }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 202 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 203 && !(declaration.flags & 1) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -8755,7 +13496,9 @@ var ts; } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [ + declaration + ]; } return true; } @@ -8769,8 +13512,7 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 202) { + else if (entityName.kind === 125 || entityName.parent.kind === 203) { meaning = 1536; } else { @@ -8856,8 +13598,7 @@ var ts; function walkSymbol(symbol, meaning) { if (symbol) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { @@ -8889,8 +13630,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + writer.writeKeyword(!(globalFlags & 16) && (type.flags & 1) ? "any" : type.intrinsicName); } else if (type.flags & 4096) { writeTypeReference(type, flags); @@ -8983,16 +13723,14 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && - ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && - (type.symbol.parent || - ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 220 || declaration.parent.kind === 201; - })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.flags & 128; + })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.parent.kind === 221 || declaration.parent.kind === 201; + })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + return !!(flags & 2) || (typeStack && ts.contains(typeStack, type)); } } } @@ -9222,7 +13960,7 @@ var ts; return node; } } - else if (node.kind === 220) { + else if (node.kind === 221) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9272,10 +14010,9 @@ var ts; case 198: case 195: case 199: - case 202: + case 203: var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 202 && parent.kind !== 220 && ts.isInAmbientContext(parent))) { + if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -9304,7 +14041,7 @@ var ts; case 147: return isDeclarationVisible(node.parent); case 127: - case 220: + case 221: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -9330,7 +14067,9 @@ var ts; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; + return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { + return anyType; + })) : classType; } function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); @@ -9350,9 +14089,7 @@ var ts; } if (pattern.kind === 148) { var name = declaration.propertyName || declaration.name; - var type = getTypeOfPropertyOfType(parentType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + var type = getTypeOfPropertyOfType(parentType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; @@ -9367,7 +14104,12 @@ var ts; var propName = "" + ts.indexOf(pattern.elements, declaration); var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + if (isTupleType(parentType)) { + error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); + } + else { + error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + } return unknownType; } } @@ -9382,7 +14124,7 @@ var ts; return anyType; } if (declaration.parent.parent.kind === 183) { - return getTypeForVariableDeclarationInForOfStatement(declaration.parent.parent); + return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); @@ -9406,7 +14148,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 218) { + if (declaration.kind === 219) { return checkIdentifier(declaration.name); } return undefined; @@ -9443,9 +14185,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 - ? getTypeFromObjectBindingPattern(pattern) - : getTypeFromArrayBindingPattern(pattern); + return pattern.kind === 148 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); @@ -9453,7 +14193,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 217 ? getWidenedType(type) : type; + return declaration.kind !== 218 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9474,10 +14214,10 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 216) { + if (declaration.parent.kind === 217) { return links.type = anyType; } - if (declaration.kind === 208) { + if (declaration.kind === 209) { return links.type = checkExpression(declaration.expression); } links.type = resolvingType; @@ -9489,9 +14229,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); } } @@ -9625,7 +14363,9 @@ var ts; ts.forEach(declaration.typeParameters, function (node) { var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); if (!result) { - result = [tp]; + result = [ + tp + ]; } else if (!ts.contains(result, tp)) { result.push(tp); @@ -9871,14 +14611,15 @@ var ts; var baseType = classType.baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? - getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + var signature = baseType.flags & 4096 ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; return signature; }); } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + return [ + createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false) + ]; } function createTupleTypeMemberSymbols(memberTypes) { var members = {}; @@ -9907,7 +14648,9 @@ var ts; return true; } function getUnionSignatures(types, kind) { - var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatureLists = ts.map(types, function (t) { + return getSignaturesOfType(t, kind); + }); var signatures = signatureLists[0]; for (var i = 0; i < signatures.length; i++) { if (signatures[i].typeParameters) { @@ -9923,7 +14666,9 @@ var ts; for (var i = 0; i < result.length; i++) { var s = result[i]; s.resolvedReturnType = undefined; - s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + s.unionSignatures = ts.map(signatureLists, function (signatures) { + return signatures[i]; + }); } return result; } @@ -10067,7 +14812,9 @@ var ts; return undefined; } if (!props) { - props = [prop]; + props = [ + prop + ]; } else { props.push(prop); @@ -10167,8 +14914,7 @@ var ts; var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; var minArgumentCount = -1; @@ -10299,8 +15045,12 @@ var ts; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; + type.callSignatures = !isConstructor ? [ + signature + ] : emptyArray; + type.constructSignatures = isConstructor ? [ + signature + ] : emptyArray; signature.isolatedSignatureType = type; } return signature.isolatedSignatureType; @@ -10327,9 +15077,7 @@ var ts; } function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType - : undefined; + return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { if (!type.constraint) { @@ -10383,7 +15131,9 @@ var ts; return links.isIllegalTypeReferenceInConstraint; } var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { + return d.parent === currentNode.parent; + })) { currentNode = currentNode.parent; } links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; @@ -10397,7 +15147,9 @@ var ts; if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { + return d.parent == typeParameter.parent; + }); } } if (links.isIllegalTypeReferenceInConstraint) { @@ -10496,7 +15248,9 @@ var ts; } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; + return arrayType !== emptyObjectType ? createTypeReference(arrayType, [ + elementType + ]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); @@ -10682,15 +15436,21 @@ var ts; return items; } function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + return function (t) { + return t === source ? target : t; + }; } function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + return function (t) { + return t === source1 ? target1 : t === source2 ? target2 : t; + }; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: return createUnaryTypeMapper(sources[0], targets[0]); - case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10701,15 +15461,21 @@ var ts; }; } function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; + return function (t) { + return t === source ? anyType : t; + }; } function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; + return function (t) { + return t === source1 || t === source2 ? anyType : t; + }; } function createTypeEraser(sources) { switch (sources.length) { - case 1: return createUnaryTypeEraser(sources[0]); - case 2: return createBinaryTypeEraser(sources[0], sources[1]); + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10733,7 +15499,9 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { + return mapper2(mapper1(t)); + }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -10793,8 +15561,7 @@ var ts; return mapper(type); } if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? - instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -10819,12 +15586,10 @@ var ts; case 151: return ts.forEach(node.elements, isContextSensitive); case 168: - return isContextSensitive(node.whenTrue) || - isContextSensitive(node.whenFalse); + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); case 167: - return node.operatorToken.kind === 49 && - (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 217: + return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 218: return isContextSensitive(node.initializer); case 132: case 131: @@ -10835,7 +15600,9 @@ var ts; return false; } function isContextSensitiveFunctionLikeDeclaration(node) { - return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); + return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { + return p.type; + }); } function getTypeWithoutConstructors(type) { if (type.flags & 48128) { @@ -10974,8 +15741,7 @@ var ts; } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { errorInfo = saveErrorInfo; return result; } @@ -11432,9 +16198,7 @@ var ts; if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { return 0; } var result = -1; @@ -11477,7 +16241,9 @@ var ts; return true; } function getCommonSupertype(types) { - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); + return ts.forEach(types, function (t) { + return isSupertypeOfEach(t, types) ? t : undefined; + }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { var bestSupertype; @@ -11514,6 +16280,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isTupleType(type) { + return (type.flags & 8192) && !!type.elementTypes; + } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); var members = {}; @@ -11593,9 +16362,7 @@ var ts; var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; case 128: - var diagnostic = declaration.dotDotDotToken ? - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; + var diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; case 195: case 132: @@ -11651,7 +16418,10 @@ var ts; function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ + primary: undefined, + secondary: undefined + }); } return { typeParameters: typeParameters, @@ -11696,9 +16466,7 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); if (!ts.contains(candidates, source)) candidates.push(source); break; @@ -11738,8 +16506,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & 48128 && (target.flags & (4096 | 8192) || - (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { + else if (source.flags & 48128 && (target.flags & (4096 | 8192) || (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -11846,16 +16613,23 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind) { + function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { if (type.flags & 16384) { var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (narrowedType !== emptyObjectType) { + if (ts.forEach(types, function (t) { + return !!(t.flags & typeKind) === isOfTypeKind; + })) { + var narrowedType = getUnionType(ts.filter(types, function (t) { + return !(t.flags & typeKind) === isOfTypeKind; + })); + if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; } } } + else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + return getUnionType(emptyArray); + } return type; } function hasInitializer(node) { @@ -11927,12 +16701,12 @@ var ts; case 186: case 187: case 188: - case 213: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: return ts.forEachChild(node, isAssignedIn); } return false; @@ -11941,12 +16715,13 @@ var ts; function resolveLocation(node) { var containerNodes = []; for (var parent = node.parent; parent; parent = parent.parent) { - if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(parent)) { + if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && isContextSensitive(parent)) { containerNodes.unshift(parent); } } - ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); + ts.forEach(containerNodes, function (node) { + getTypeOfNode(node); + }); } function getSymbolAtLocation(node) { resolveLocation(node); @@ -11988,7 +16763,7 @@ var ts; } } break; - case 220: + case 221: case 200: case 195: case 132: @@ -12022,16 +16797,16 @@ var ts; } if (assumeTrue) { if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true); + return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); } if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } - return removeTypesFromUnionType(type, typeInfo.flags, false); + return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true); + return removeTypesFromUnionType(type, typeInfo.flags, true, false); } return type; } @@ -12075,7 +16850,9 @@ var ts; return targetType; } if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + return getUnionType(ts.filter(type.types, function (t) { + return isTypeSubtypeOf(t, targetType); + })); } return type; } @@ -12131,9 +16908,7 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 216) { + if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -12240,21 +17015,10 @@ var ts; } if (container && container.parent && container.parent.kind === 196) { if (container.flags & 128) { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135; } else { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135 || container.kind === 130 || container.kind === 129 || container.kind === 133; } } } @@ -12301,8 +17065,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } - if (indexOfParameter === (func.parameters.length - 1) && - funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); } } @@ -12387,7 +17150,10 @@ var ts; mappedType = t; } else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + mappedTypes = [ + mappedType, + t + ]; } else { mappedTypes.push(t); @@ -12403,13 +17169,17 @@ var ts; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + return applyToContextualType(type, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } function contextualTypeHasIndexSignature(type, kind) { - return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }) : getIndexTypeOfObjectOrUnionType(type, kind)); } function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); @@ -12429,8 +17199,7 @@ var ts; return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || getIndexTypeOfContextualType(type, 0); } return undefined; } @@ -12439,9 +17208,7 @@ var ts; var type = getContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); - return getTypeOfPropertyOfContextualType(type, "" + index) - || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); } return undefined; } @@ -12474,7 +17241,7 @@ var ts; return getTypeFromTypeNode(parent.type); case 167: return getContextualTypeForBinaryOperand(node); - case 217: + case 218: return getContextualTypeForObjectLiteralElement(parent); case 151: return getContextualTypeForElementExpression(node); @@ -12505,9 +17272,7 @@ var ts; } function getContextualSignature(node) { ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); - var type = ts.isObjectLiteralMethod(node) - ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } @@ -12517,14 +17282,15 @@ var ts; var signatureList; var types = type.types; for (var i = 0; i < types.length; i++) { - if (signatureList && - getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { return undefined; } var signature = getNonGenericSignature(types[i]); if (signature) { if (!signatureList) { - signatureList = [signature]; + signatureList = [ + signature + ]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -12550,7 +17316,7 @@ var ts; if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { return true; } - if (parent.kind === 217) { + if (parent.kind === 218) { return isAssignmentTarget(parent.parent); } if (parent.kind === 151) { @@ -12622,20 +17388,16 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 217 || - memberDecl.kind === 218 || - ts.isObjectLiteralMethod(memberDecl)) { - if (memberDecl.kind === 217) { + if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218) { var type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { var type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 218); - var type = memberDecl.name.kind === 126 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 219); + var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -12751,9 +17513,7 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 - ? node.expression - : node.left; + var left = node.kind === 153 ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); @@ -12790,8 +17550,7 @@ var ts; return unknownType; } var isConstEnum = isConstEnumObjectType(objectType); - if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + if (isConstEnum && (!node.argumentExpression || node.argumentExpression.kind !== 8)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } @@ -12958,8 +17717,7 @@ var ts; callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } - var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } @@ -12976,8 +17734,7 @@ var ts; function getSingleCallSignature(type) { if (type.flags & 48128) { var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; } } @@ -13047,9 +17804,7 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : - arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -13061,7 +17816,9 @@ var ts; var args; if (node.kind === 157) { var template = node.template; - args = [template]; + args = [ + template + ]; if (template.kind === 169) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); @@ -13313,10 +18070,7 @@ var ts; } if (node.kind === 156) { var declaration = signature.declaration; - if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + if (declaration && declaration.kind !== 133 && declaration.kind !== 137 && declaration.kind !== 141) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13341,13 +18095,9 @@ var ts; } function getTypeAtPosition(signature, pos) { if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } - return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + return signature.hasRestParameter ? getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : anyArrayType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -13647,12 +18397,9 @@ var ts; var properties = node.properties; for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var name = p.name; - var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { checkDestructuringAssignment(p.initializer || name, type); } @@ -13677,14 +18424,17 @@ var ts; if (e.kind !== 172) { if (e.kind !== 171) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : getIndexTypeOfType(sourceType, 1); if (type) { checkDestructuringAssignment(e, type, contextualMapper); } else { - error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + if (isTupleType(sourceType)) { + error(e, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), sourceType.elementTypes.length, elements.length); + } + else { + error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + } } } else { @@ -13755,9 +18505,7 @@ var ts; if (rightType.flags & (32 | 64)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && - (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { + if ((leftType.flags & 8) && (rightType.flags & 8) && (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operatorToken.kind), ts.tokenToString(suggestedOperator)); } else { @@ -13819,7 +18567,10 @@ var ts; case 48: return rightType; case 49: - return getUnionType([leftType, rightType]); + return getUnionType([ + leftType, + rightType + ]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -13827,9 +18578,7 @@ var ts; return rightType; } function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : - undefined; + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : someConstituentTypeHasKind(rightType, 1048576) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); return false; @@ -13875,7 +18624,10 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - return getUnionType([type1, type2]); + return getUnionType([ + type1, + type2 + ]); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -13939,9 +18691,7 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 153 && node.parent.expression === node) || (node.parent.kind === 154 && node.parent.expression === node) || ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -14051,9 +18801,7 @@ var ts; if (node.kind === 138) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || node.kind === 136 || node.kind === 133 || node.kind === 137) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14146,8 +18894,10 @@ var ts; case 160: case 195: case 161: - case 152: return false; - default: return ts.forEachChild(n, containsSuperCall); + case 152: + return false; + default: + return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { @@ -14159,14 +18909,13 @@ var ts; } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && - !(n.flags & 128) && - !!n.initializer; + return n.kind === 130 && !(n.flags & 128) && !!n.initializer; } if (ts.getClassBaseTypeNode(node.parent)) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { + return p.flags & (16 | 32 | 64); + }); if (superCallShouldBeFirst) { var statements = node.body.statements; if (!statements.length || statements[0].kind !== 177 || !isSuperCallExpression(statements[0].expression)) { @@ -14488,16 +19237,16 @@ var ts; case 197: return 2097152; case 200: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; + return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; case 196: case 199: return 2097152 | 1048576; - case 202: + case 203: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); + ts.forEach(target.declarations, function (d) { + result |= getDeclarationSpaces(d); + }); return result; default: return 1048576; @@ -14506,10 +19255,7 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionName(node.name) || - checkGrammarForGenerator(node); + checkFunctionLikeDeclaration(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -14564,12 +19310,7 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135) { + if (node.kind === 130 || node.kind === 129 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135) { return false; } if (ts.isInAmbientContext(node)) { @@ -14628,7 +19369,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 220 && ts.isExternalModule(parent)) { + if (parent.kind === 221 && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -14637,17 +19378,11 @@ var ts; var symbol = getSymbolOfNode(node); if (symbol.flags & 1) { var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 220); + var container = varDeclList.parent.kind === 175 && varDeclList.parent.parent; + var namesShareScope = container && (container.kind === 174 && ts.isFunctionLike(container.parent) || (container.kind === 201 && container.kind === 200) || container.kind === 221); 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); @@ -14806,18 +19541,13 @@ var ts; checkSourceElement(node.statement); } function checkForOfStatement(node) { - if (languageVersion < 2) { - grammarErrorOnFirstToken(node, ts.Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); - return; - } checkGrammarForInOrForOfStatement(node); if (node.initializer.kind === 194) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var rightType = checkExpression(node.expression); - var iteratedType = checkIteratedType(rightType, node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression); if (varExpr.kind === 151 || varExpr.kind === 152) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } @@ -14866,20 +19596,17 @@ var ts; checkVariableDeclaration(decl); } } - function getTypeForVariableDeclarationInForOfStatement(forOfStatement) { - if (languageVersion < 2) { - return anyType; - } - var expressionType = getTypeOfExpression(forOfStatement.expression); - return checkIteratedType(expressionType, forOfStatement.expression) || anyType; + function checkRightHandSideOfForOf(rhsExpression) { + var expressionType = getTypeOfExpression(rhsExpression); + return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, rhsExpression); } function checkIteratedType(iterable, expressionForError) { ts.Debug.assert(languageVersion >= 2); var iteratedType = getIteratedType(iterable, expressionForError); if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; + var completeIterableType = globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [ + iteratedType + ]) : emptyObjectType; checkTypeAssignableTo(iterable, completeIterableType, expressionForError); } return iteratedType; @@ -14927,6 +19654,39 @@ var ts; return iteratorNextValue; } } + function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + ts.Debug.assert(languageVersion < 2); + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var hasStringConstituent = arrayOrStringType !== arrayType; + var reportedError = false; + if (hasStringConstituent) { + if (languageVersion < 1) { + error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + if (arrayType === emptyObjectType) { + return stringType; + } + } + if (!isArrayLikeType(arrayType)) { + if (!reportedError) { + var diagnostic = hasStringConstituent ? ts.Diagnostics.Type_0_is_not_an_array_type : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(expressionForError, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : unknownType; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + if (hasStringConstituent) { + if (arrayElementType.flags & 258) { + return stringType; + } + return getUnionType([ + arrayElementType, + stringType + ]); + } + return arrayElementType; + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } @@ -14975,8 +19735,8 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (clause.kind === 214 && !hasDuplicateDefaultClause) { + ts.forEach(node.caseBlock.clauses, function (clause) { + if (clause.kind === 215 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -14988,7 +19748,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 213) { + if (produceDiagnostics && clause.kind === 214) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15085,7 +19845,9 @@ var ts; if (stringIndexType && numberIndexType) { errorNode = declaredNumberIndexer || declaredStringIndexer; if (!errorNode && (type.flags & 2048)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { + return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); + }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -15107,13 +19869,13 @@ var ts; errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { + return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); + }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 - ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 - : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } @@ -15277,7 +20039,12 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { + prop: p, + containingType: type + }; + }); var ok = true; for (var i = 0, len = type.baseTypes.length; i < len; ++i) { var base = type.baseTypes[i]; @@ -15285,7 +20052,10 @@ var ts; for (var j = 0, proplen = properties.length; j < proplen; ++j) { var prop = properties[j]; if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; + seen[prop.name] = { + prop: prop, + containingType: base + }; } else { var existing = seen[prop.name]; @@ -15388,9 +20158,12 @@ var ts; return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 33: + return value; + case 34: + return -value; + case 47: + return enumIsConst ? ~value : undefined; } return undefined; case 167: @@ -15406,17 +20179,28 @@ var ts; return undefined; } switch (e.operatorToken.kind) { - case 44: return left | right; - case 43: return left & right; - case 41: return left >> right; - case 42: return left >>> right; - case 40: return left << right; - case 45: return left ^ right; - case 35: return left * right; - case 36: return left / right; - case 33: return left + right; - case 34: return left - right; - case 37: return left % right; + case 44: + return left | right; + case 43: + return left & right; + case 41: + return left >> right; + case 42: + return left >>> right; + case 40: + return left << right; + case 45: + return left ^ right; + case 35: + return left * right; + case 36: + return left / right; + case 33: + return left + right; + case 34: + return left - right; + case 37: + return left % right; } return undefined; case 7: @@ -15439,8 +20223,7 @@ var ts; } else { if (e.kind === 154) { - if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } var enumType = getTypeOfNode(e.expression); @@ -15536,10 +20319,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 - && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15574,10 +20354,8 @@ var ts; return false; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 220 && !inAmbientExternalModule) { - error(moduleName, node.kind === 209 ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + if (node.parent.kind !== 221 && !inAmbientExternalModule) { + error(moduleName, node.kind === 210 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { @@ -15590,13 +20368,9 @@ var ts; var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | - (symbol.flags & 793056 ? 793056 : 0) | - (symbol.flags & 1536 ? 1536 : 0); + var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 211 ? - ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : - ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + var message = node.kind === 212 ? 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)); } } @@ -15617,7 +20391,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { checkImportBinding(importClause.namedBindings); } else { @@ -15667,7 +20441,7 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 220 ? node.parent : node.parent.parent; + var container = node.parent.kind === 221 ? node.parent : node.parent.parent; if (container.kind === 200 && container.name.kind === 64) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; @@ -15684,7 +20458,7 @@ var ts; checkExternalModuleExports(container); } function getModuleStatements(node) { - if (node.kind === 220) { + if (node.kind === 221) { return node.statements; } if (node.kind === 200 && node.body.kind === 201) { @@ -15698,7 +20472,7 @@ var ts; var statements = getModuleStatements(declarations[i]); for (var j = 0; j < statements.length; j++) { var node = statements[j]; - if (node.kind === 209) { + if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; @@ -15711,7 +20485,7 @@ var ts; } } } - else if (node.kind !== 208 && node.flags & 1 && !(node.flags & 256)) { + else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { return true; } } @@ -15821,13 +20595,13 @@ var ts; return checkEnumDeclaration(node); case 200: return checkModuleDeclaration(node); - case 203: + case 204: return checkImportDeclaration(node); - case 202: + case 203: return checkImportEqualsDeclaration(node); - case 209: + case 210: return checkExportDeclaration(node); - case 208: + case 209: return checkExportAssignment(node); case 176: checkGrammarStatementInAmbientContext(node); @@ -15868,7 +20642,7 @@ var ts; case 150: case 151: case 152: - case 217: + case 218: case 153: case 154: case 155: @@ -15900,19 +20674,20 @@ var ts; case 185: case 186: case 188: - case 213: + case 202: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: case 193: case 194: case 196: case 199: - case 219: - case 208: case 220: + case 209: + case 221: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16000,7 +20775,7 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: @@ -16028,9 +20803,7 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && - isTypeDeclaration(name.parent) && - name.parent.name === name; + return name.kind == 64 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { @@ -16112,10 +20885,10 @@ var ts; while (nodeOnRightSide.parent.kind === 125) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 202) { + if (nodeOnRightSide.parent.kind === 203) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16124,14 +20897,13 @@ var ts; return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); + return (node.parent.kind === 125 && node.parent.right === node) || (node.parent.kind === 153 && node.parent.name === node); } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 208) { + if (entityName.parent.kind === 209) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } if (entityName.kind !== 153) { @@ -16180,9 +20952,7 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 208 - ? getSymbolOfEntityNameOrPropertyAccessExpression(node) - : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -16201,10 +20971,7 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && - ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 203 || node.parent.kind === 209) && - node.parent.moduleSpecifier === node)) { + if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: @@ -16222,7 +20989,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 218) { + if (location && location.kind === 219) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16290,13 +21057,17 @@ var ts; else if (symbol.flags & 67108864) { var target = getSymbolLinks(symbol).target; if (target) { - return [target]; + return [ + target + ]; } } - return [symbol]; + return [ + symbol + ]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 220; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -16337,16 +21108,16 @@ var ts; case 199: generateNameForModuleOrEnum(node); break; - case 203: + case 204: generateNameForImportDeclaration(node); break; - case 209: + case 210: generateNameForExportDeclaration(node); break; - case 208: + case 209: generateNameForExportAssignment(node); break; - case 220: + case 221: case 201: ts.forEach(node.statements, generateNames); break; @@ -16375,12 +21146,11 @@ var ts; } function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + var baseName = expr.kind === 8 ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; assignGeneratedName(node, makeUniqueName(baseName)); } function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 206) { + if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { generateNameForImportOrExportDeclaration(node); } } @@ -16410,7 +21180,7 @@ var ts; } function getAliasNameSubstitution(symbol) { var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 207) { + if (declaration && declaration.kind === 208) { var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); var propertyName = declaration.propertyName || declaration.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -16449,7 +21219,7 @@ var ts; return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 220 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } return isAliasResolvedToValue(getSymbolOfNode(node)); @@ -16474,8 +21244,7 @@ var ts; if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || - (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); + return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; } @@ -16487,14 +21256,14 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 219) { + if (node.kind === 220) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 219) { + if (declaration.kind === 220) { return getEnumMemberValue(declaration); } } @@ -16502,9 +21271,7 @@ var ts; } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) - ? getTypeOfSymbol(symbol) - : unknownType; + var type = symbol && !(symbol.flags & (2048 | 131072)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -16512,29 +21279,20 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } function isUnknownIdentifier(location, name) { - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); + return !resolveName(location, name, 107455, undefined, undefined) && !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { + if (n.parent.kind === 153 && n.parent.name === n) { return undefined; } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { + if (n.parent.kind === 150 && n.parent.propertyName === n) { return undefined; } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || - getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 2 | 8388608, undefined, undefined); - var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 216; + var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || n.parent.kind === 150 ? getSymbolOfNode(n.parent) : undefined; + var symbol = declarationSymbol || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 2 | 8388608, undefined, undefined); + var isLetOrConst = symbol && (symbol.flags & 2) && symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -16611,10 +21369,10 @@ var ts; case 175: case 195: case 198: + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 128: break; default: @@ -16649,7 +21407,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -16658,7 +21416,7 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 128) { @@ -16711,7 +21469,7 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 203 || node.kind === 202) && flags & 2) { + else if ((node.kind === 204 || node.kind === 203) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 197 && flags & 2) { @@ -16824,8 +21582,7 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || - checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { @@ -16839,8 +21596,7 @@ var ts; } } function checkGrammarArguments(node, arguments) { - return checkGrammarForDisallowedTrailingComma(arguments) || - checkGrammarForOmittedArgument(node, arguments); + return checkGrammarForDisallowedTrailingComma(arguments) || checkGrammarForOmittedArgument(node, arguments); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -16936,13 +21692,12 @@ var ts; for (var i = 0, n = node.properties.length; i < n; i++) { var prop = node.properties[i]; var name = prop.name; - if (prop.kind === 172 || - name.kind === 126) { + if (prop.kind === 172 || name.kind === 126) { checkGrammarComputedPropertyName(name); continue; } var currentKind; - if (prop.kind === 217 || prop.kind === 218) { + if (prop.kind === 218 || prop.kind === 219) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 7) { checkGrammarNumbericLiteral(name); @@ -16993,22 +21748,16 @@ var ts; var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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); } } @@ -17062,9 +21811,7 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarForGenerator(node)) { return true; } if (node.parent.kind === 152) { @@ -17115,8 +21862,7 @@ var ts; switch (current.kind) { case 189: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 - && !isIterationStatement(current.statement, true); + var isMisplacedContinueLabel = node.kind === 184 && !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); } @@ -17137,15 +21883,11 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 - ? 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; + var message = node.kind === 185 ? 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 === 185 - ? 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; + var message = node.kind === 185 ? 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); } } @@ -17182,8 +21924,7 @@ var ts; } } var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); - return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || - checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 64) { @@ -17315,8 +22056,7 @@ var ts; } function checkGrammarProperty(node) { if (node.parent.kind === 196) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || - checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } @@ -17335,12 +22075,7 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 203 || - node.kind === 202 || - node.kind === 209 || - node.kind === 208 || - (node.flags & 2)) { + if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (node.flags & 2)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -17367,7 +22102,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 220) { + if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 221) { var links = getNodeLinks(node.parent); if (!links.hasReportedStatementInAmbientContext) { return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -17402,7 +22137,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var indentStrings = ["", " "]; + var indentStrings = [ + "", + " " + ]; function getIndentString(level) { if (indentStrings[level] === undefined) { indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; @@ -17477,21 +22215,34 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + increaseIndent: function () { + return indent++; + }, + decreaseIndent: function () { + return indent--; + }, + getIndent: function () { + return indent; + }, + getTextPos: function () { + return output.length; + }, + getLine: function () { + return lineCount + 1; + }, + getColumn: function () { + return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; + }, + getText: function () { + return output; + } }; } function getLineOfLocalPosition(currentSourceFile, pos) { return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { writer.writeLine(); } } @@ -17520,9 +22271,7 @@ var ts; var lineCount = ts.getLineStarts(currentSourceFile).length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); + var nextLineStart = (currentLine + 1) === lineCount ? currentSourceFile.text.length + 1 : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); if (pos !== comment.pos) { if (firstCommentLineIndent === undefined) { firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); @@ -17600,8 +22349,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { + if ((member.kind === 134 || member.kind === 135) && (member.flags & 128) === (accessor.flags & 128)) { var memberName = ts.getPropertyNameForPropertyNameNode(member.name); var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); if (memberName === accessorName) { @@ -17657,7 +22405,8 @@ var ts; var enclosingDeclaration; var currentSourceFile; var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; + var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { + } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; var aliasDeclarationEmitInfo = []; var referencePathsOutput = ""; @@ -17666,9 +22415,7 @@ var ts; var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { + if (referencedFile && ((referencedFile.flags & 2048) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); if (!isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; @@ -17685,8 +22432,7 @@ var ts; if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } @@ -17740,7 +22486,9 @@ var ts; function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { var oldWriter = writer; ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); + var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { + return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; + }); if (aliasEmitInfo) { createAndSetNewTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { @@ -17858,7 +22606,7 @@ var ts; ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 202 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -18065,15 +22813,8 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + if (node.parent.kind === 140 || node.parent.kind === 141 || (node.parent.parent && node.parent.parent.kind === 143)) { + ts.Debug.assert(node.parent.kind === 132 || node.parent.kind === 131 || node.parent.kind === 140 || node.parent.kind === 141 || node.parent.kind === 136 || node.parent.kind === 137); emitType(node.constraint); } else { @@ -18136,9 +22877,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.parent.parent.kind === 196) { - diagnosticMessage = isImplementsList ? - ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; @@ -18171,7 +22910,9 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + emitHeritageClause([ + baseTypeNode + ], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -18231,31 +22972,17 @@ var ts; function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 === 130 || node.kind === 129) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } return diagnosticMessage !== undefined ? { @@ -18272,7 +22999,9 @@ var ts; } } function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { + return resolver.isDeclarationVisible(varDeclaration); + }); if (hasDeclarationWithEmit) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -18317,25 +23046,17 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 - ? accessor.type - : accessor.parameters.length > 0 - ? accessor.parameters[0].type - : undefined; + return accessor.kind === 134 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (accessorWithTypeAnnotation.kind === 135) { if (accessorWithTypeAnnotation.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -18345,18 +23066,10 @@ var ts; } else { if (accessorWithTypeAnnotation.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { diagnosticMessage: diagnosticMessage, @@ -18370,8 +23083,7 @@ var ts; if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); if (node.kind === 195) { emitModuleElementDeclarationFlags(node); @@ -18438,48 +23150,28 @@ var ts; var diagnosticMessage; switch (node.kind) { case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 138: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 132: case 131: if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: ts.Debug.fail("This is unknown kind for signature: " + node.kind); @@ -18506,9 +23198,7 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 140 || node.parent.kind === 141 || node.parent.parent.kind === 143) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { @@ -18518,50 +23208,28 @@ var ts; var diagnosticMessage; switch (node.parent.kind) { case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 132: case 131: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); @@ -18598,26 +23266,22 @@ var ts; return emitClassDeclaration(node); case 198: return emitTypeAliasDeclaration(node); - case 219: + case 220: return emitEnumMemberDeclaration(node); case 199: return emitEnumDeclaration(node); case 200: return emitModuleDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 208: + case 209: return emitExportAssignment(node); - case 220: + case 221: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } @@ -18668,6 +23332,7 @@ var ts; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; var lastFrame; var currentScopeNames; @@ -18680,41 +23345,57 @@ var ts; var exportSpecifiers; var exportDefault; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; + var emitLeadingComments = compilerOptions.removeComments ? function (node) { + } : emitLeadingDeclarationComments; + var emitTrailingComments = compilerOptions.removeComments ? function (node) { + } : emitTrailingDeclarationComments; + var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { + } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { } : emitPinnedOrTripleSlashCommentsOfNode; + var emitDetachedComments = compilerOptions.removeComments ? function (node) { + } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; - var emit = emitNode; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; + var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var emit = emitNodeWithoutSourceMap; + var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; + var emitStart = function (node) { + }; + var emitEnd = function (node) { + }; var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; + var scopeEmitStart = function (scopeDeclaration, scopeName) { + }; + var scopeEmitEnd = function () { + }; var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); } if (root) { - emit(root); + emitSourceFile(root); } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); + emitSourceFile(sourceFile); } }); } writeLine(); writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); return; + function emitSourceFile(sourceFile) { + currentSourceFile = sourceFile; + emit(sourceFile); + } function enterNameScope() { var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { names: names, previous: lastFrame }; + lastFrame = { + names: names, + previous: lastFrame + }; return true; } return false; @@ -18734,8 +23415,13 @@ var ts; name = baseName; } else { - name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); + name = ts.generateUniqueName(baseName, function (n) { + return isExistingName(location, n); + }); } + return recordNameInCurrentScope(name); + } + function recordNameInCurrentScope(name) { if (!currentScopeNames) { currentScopeNames = {}; } @@ -18831,12 +23517,7 @@ var ts; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { encodeLastRecordedSourceMapSpan(); lastRecordedSourceMapSpan = { emittedLine: emittedLine, @@ -18899,20 +23580,10 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + else if (node.kind === 195 || node.kind === 160 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135 || node.kind === 200 || node.kind === 196 || node.kind === 199) { if (node.name) { var name = node.name; - scopeName = name.kind === 126 - ? ts.getTextOfNode(name) - : node.name.text; + scopeName = name.kind === 126 ? ts.getTextOfNode(name) : node.name.text; } recordScopeNameStart(scopeName); } @@ -18990,21 +23661,32 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithMap(node) { + function emitNodeWithSourceMap(node) { if (node) { - if (node.kind != 220) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node); + } + if (node.kind != 221) { recordEmitNodeStartSpan(node); - emitNode(node); + emitNodeWithoutSourceMap(node); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNode(node); + emitNodeWithoutSourceMap(node); } } } + function emitNodeWithSourceMapWithoutComments(node) { + if (node) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMapWithoutComments(node); + recordEmitNodeEndSpan(node); + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; + emit = emitNodeWithSourceMap; + emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19024,6 +23706,7 @@ var ts; name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); tempCount++; } + recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); result.text = name; return result; @@ -19085,7 +23768,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19095,7 +23778,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19105,12 +23788,11 @@ var ts; } emit(nodes[i]); } - var closeTokenIsOnSameLineAsLastElement = nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes)); if (nodes.hasTrailingComma && allowTrailingComma) { write(","); } decreaseIndent(); - if (closeTokenIsOnSameLineAsLastElement) { + if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19244,8 +23926,7 @@ var ts; if (node.template.kind === 169) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 167 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); } @@ -19256,8 +23937,7 @@ var ts; ts.forEachChild(node, emit); return; } - var emitOuterParens = ts.isExpression(node.parent) - && templateNeedsParens(node, node.parent); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); if (emitOuterParens) { write("("); } @@ -19268,8 +23948,7 @@ var ts; } for (var i = 0; i < node.templateSpans.length; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + var needsParens = templateSpan.expression.kind !== 159 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); } @@ -19350,9 +24029,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 195: @@ -19363,11 +24042,11 @@ var ts; case 197: case 199: case 200: - case 202: + case 203: return parent.name === node; case 185: case 184: - case 208: + case 209: return false; case 189: return node.parent.label === node; @@ -19555,9 +24234,9 @@ var ts; } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 217: - return property.initializer; case 218: + return property.initializer; + case 219: return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); case 132: return createFunctionExpression(property.parameters, property.body); @@ -19611,6 +24290,11 @@ var ts; result.right = right; return result; } + function createExpressionStatement(expression) { + var result = ts.createSynthesizedNode(177); + result.expression = expression; + return result; + } function createMemberAccessForPropertyName(expression, memberName) { if (memberName.kind === 64) { return createPropertyAccessExpression(expression, memberName); @@ -19626,7 +24310,7 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(217); + var result = ts.createSynthesizedNode(218); result.name = name; result.initializer = initializer; return result; @@ -19721,29 +24405,31 @@ var ts; } return false; } - function indentIfOnDifferentLines(parent, node1, node2) { - var isSynthesized = ts.nodeIsSynthesized(parent); - var realNodesAreOnDifferentLines = !isSynthesized && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { + var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); writeLine(); return true; } - return false; + else { + if (valueToWriteWhenNotIndenting) { + write(valueToWriteWhenNotIndenting); + } + return false; + } } function emitPropertyAccess(node) { if (tryEmitConstantValue(node)) { return; } emit(node.expression); - var indented = indentIfOnDifferentLines(node, node.expression, node.dotToken); + var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); - indented = indented || indentIfOnDifferentLines(node, node.dotToken, node.name); + var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); emit(node.name); - if (indented) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { emit(node.left); @@ -19760,7 +24446,9 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { + return e.kind === 171; + }); } function skipParentheses(node) { while (node.kind === 159 || node.kind === 158) { @@ -19873,14 +24561,7 @@ var ts; while (operand.kind == 158) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && - operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + if (operand.kind !== 165 && operand.kind !== 164 && operand.kind !== 163 && operand.kind !== 162 && operand.kind !== 166 && operand.kind !== 156 && !(operand.kind === 155 && node.parent.kind === 156) && !(operand.kind === 160 && node.parent.kind === 155)) { emit(operand); return; } @@ -19923,27 +24604,16 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node); + if (languageVersion < 2 && node.operatorToken.kind === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + emitDestructuring(node, node.parent.kind === 177); } else { emit(node.left); - var indented1 = indentIfOnDifferentLines(node, node.left, node.operatorToken); - if (!indented1 && node.operatorToken.kind !== 23) { - write(" "); - } + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); - if (!indented1) { - var indented2 = indentIfOnDifferentLines(node, node.operatorToken, node.right); - } - if (!indented2) { - write(" "); - } + var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); - if (indented1 || indented2) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); } } function synthesizedNodeStartsOnNewLine(node) { @@ -19951,34 +24621,22 @@ var ts; } function emitConditionalExpression(node) { emit(node.condition); - var indent1 = indentIfOnDifferentLines(node, node.condition, node.questionToken); - if (!indent1) { - write(" "); - } + var indentedBeforeQuestion = indentIfOnDifferentLines(node, node.condition, node.questionToken, " "); write("?"); - if (!indent1) { - var indent2 = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue); - } - if (!indent2) { - write(" "); - } + var indentedAfterQuestion = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue, " "); emit(node.whenTrue); - if (indent1 || indent2) { - decreaseIndent(); - } - var indent3 = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken); - if (!indent3) { - write(" "); - } + decreaseIndentIf(indentedBeforeQuestion, indentedAfterQuestion); + var indentedBeforeColon = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken, " "); write(":"); - if (!indent3) { - var indent4 = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse); - } - if (!indent4) { - write(" "); - } + var indentedAfterColon = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse, " "); emit(node.whenFalse); - if (indent3 || indent4) { + decreaseIndentIf(indentedBeforeColon, indentedAfterColon); + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { decreaseIndent(); } } @@ -19989,7 +24647,7 @@ var ts; } } function emitBlock(node) { - if (isSingleLineEmptyBlock(node)) { + if (preserveNewLines && isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20111,6 +24769,9 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { + if (languageVersion < 2 && node.kind === 183) { + return emitDownLevelForOfStatement(node); + } var endPos = emitToken(81, node.pos); write(" "); endPos = emitToken(16, endPos); @@ -20136,6 +24797,86 @@ var ts; emitToken(17, node.expression.end); emitEmbeddedStatement(node.statement); } + function emitDownLevelForOfStatement(node) { + var endPos = emitToken(81, node.pos); + write(" "); + endPos = emitToken(16, endPos); + var rhsIsIdentifier = node.expression.kind === 64; + var counter = createTempVariable(node, true); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + emitStart(node.expression); + write("var "); + emitNodeWithoutSourceMap(counter); + write(" = 0"); + emitEnd(node.expression); + if (!rhsIsIdentifier) { + write(", "); + emitStart(node.expression); + emitNodeWithoutSourceMap(rhsReference); + write(" = "); + emitNodeWithoutSourceMap(node.expression); + emitEnd(node.expression); + } + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write(" < "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + emitEnd(node.initializer); + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write("++"); + emitEnd(node.initializer); + emitToken(17, node.expression.end); + write(" {"); + writeLine(); + increaseIndent(); + var rhsIterationValue = createElementAccessExpression(rhsReference, counter); + emitStart(node.initializer); + if (node.initializer.kind === 194) { + write("var "); + var variableDeclarationList = node.initializer; + if (variableDeclarationList.declarations.length > 0) { + var declaration = variableDeclarationList.declarations[0]; + if (ts.isBindingPattern(declaration.name)) { + emitDestructuring(declaration, false, rhsIterationValue); + } + else { + emitNodeWithoutSourceMap(declaration); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + emitNodeWithoutSourceMap(createTempVariable(node, false)); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); + if (node.initializer.kind === 151 || node.initializer.kind === 152) { + emitDestructuring(assignmentExpression, true, undefined, node); + } + else { + emitNodeWithoutSourceMap(assignmentExpression); + } + } + emitEnd(node.initializer); + write(";"); + if (node.statement.kind === 174) { + emitLines(node.statement.statements); + } + else { + writeLine(); + emit(node.statement); + } + writeLine(); + decreaseIndent(); + write("}"); + } function emitBreakOrContinueStatement(node) { emitToken(node.kind === 185 ? 65 : 70, node.pos); emitOptional(" ", node.label); @@ -20159,7 +24900,10 @@ var ts; emit(node.expression); endPos = emitToken(17, node.expression.end); write(" "); - emitToken(14, endPos); + emitCaseBlock(node.caseBlock, endPos); + } + function emitCaseBlock(node, startPos) { + emitToken(14, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); @@ -20167,19 +24911,16 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 213) { + if (node.kind === 214) { write("case "); emit(node.expression); write(":"); @@ -20187,7 +24928,7 @@ var ts; else { write("default:"); } - if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20247,7 +24988,7 @@ var ts; emitContainingModuleName(node); write("."); } - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { @@ -20264,21 +25005,22 @@ var ts; emitStart(specifier.name); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNode(name); + emitNodeWithoutSourceMap(name); write(";"); }); } } - function emitDestructuring(root, value) { + function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } else { + ts.Debug.assert(!isAssignmentExpressionStatement); emitBindingElement(root, value); } function emitAssignment(name, value) { @@ -20297,7 +25039,7 @@ var ts; } function ensureIdentifier(expr) { if (expr.kind !== 64) { - var identifier = createTempVariable(root); + var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -20355,7 +25097,7 @@ var ts; } for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20400,7 +25142,7 @@ var ts; function emitAssignmentExpression(root) { var target = root.left; var value = root.right; - if (root.parent.kind === 177) { + if (isAssignmentExpressionStatement) { emitDestructuringAssignment(target, value); } else { @@ -20457,7 +25199,7 @@ var ts; function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { if (languageVersion < 2) { - emitDestructuring(node); + emitDestructuring(node, false); } else { emit(node.name); @@ -20465,15 +25207,12 @@ var ts; } } else { - var isLet = renameNonTopLevelLetAndConst(node.name); + renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && - (getCombinedFlagsForIdentifier(node.name) & 4096); - if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); + if (isUninitializedLet && node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { initializer = createVoidZero(); } } @@ -20489,29 +25228,6 @@ var ts; ts.forEach(name.elements, emitExportVariableAssignments); } } - function getEnclosingBlockScopeContainer(node) { - var current = node; - while (current) { - if (ts.isFunctionLike(current)) { - return current; - } - switch (current.kind) { - case 220: - case 91: - case 216: - case 200: - case 181: - case 182: - case 183: - return current; - case 174: - if (!ts.isFunctionLike(current.parent)) { - return current; - } - } - current = current.parent; - } - } function getCombinedFlagsForIdentifier(node) { if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return 0; @@ -20519,10 +25235,7 @@ var ts; return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || - ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 64 || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); @@ -20530,13 +25243,11 @@ var ts; return; } var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 220) { + if (list.parent.kind === 175 && list.parent.parent.kind === 221) { return; } - var blockScopeContainer = getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 220 - ? blockScopeContainer - : blockScopeContainer.parent; + var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); + var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; var generatedName = generateUniqueNameForLocation(parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { @@ -20583,7 +25294,7 @@ var ts; if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); - emitDestructuring(p, tempParameters[tempIndex]); + emitDestructuring(p, false, tempParameters[tempIndex]); write(";"); tempIndex++; } @@ -20591,14 +25302,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitNode(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -20614,7 +25325,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -20635,7 +25346,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -20653,7 +25364,7 @@ var ts; } function emitDeclarationName(node) { if (node.name) { - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(resolver.getGeneratedNameForNode(node)); @@ -20770,11 +25481,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitNode(body, true); + emitWithoutComments(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -20785,7 +25496,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emit(node.body, true); + emitWithoutComments(node.body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -20807,7 +25518,7 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { for (var i = 0, n = body.statements.length; i < n; i++) { write(" "); emit(body.statements[i]); @@ -20848,7 +25559,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitNode(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -20860,7 +25571,7 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } else if (memberName.kind === 126) { @@ -20868,7 +25579,7 @@ var ts; } else { write("."); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); } } function emitMemberAssignments(node, staticFlag) { @@ -21297,8 +26008,7 @@ var ts; emitImportDeclaration(node); return; } - if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); if (!(node.flags & 1)) @@ -21327,11 +26037,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitNode(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); }); @@ -21349,15 +26059,15 @@ var ts; } } function createExternalImportInfo(node) { - if (node.kind === 202) { - if (node.moduleReference.kind === 212) { + if (node.kind === 203) { + if (node.moduleReference.kind === 213) { return { rootNode: node, declarationNode: node }; } } - else if (node.kind === 203) { + else if (node.kind === 204) { var importClause = node.importClause; if (importClause) { if (importClause.name) { @@ -21366,7 +26076,7 @@ var ts; declarationNode: importClause }; } - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { return { rootNode: node, declarationNode: importClause.namedBindings @@ -21382,7 +26092,7 @@ var ts; rootNode: node }; } - else if (node.kind === 209) { + else if (node.kind === 210) { if (node.moduleSpecifier) { return { rootNode: node @@ -21395,7 +26105,7 @@ var ts; exportSpecifiers = {}; exportDefault = undefined; ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209 && !node.moduleSpecifier) { + if (node.kind === 210 && !node.moduleSpecifier) { ts.forEach(node.exportClause.elements, function (specifier) { if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; @@ -21404,7 +26114,7 @@ var ts; (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); }); } - else if (node.kind === 208) { + else if (node.kind === 209) { exportDefault = exportDefault || node; } else if (node.kind === 195 || node.kind === 196) { @@ -21434,7 +26144,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } }); @@ -21512,10 +26222,10 @@ var ts; writeLine(); emitStart(exportDefault); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 208) { + if (exportDefault.kind === 209) { emit(exportDefault.expression); } - else if (exportDefault.kind === 211) { + else if (exportDefault.kind === 212) { emit(exportDefault.propertyName); } else { @@ -21539,8 +26249,7 @@ var ts; } return statements.length; } - function emitSourceFile(node) { - currentSourceFile = node; + function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); @@ -21580,14 +26289,14 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emitNode(node, disableComments) { + function emitNodeWithoutSourceMapWithComments(node) { if (!node) { return; } if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = !disableComments && shouldEmitLeadingAndTrailingComments(node); + var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } @@ -21596,14 +26305,23 @@ var ts; emitTrailingComments(node); } } + function emitNodeWithoutSourceMapWithoutComments(node) { + if (!node) { + return; + } + if (node.flags & 2) { + return emitPinnedOrTripleSlashComments(node); + } + emitJavaScriptWorker(node); + } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { case 197: case 195: + case 204: case 203: - case 202: case 198: - case 208: + case 209: return false; case 200: return shouldEmitModuleDeclaration(node); @@ -21658,9 +26376,9 @@ var ts; return emitArrayLiteral(node); case 152: return emitObjectLiteral(node); - case 217: - return emitPropertyAssignment(node); case 218: + return emitPropertyAssignment(node); + case 219: return emitShorthandPropertyAssignment(node); case 126: return emitComputedPropertyName(node); @@ -21729,8 +26447,8 @@ var ts; return emitWithStatement(node); case 188: return emitSwitchStatement(node); - case 213: case 214: + case 215: return emitCaseOrDefaultClause(node); case 189: return emitLabelledStatement(node); @@ -21738,7 +26456,7 @@ var ts; return emitThrowStatement(node); case 191: return emitTryStatement(node); - case 216: + case 217: return emitCatchClause(node); case 192: return emitDebuggerStatement(node); @@ -21750,18 +26468,18 @@ var ts; return emitInterfaceDeclaration(node); case 199: return emitEnumDeclaration(node); - case 219: + case 220: return emitEnumMember(node); case 200: return emitModuleDeclaration(node); - case 203: + case 204: return emitImportDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 209: + case 210: return emitExportDeclaration(node); - case 220: - return emitSourceFile(node); + case 221: + return emitSourceFileNode(node); } } function hasDetachedComments(pos) { @@ -21779,7 +26497,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 220 || node.pos !== node.parent.pos) { + if (node.parent.kind === 221 || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -21798,7 +26516,7 @@ var ts; } function emitTrailingDeclarationComments(node) { if (node.parent) { - if (node.parent.kind === 220 || node.end !== node.parent.end) { + if (node.parent.kind === 221 || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } @@ -21812,7 +26530,10 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, { + pos: pos, + end: pos + }, leadingComments); emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node) { @@ -21837,27 +26558,29 @@ var ts; if (nodeLine >= lastCommentLine + 2) { emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { + nodePos: node.pos, + detachedCommentEndPos: detachedComments[detachedComments.length - 1].end + }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; + detachedCommentsInfo = [ + currentDetachedCommentInfo + ]; } } } } } - function emitPinnedOrTripleSlashCommentsOfNode(node) { + function emitPinnedOrTripleSlashComments(node) { var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); function isPinnedOrTripleSlashComment(comment) { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { return true; } } @@ -21894,6 +26617,7 @@ var ts; (function (ts) { ts.emitTime = 0; ts.ioReadTime = 0; + ts.version = "1.5.0.0"; function createCompilerHost(options) { var currentDirectory; var existingDirectories = {}; @@ -21909,9 +26633,7 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText : e.message); } text = ""; } @@ -21947,12 +26669,20 @@ var ts; } return { getSourceFile: getSourceFile, - getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, + getDefaultLibFileName: function (options) { + return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); + }, writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, + getCurrentDirectory: function () { + return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); + }, + useCaseSensitiveFileNames: function () { + return ts.sys.useCaseSensitiveFileNames; + }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { + return ts.sys.newLine; + } }; } ts.createCompilerHost = createCompilerHost; @@ -21992,7 +26722,9 @@ var ts; var seenNoDefaultLib = options.noLib; var commonSourceDirectory; host = host || createCompilerHost(options); - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { + return processRootFile(name, false); + }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } @@ -22001,21 +26733,35 @@ var ts; var noDiagnosticsTypeChecker; program = { getSourceFile: getSourceFile, - getSourceFiles: function () { return files; }, - getCompilerOptions: function () { return options; }, + getSourceFiles: function () { + return files; + }, + getCompilerOptions: function () { + return options; + }, getSyntacticDiagnostics: getSyntacticDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getTypeChecker: getTypeChecker, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: function () { + return commonSourceDirectory; + }, emit: emit, getCurrentDirectory: host.getCurrentDirectory, - getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, - getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, - getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); } + getNodeCount: function () { + return getDiagnosticsProducingTypeChecker().getNodeCount(); + }, + getIdentifierCount: function () { + return getDiagnosticsProducingTypeChecker().getIdentifierCount(); + }, + getSymbolCount: function () { + return getDiagnosticsProducingTypeChecker().getSymbolCount(); + }, + getTypeCount: function () { + return getDiagnosticsProducingTypeChecker().getTypeCount(); + } }; return program; function getEmitHost(writeFileCallback) { @@ -22042,7 +26788,11 @@ var ts; } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + return { + diagnostics: [], + sourceMaps: undefined, + emitSkipped: true + }; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); @@ -22184,7 +26934,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 203 || node.kind === 202 || node.kind === 209) { + if (node.kind === 204 || node.kind === 203 || node.kind === 210) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22206,8 +26956,7 @@ var ts; } else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { - if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { + if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { @@ -22235,19 +26984,17 @@ var ts; } return; } - var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); + var firstExternalModuleSourceFile = ts.forEach(files, function (f) { + return ts.isExternalModule(f) ? f : undefined; + }); if (firstExternalModuleSourceFile && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } - if (options.outDir || - options.sourceRoot || - (options.mapRoot && - (!options.out || firstExternalModuleSourceFile !== undefined))) { + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + if (!(sourceFile.flags & 2048) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); sourcePathComponents.pop(); if (commonPathComponents) { @@ -22362,7 +27109,7 @@ var ts; } case 201: return spanInBlock(node); - case 216: + case 217: return spanInBlock(node.block); case 177: return textSpan(node.expression); @@ -22388,20 +27135,20 @@ var ts; return textSpan(node, ts.findNextToken(node.expression, node)); case 188: return textSpan(node, ts.findNextToken(node.expression, node)); - case 213: case 214: + case 215: return spanInNode(node.statements[0]); case 191: return spanInBlock(node.tryBlock); case 190: return textSpan(node, node.expression); - case 208: + case 209: return textSpan(node, node.expression); - case 202: - return textSpan(node, node.moduleReference); case 203: + return textSpan(node, node.moduleReference); + case 204: return textSpan(node, node.moduleSpecifier); - case 209: + case 210: return textSpan(node, node.moduleSpecifier); case 200: if (ts.getModuleInstanceState(node) !== 1) { @@ -22409,7 +27156,7 @@ var ts; } case 196: case 199: - case 219: + case 220: case 155: case 156: return textSpan(node); @@ -22443,7 +27190,7 @@ var ts; case 80: return spanInNextNode(node); default: - if (node.parent.kind === 217 && node.parent.name === node) { + if (node.parent.kind === 218 && node.parent.name === node) { return spanInNode(node.parent.initializer); } if (node.parent.kind === 158 && node.parent.type === node) { @@ -22456,17 +27203,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 182 || variableDeclaration.parent.parent.kind === 183) { return spanInNode(variableDeclaration.parent.parent); } var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; + var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.parent.initializer.declarations : undefined; if (variableDeclaration.initializer || (variableDeclaration.flags & 1)) { if (declarations && declarations[0] === variableDeclaration) { if (isParentVariableStatement) { @@ -22487,8 +27229,7 @@ var ts; } } function canHaveSpanInParameterDeclaration(parameter) { - return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16) || !!(parameter.flags & 32); + return !!parameter.initializer || parameter.dotDotDotToken !== undefined || !!(parameter.flags & 16) || !!(parameter.flags & 32); } function spanInParameterDeclaration(parameter) { if (canHaveSpanInParameterDeclaration(parameter)) { @@ -22506,8 +27247,7 @@ var ts; } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + return !!(functionDeclaration.flags & 1) || (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -22568,8 +27308,8 @@ var ts; case 196: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 188: - return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + case 202: + return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } @@ -22586,12 +27326,12 @@ var ts; if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 216: + case 217: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 188: - var switchStatement = node.parent; - var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + case 202: + var caseBlock = node.parent; + var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { return spanInNode(lastClause.statements[lastClause.statements.length - 1]); } @@ -22626,7 +27366,7 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 217) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { return spanInPreviousNode(node); } return spanInNode(node.parent); @@ -22681,14 +27421,7 @@ var ts; var parent = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent.kind === 179 || - parent.kind === 182 || - parent.kind === 183 || - parent.kind === 181 || - parent.kind === 178 || - parent.kind === 180 || - parent.kind === 187 || - parent.kind === 216) { + if (parent.kind === 179 || parent.kind === 182 || parent.kind === 183 || parent.kind === 181 || parent.kind === 178 || parent.kind === 180 || parent.kind === 187 || parent.kind === 217) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } @@ -22724,7 +27457,7 @@ var ts; case 197: case 199: case 152: - case 188: + case 202: var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); @@ -22775,7 +27508,13 @@ var ts; } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ + name: name, + fileName: fileName, + matchKind: matchKind, + isCaseSensitive: allMatchesAreCaseSensitive(matches), + declaration: declaration + }); } } }); @@ -22809,9 +27548,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || - node.kind === 8 || - node.kind === 7) { + if (node.kind === 64 || node.kind === 8 || node.kind === 7) { return node.text; } return undefined; @@ -22875,11 +27612,11 @@ var ts; } return bestMatchKind; } - var baseSensitivity = { sensitivity: "base" }; + var baseSensitivity = { + sensitivity: "base" + }; function compareNavigateToItems(i1, i2) { - return i1.matchKind - i2.matchKind || - i1.name.localeCompare(i2.name, undefined, baseSensitivity) || - i1.name.localeCompare(i2.name); + return i1.matchKind - i2.matchKind || i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); } function createNavigateToItem(rawItem) { var declaration = rawItem.declaration; @@ -22937,19 +27674,19 @@ var ts; case 149: ts.forEach(node.elements, visit); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { childNodes.push(importClause.namedBindings); } else { @@ -22969,9 +27706,9 @@ var ts; case 197: case 200: case 195: - case 202: - case 207: - case 211: + case 203: + case 208: + case 212: childNodes.push(node); break; } @@ -23029,7 +27766,9 @@ var ts; function isTopLevelFunctionDeclaration(functionDeclaration) { if (functionDeclaration.kind === 195) { if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { + return s.kind === 195 && !isEmpty(s.name.text); + })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23099,7 +27838,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 138: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 219: + case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 136: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -23138,16 +27877,18 @@ var ts; } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 211: - case 207: - case 202: - case 204: + case 212: + case 208: + case 203: case 205: + case 206: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; function createItem(node, name, scriptElementKind) { - return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); + return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ]); } } function isEmpty(text) { @@ -23172,7 +27913,7 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 220: + case 221: return createSourceFileItem(node); case 196: return createClassItem(node); @@ -23201,12 +27942,16 @@ var ts; function createModuleItem(node) { var moduleName = getModuleName(node); var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); - return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createFunctionItem(node) { if (node.name && node.body && node.body.kind === 174) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } return undefined; } @@ -23216,10 +27961,10 @@ var ts; return undefined; } hasGlobalNode = true; - var rootName = ts.isExternalModule(node) - ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" - : ""; - return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); + var rootName = ts.isExternalModule(node) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" : ""; + return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [ + getNodeSpan(node) + ], childItems); } function createClassItem(node) { if (!node.name) { @@ -23232,26 +27977,38 @@ var ts; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { - nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); + nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { + return !ts.isBindingPattern(p.name); + })); } var childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createIterfaceItem(node) { var childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { + return member.name === undefined || member.name.kind !== 126; + }); } function removeDynamicallyNamedProperties(node) { - return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); + return ts.filter(node.members, function (member) { + return !ts.hasDynamicName(member); + }); } function getInnermostModule(node) { while (node.body.kind === 200) { @@ -23260,9 +28017,7 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 220 - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); + return node.kind === 221 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -23292,7 +28047,9 @@ var ts; var stringToWordSpans = {}; pattern = pattern.trim(); var fullPatternSegment = createSegment(pattern); - var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); + var dotSeparatedSegments = pattern.split(".").map(function (p) { + return createSegment(p.trim()); + }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { getMatches: getMatches, @@ -23400,7 +28157,9 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [match]; + return [ + match + ]; } } var subWordTextChunks = segment.subWordTextChunks; @@ -23467,8 +28226,7 @@ var ts; for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { - if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || - !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { + if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; } } @@ -23489,10 +28247,7 @@ var ts; } ts.createPatternMatcher = createPatternMatcher; function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); + return compareType(match1, match2) || compareCamelCase(match1, match2) || compareCase(match1, match2) || comparePunctuation(match1, match2); } function comparePunctuation(result1, result2) { if (result1.punctuationStripped !== result2.punctuationStripped) { @@ -23641,11 +28396,7 @@ var ts; var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); var hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); - if (charIsPunctuation(identifier.charCodeAt(i - 1)) || - charIsPunctuation(identifier.charCodeAt(i)) || - lastIsDigit != currentIsDigit || - hasTransitionFromLowerToUpper || - hasTransitionFromUpperToLower) { + if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || lastIsDigit != currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { if (!isAllPunctuation(identifier, wordStart, i)) { result.push(ts.createTextSpan(wordStart, i - wordStart)); } @@ -23697,8 +28448,7 @@ var ts; } function transitionFromUpperToLower(identifier, word, index, wordStart) { if (word) { - if (index != wordStart && - index + 1 < identifier.length) { + if (index != wordStart && index + 1 < identifier.length) { var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { @@ -23716,9 +28466,7 @@ var ts; function transitionFromLowerToUpper(identifier, word, index) { var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - var transition = word - ? (currentIsUpper && !lastIsUpper) - : currentIsUpper; + var transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; return transition; } })(ts || (ts = {})); @@ -23748,8 +28496,7 @@ var ts; function getImmediatelyContainingArgumentInfo(node) { if (node.parent.kind === 155 || node.parent.kind === 156) { var callExpression = node.parent; - if (node.kind === 24 || - node.kind === 16) { + if (node.kind === 24 || node.kind === 16) { var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; ts.Debug.assert(list !== undefined); @@ -23758,15 +28505,15 @@ var ts; invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: 0, - argumentCount: getCommaBasedArgCount(list) + argumentCount: getArgumentCount(list) }; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { var list = listItemInfo.list; var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1; - var argumentCount = getCommaBasedArgCount(list); + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: isTypeArgList ? 0 : 1, @@ -23803,10 +28550,29 @@ var ts; } return undefined; } - function getCommaBasedArgCount(argumentsList) { - return argumentsList.getChildCount() === 0 - ? 0 - : 1 + ts.countWhere(argumentsList.getChildren(), function (arg) { return arg.kind === 23; }); + function getArgumentIndex(argumentsList, node) { + var argumentIndex = 0; + var listChildren = argumentsList.getChildren(); + for (var i = 0, n = listChildren.length; i < n; i++) { + var child = listChildren[i]; + if (child === node) { + break; + } + if (child.kind !== 23) { + argumentIndex++; + } + } + return argumentIndex; + } + function getArgumentCount(argumentsList) { + var listChildren = argumentsList.getChildren(); + var argumentCount = ts.countWhere(listChildren, function (arg) { + return arg.kind !== 23; + }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { + argumentCount++; + } + return argumentCount; } function getArgumentIndexForTemplatePiece(spanIndex, node) { ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); @@ -23819,9 +28585,7 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - var argumentCount = tagExpression.template.kind === 10 - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = tagExpression.template.kind === 10 ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: 2, @@ -23849,7 +28613,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 220; n = n.parent) { + for (var n = node; n.kind !== 221; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -23926,7 +28690,10 @@ var ts; isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23), ts.spacePart()], + separatorDisplayParts: [ + ts.punctuationPart(23), + ts.spacePart() + ], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; @@ -24035,24 +28802,31 @@ var ts; } ts.findListItemInfo = findListItemInfo; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.forEach(n.getChildren(sourceFile), function (c) { + return c.kind === kind && c; + }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 221 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { return c; } }); + ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; } ts.findContainingList = findContainingList; function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isWord(n.kind); + }); } ts.getTouchingWord = getTouchingWord; function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isPropertyName(n.kind); + }); } ts.getTouchingPropertyName = getTouchingPropertyName; function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { @@ -24106,8 +28880,7 @@ var ts; var children = n.getChildren(); for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || - (child.pos === previousToken.end); + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -24145,7 +28918,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 220); + ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -24210,8 +28983,7 @@ var ts; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { - return ts.isTemplateLiteralKind(node.kind) - && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); + return ts.isTemplateLiteralKind(node.kind) && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function compareDataObjects(dst, src) { @@ -24244,19 +29016,38 @@ var ts; var indent; resetWriter(); return { - displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + displayParts: function () { + return displayParts; + }, + writeKeyword: function (text) { + return writeKind(text, 5); + }, + writeOperator: function (text) { + return writeKind(text, 12); + }, + writePunctuation: function (text) { + return writeKind(text, 15); + }, + writeSpace: function (text) { + return writeKind(text, 16); + }, + writeStringLiteral: function (text) { + return writeKind(text, 8); + }, + writeParameter: function (text) { + return writeKind(text, 13); + }, writeSymbol: writeSymbol, writeLine: writeLine, - increaseIndent: function () { indent++; }, - decreaseIndent: function () { indent--; }, + increaseIndent: function () { + indent++; + }, + decreaseIndent: function () { + indent--; + }, clear: resetWriter, - trackSymbol: function () { } + trackSymbol: function () { + } }; function writeIndent() { if (lineStart) { @@ -24410,7 +29201,9 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, + lastTrailingTriviaWasNewLine: function () { + return wasNewLine; + }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -24471,8 +29264,7 @@ var ts; return container.kind === 9; } function shouldRescanTemplateToken(container) { - return container.kind === 12 || - container.kind === 13; + return container.kind === 12 || container.kind === 13; } function startsWithSlashToken(t) { return t === 36 || t === 56; @@ -24485,13 +29277,7 @@ var ts; token: undefined }; } - var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 - : shouldRescanSlashToken(n) - ? 2 - : shouldRescanTemplateToken(n) - ? 3 - : 0; + var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 : shouldRescanSlashToken(n) ? 2 : shouldRescanTemplateToken(n) ? 3 : 0; if (lastTokenInfo && expectedScanAction === lastScanAction) { return fixTokenKind(lastTokenInfo, n); } @@ -24645,6 +29431,7 @@ var ts; formatting.FormattingContext = FormattingContext; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -24657,15 +29444,14 @@ var ts; this.Flag = Flag; } Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + - "operation=" + this.Operation + "," + - "flag=" + this.Flag + "]"; + return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; }; return Rule; })(); formatting.Rule = Rule; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -24676,8 +29462,7 @@ var ts; this.RightTokenRange = RightTokenRange; } RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + - "rightRange=" + this.RightTokenRange + "]"; + return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; }; RuleDescriptor.create1 = function (left, right) { return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); @@ -24696,6 +29481,7 @@ var ts; formatting.RuleDescriptor = RuleDescriptor; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); +/// var ts; (function (ts) { var formatting; @@ -24706,8 +29492,7 @@ var ts; this.Action = null; } RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + - "action=" + this.Action + "]"; + return "[context=" + this.Context + "," + "action=" + this.Action + "]"; }; RuleOperation.create1 = function (action) { return RuleOperation.create2(formatting.RuleOperationContext.Any, action); @@ -24773,7 +29558,12 @@ var ts; this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([ + 17, + 19, + 23, + 22 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -24782,9 +29572,19 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 64, + 3 + ]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 17, + 3, + 74, + 95, + 80, + 75 + ]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -24803,79 +29603,151 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 97, + 93, + 87, + 73, + 89, + 96 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 104, + 69 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); - this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 17, + 74, + 75, + 66 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 95, + 80 + ]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 115, + 119 + ]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 116, + 117 + ]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 68, + 114, + 76, + 77, + 78, + 115, + 102, + 84, + 103, + 116, + 106, + 108, + 119, + 109 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([ + 78, + 102 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([ + 17, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([ + 16, + 18, + 25, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, this.SpaceBetweenCloseBraceAndElse, this.SpaceBetweenCloseBraceAndWhile, this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, this.NewLineAfterOpenBraceInBlockContext, this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.SpaceAfterLetConstInVariableDeclaration, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, + this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, + this.SpaceAfterColon, + this.NoSpaceBeforeQuestionMark, + this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, + this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, + this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, + this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, + this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, + this.SpaceAfterSubtractWhenFollowedByPredecrement, + this.NoSpaceAfterCloseBrace, + this.SpaceAfterOpenBrace, + this.SpaceBeforeCloseBrace, + this.NewLineBeforeCloseBraceInBlockContext, + this.SpaceAfterCloseBrace, + this.SpaceBetweenCloseBraceAndElse, + this.SpaceBetweenCloseBraceAndWhile, + this.NoSpaceBetweenEmptyBraceBrackets, + this.SpaceAfterFunctionInFuncDecl, + this.NewLineAfterOpenBraceInBlockContext, + this.SpaceAfterGetSetInMember, + this.NoSpaceBetweenReturnAndSemicolon, + this.SpaceAfterCertainKeywords, + this.SpaceAfterLetConstInVariableDeclaration, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, + this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.NoSpaceAfterConstructor, + this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, + this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, + this.SpaceBeforeOpenBraceInFunction, + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterOpenBracket, + this.NoSpaceBeforeCloseBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, + this.SpaceAfterTryFinally + ]; this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); @@ -24917,10 +29789,10 @@ var ts; case 167: case 168: return true; - case 202: + case 203: case 193: case 128: - case 219: + case 220: case 130: case 129: return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; @@ -24963,7 +29835,7 @@ var ts; } switch (node.kind) { case 174: - case 188: + case 202: case 152: case 201: return true; @@ -25006,7 +29878,7 @@ var ts; case 200: case 199: case 174: - case 216: + case 217: case 201: case 188: return true; @@ -25024,7 +29896,7 @@ var ts; case 191: case 179: case 187: - case 216: + case 217: return true; default: return false; @@ -25049,8 +29921,7 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && - context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 194 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; @@ -25084,8 +29955,7 @@ var ts; } }; Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; @@ -25128,8 +29998,7 @@ var ts; }; RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && - rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; + var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); @@ -25203,19 +30072,13 @@ var ts; RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { var position; if (rule.Operation.Action == 1) { - position = specificTokens ? - 0 : - RulesPosition.IgnoreRulesAny; + position = specificTokens ? 0 : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? - RulesPosition.ContextRulesSpecific : - RulesPosition.ContextRulesAny; + position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; } else { - position = specificTokens ? - RulesPosition.NoContextRulesSpecific : - RulesPosition.NoContextRulesAny; + position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; } var state = constructionState[rulesBucketIndex]; if (state === undefined) { @@ -25272,7 +30135,9 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; + return [ + this.token + ]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -25326,18 +30191,68 @@ var ts; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([ + 3 + ])); TokenRange.Keywords = TokenRange.FromRange(65, 124); TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([64, 118, 120, 112, 121, 98, 111]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([ + 85, + 86, + 124 + ]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([ + 38, + 39, + 47, + 46 + ]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([ + 7, + 64, + 16, + 18, + 14, + 92, + 87 + ]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.Comments = TokenRange.FromTokens([ + 2, + 3 + ]); + TokenRange.TypeNames = TokenRange.FromTokens([ + 64, + 118, + 120, + 112, + 121, + 98, + 111 + ]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -25482,16 +30397,11 @@ var ts; } function findOutermostParent(position, expectedTokenKind, sourceFile) { var precedingToken = ts.findPrecedingToken(position, sourceFile); - if (!precedingToken || - precedingToken.kind !== expectedTokenKind || - position !== precedingToken.getEnd()) { + if (!precedingToken || precedingToken.kind !== expectedTokenKind || position !== precedingToken.getEnd()) { return undefined; } var current = precedingToken; - while (current && - current.parent && - current.parent.end === precedingToken.end && - !isListElement(current.parent, current)) { + while (current && current.parent && current.parent.end === precedingToken.end && !isListElement(current.parent, current)) { current = current.parent; } return current; @@ -25504,11 +30414,11 @@ var ts; case 200: var body = parent.body; return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 220: + case 221: case 174: case 201: return ts.rangeContainsRange(parent.statements, node); - case 216: + case 217: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -25516,7 +30426,9 @@ var ts; function findEnclosingNode(range, sourceFile) { return find(sourceFile); function find(n) { - var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); + var candidate = ts.forEachChild(n, function (c) { + return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; + }); if (candidate) { var result = find(candidate); if (result) { @@ -25530,9 +30442,11 @@ var ts; if (!errors.length) { return rangeHasNoErrors; } - var sorted = errors - .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) - .sort(function (e1, e2) { return e1.start - e2.start; }); + var sorted = errors.filter(function (d) { + return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); + }).sort(function (e1, e2) { + return e1.start - e2.start; + }); if (!sorted.length) { return rangeHasNoErrors; } @@ -25626,10 +30540,7 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || - parent.kind === 220 || - parent.kind === 213 || - parent.kind === 214) { + if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -25678,8 +30589,12 @@ var ts; return nodeStartLine !== line ? indentation + delta : indentation; } }, - getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getIndentation: function () { + return indentation; + }, + getDelta: function () { + return delta; + }, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { if (lineAdded) { @@ -25872,8 +30787,7 @@ var ts; trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } else { - lineAdded = - processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + lineAdded = processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); } } previousRange = range; @@ -25901,9 +30815,7 @@ var ts; dynamicIndentation.recomputeIndentation(true); } } - trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + trimTrailingWhitespaces = (rule.Operation.Action & (4 | 2)) && rule.Flag !== 1; } else { trimTrailingWhitespaces = true; @@ -25940,10 +30852,16 @@ var ts; var startPos = commentRange.pos; for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); - parts.push({ pos: startPos, end: endOfLine }); + parts.push({ + pos: startPos, + end: endOfLine + }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } - parts.push({ pos: startPos, end: commentRange.end }); + parts.push({ + pos: startPos, + end: commentRange.end + }); } var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); @@ -25958,9 +30876,7 @@ var ts; var delta = indentation - nonWhitespaceColumnInFirstPart.column; for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceCharacterAndColumn = i === 0 - ? nonWhitespaceColumnInFirstPart - : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); + var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); @@ -25989,7 +30905,10 @@ var ts; } } function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; + return { + span: ts.createTextSpan(start, len), + newText: newText + }; } function recordDelete(start, len) { if (len) { @@ -26139,12 +31058,7 @@ var ts; if (!precedingToken) { return 0; } - var precedingTokenIsLiteral = precedingToken.kind === 8 || - precedingToken.kind === 9 || - precedingToken.kind === 10 || - precedingToken.kind === 11 || - precedingToken.kind === 12 || - precedingToken.kind === 13; + var precedingTokenIsLiteral = precedingToken.kind === 8 || precedingToken.kind === 9 || precedingToken.kind === 10 || precedingToken.kind === 11 || precedingToken.kind === 12 || precedingToken.kind === 13; if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } @@ -26204,8 +31118,7 @@ var ts; } } parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); if (actualIndentation !== -1) { @@ -26238,8 +31151,7 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 220 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26279,8 +31191,7 @@ var ts; if (node.parent) { switch (node.parent.kind) { case 139: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; @@ -26296,8 +31207,7 @@ var ts; case 136: case 137: var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { + if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { return node.parent.typeParameters; } if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { @@ -26307,12 +31217,10 @@ var ts; case 156: case 155: var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { + if (node.parent.arguments && ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -26364,7 +31272,10 @@ var ts; } character++; } - return { column: column, character: character }; + return { + column: column, + character: character + }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -26381,15 +31292,15 @@ var ts; case 201: case 152: case 143: - case 188: + case 202: + case 215: case 214: - case 213: case 159: case 155: case 156: case 175: case 193: - case 208: + case 209: case 186: case 168: return true; @@ -26445,9 +31356,9 @@ var ts; case 152: case 174: case 201: - case 188: + case 202: return nodeEndsWith(n, 15, sourceFile); - case 216: + case 217: return isCompletedNode(n.block, sourceFile); case 159: case 136: @@ -26471,9 +31382,15 @@ var ts; return isCompletedNode(n.expression, sourceFile); case 151: return nodeEndsWith(n, 19, sourceFile); - case 213: case 214: + case 215: return false; + case 181: + return isCompletedNode(n.statement, sourceFile); + case 182: + return isCompletedNode(n.statement, sourceFile); + case 183: + return isCompletedNode(n.statement, sourceFile); case 180: return isCompletedNode(n.statement, sourceFile); case 179: @@ -26572,7 +31489,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(221, nodes.pos, nodes.end, 1024, this); + var list = createNode(222, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -26741,10 +31658,7 @@ var ts; return pos; } function isName(pos, end, sourceFile, name) { - return pos + name.length < end && - sourceFile.text.substr(pos, name.length) === name && - (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || - ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); + return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { return isName(pos, end, sourceFile, paramTag); @@ -26960,7 +31874,9 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([ + this.declaration + ], undefined, false) : []; } return this.documentationComment; }; @@ -26994,9 +31910,7 @@ var ts; case 131: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; + var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; @@ -27013,12 +31927,12 @@ var ts; case 198: case 199: case 200: - case 202: - case 211: - case 207: - case 202: - case 204: + case 203: + case 212: + case 208: + case 203: case 205: + case 206: case 134: case 135: case 143: @@ -27048,24 +31962,24 @@ var ts; ts.forEachChild(node.name, visit); break; } - case 219: + case 220: case 130: case 129: namedDeclarations.push(node); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27194,7 +32108,9 @@ var ts; ts.ClassificationTypeNames = ClassificationTypeNames; function displayPartsToString(displayParts) { if (displayParts) { - return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); + return ts.map(displayParts, function (displayPart) { + return displayPart.text; + }).join(""); } return ""; } @@ -27211,7 +32127,7 @@ var ts; return false; } for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 220 || parent.kind === 201) { + if (parent.kind === 221 || parent.kind === 201) { return false; } } @@ -27371,7 +32287,9 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { + return name && name.charAt(0) === '_'; + }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; for (var i in entries) { @@ -27382,7 +32300,9 @@ var ts; references: entry.owners.slice(0) }); } - sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; }); + sourceFiles.sort(function (x, y) { + return y.refCount - x.refCount; + }); return { bucket: name, sourceFiles: sourceFiles @@ -27571,7 +32491,11 @@ var ts; processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { + referencedFiles: referencedFiles, + importedFiles: importedFiles, + isLibFile: isNoDefaultLib + }; } ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { @@ -27584,14 +32508,10 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && - node.parent.label === node; + return node.kind === 64 && (node.parent.kind === 185 || node.parent.kind === 184) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && - node.parent.label === node; + return node.kind === 64 && node.parent.kind === 189 && node.parent.label === node; } function isLabeledBy(node, labelName) { for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { @@ -27626,20 +32546,18 @@ var ts; return node.parent.kind === 200 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && - ts.isFunctionLike(node.parent) && node.parent.name === node; + return node.kind === 64 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 217 || node.parent.kind === 218) && node.parent.name === node; + return (node.kind === 64 || node.kind === 8 || node.kind === 7) && (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { case 130: case 129: - case 217: - case 219: + case 218: + case 220: case 132: case 131: case 134: @@ -27654,15 +32572,12 @@ var ts; } function isNameOfExternalModuleImportOrDeclaration(node) { if (node.kind === 8) { - return isNameOfModuleDeclaration(node) || - (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); + return isNameOfModuleDeclaration(node) || (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); } return false; } function isInsideComment(sourceFile, token, position) { - return position <= token.getStart(sourceFile) && - (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || - isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments) { return ts.forEach(comments, function (comment) { if (comment.pos < position && position < comment.end) { @@ -27675,8 +32590,7 @@ var ts; return true; } else { - return !(text.charCodeAt(comment.end - 1) === 47 && - text.charCodeAt(comment.end - 2) === 42); + return !(text.charCodeAt(comment.end - 1) === 47 && text.charCodeAt(comment.end - 2) === 42); } } return false; @@ -27698,7 +32612,7 @@ var ts; return undefined; } switch (node.kind) { - case 220: + case 221: case 132: case 131: case 195: @@ -27716,38 +32630,49 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; + case 200: + return ScriptElementKind.moduleElement; + case 196: + return ScriptElementKind.classElement; + case 197: + return ScriptElementKind.interfaceElement; + case 198: + return ScriptElementKind.typeElement; + case 199: + return ScriptElementKind.enumElement; case 193: - return ts.isConst(node) - ? ScriptElementKind.constElement - : ts.isLet(node) - ? ScriptElementKind.letElement - : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; + case 195: + return ScriptElementKind.functionElement; + case 134: + return ScriptElementKind.memberGetAccessorElement; + case 135: + return ScriptElementKind.memberSetAccessorElement; case 132: case 131: return ScriptElementKind.memberFunctionElement; case 130: case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 219: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 202: - case 207: - case 204: - case 211: + case 138: + return ScriptElementKind.indexSignatureElement; + case 137: + return ScriptElementKind.constructSignatureElement; + case 136: + return ScriptElementKind.callSignatureElement; + case 133: + return ScriptElementKind.constructorImplementationElement; + case 127: + return ScriptElementKind.typeParameterElement; + case 220: + return ScriptElementKind.variableElement; + case 128: + return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 203: + case 208: case 205: + case 212: + case 206: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -27798,13 +32723,26 @@ var ts; var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, - getCancellationToken: function () { return cancellationToken; }, - getCanonicalFileName: function (fileName) { return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); }, - useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return host.getNewLine ? host.getNewLine() : "\r\n"; }, - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: function (fileName, data, writeByteOrderMark) { }, - getCurrentDirectory: function () { return host.getCurrentDirectory(); } + getCancellationToken: function () { + return cancellationToken; + }, + getCanonicalFileName: function (fileName) { + return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); + }, + useCaseSensitiveFileNames: function () { + return useCaseSensitivefileNames; + }, + getNewLine: function () { + return host.getNewLine ? host.getNewLine() : "\r\n"; + }, + getDefaultLibFileName: function (options) { + return host.getDefaultLibFileName(options); + }, + writeFile: function (fileName, data, writeByteOrderMark) { + }, + getCurrentDirectory: function () { + return host.getCurrentDirectory(); + } }); if (program) { var oldSourceFiles = program.getSourceFiles(); @@ -27891,8 +32829,7 @@ var ts; if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { return undefined; } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 || firstCharCode === 34)) { displayName = displayName.substring(1, displayName.length - 1); } var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); @@ -28008,11 +32945,11 @@ var ts; getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); } } - else if (ts.getAncestor(previousToken, 204)) { + else if (ts.getAncestor(previousToken, 205)) { isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 203); + var importDeclaration = ts.getAncestor(previousToken, 204); ts.Debug.assert(importDeclaration !== undefined); var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); var filteredExports = filterModuleExports(exports, importDeclaration); @@ -28053,16 +32990,14 @@ var ts; } function isCompletionListBlocker(previousToken) { var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || - isIdentifierDefinitionLocation(previousToken) || - isRightOfIllegalDot(previousToken); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 206; + return node.parent.kind === 207; } } return false; @@ -28072,16 +33007,9 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 151 || containingNodeKind === 167; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 159; case 18: return containingNodeKind === 151; case 116: @@ -28091,8 +33019,7 @@ var ts; case 14: return containingNodeKind === 196; case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 193 || containingNodeKind === 167; case 11: return containingNodeKind === 169; case 12: @@ -28112,9 +33039,7 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 - || previousToken.kind === 9 - || ts.isTemplateLiteralKind(previousToken.kind)) { + if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); if (start < position && position < end) { @@ -28161,43 +33086,23 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || - containingNodeKind === 199 || - isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + return containingNodeKind === 193 || containingNodeKind === 194 || containingNodeKind === 175 || containingNodeKind === 199 || isFunction(containingNodeKind) || containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || containingNodeKind === 149 || containingNodeKind === 148; case 20: return containingNodeKind === 149; case 18: return containingNodeKind === 149; case 16: - return containingNodeKind === 216 || - isFunction(containingNodeKind); + return containingNodeKind === 217 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 199 || containingNodeKind === 197 || containingNodeKind === 143 || containingNodeKind === 148; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 129 && (previousToken.parent.parent.kind === 197 || previousToken.parent.parent.kind === 143); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - isFunction(containingNodeKind); + return containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || isFunction(containingNodeKind); case 109: return containingNodeKind === 130; case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); + return containingNodeKind === 128 || containingNodeKind === 133 || (previousToken.parent.parent.kind === 149); case 108: case 106: case 107: @@ -28242,8 +33147,7 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 206) { + if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -28252,7 +33156,9 @@ var ts; if (ts.isEmpty(exisingImports)) { return exports; } - return ts.filter(exports, function (e) { return !ts.lookUp(exisingImports, e.name); }); + return ts.filter(exports, function (e) { + return !ts.lookUp(exisingImports, e.name); + }); } function filterContextualMembersList(contextualMemberSymbols, existingMembers) { if (!existingMembers || existingMembers.length === 0) { @@ -28260,7 +33166,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 217 && m.kind !== 218) { + if (m.kind !== 218 && m.kind !== 219) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28302,7 +33208,9 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ + ts.displayPart(entryName, 5) + ], documentation: undefined }; } @@ -28400,9 +33308,7 @@ var ts; return ScriptElementKind.unknown; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 - ? ts.getNodeModifiers(symbol.declarations[0]) - : ScriptElementKindModifier.none; + return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } @@ -28485,8 +33391,7 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { var signature; var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); @@ -28501,8 +33406,7 @@ var ts; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; @@ -28578,7 +33482,7 @@ var ts; if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 219) { + if (declaration.kind === 220) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -28594,7 +33498,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202) { + if (declaration.kind === 203) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -28622,9 +33526,7 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 || - symbolKind === ScriptElementKind.localVariableElement) { + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 || symbolKind === ScriptElementKind.localVariableElement) { displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (type.symbol && type.symbol.flags & 262144) { @@ -28637,12 +33539,7 @@ var ts; displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 || - symbolFlags & 8192 || - symbolFlags & 16384 || - symbolFlags & 131072 || - symbolFlags & 98304 || - symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 || symbolFlags & 8192 || symbolFlags & 16384 || symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -28655,7 +33552,11 @@ var ts; if (!documentation) { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { + displayParts: displayParts, + documentation: documentation, + symbolKind: symbolKind + }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -28742,20 +33643,26 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [ + getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined) + ] : undefined; } - var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); + var comment = ts.forEach(sourceFile.referencedFiles, function (r) { + return (r.pos <= position && position < r.end) ? r : undefined; + }); if (comment) { var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); if (referenceFile) { - return [{ + return [ + { fileName: referenceFile.fileName, textSpan: ts.createTextSpanFromBounds(0, 0), kind: ScriptElementKind.scriptElement, name: comment.fileName, containerName: undefined, containerKind: undefined - }]; + } + ]; } return undefined; } @@ -28770,7 +33677,7 @@ var ts; } } var result = []; - if (node.parent.kind === 218) { + if (node.parent.kind === 219) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); @@ -28786,8 +33693,7 @@ var ts; var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); var containerSymbol = symbol.parent; var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); @@ -28807,8 +33713,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { declarations.push(d); if (d.body) definition = d; @@ -28848,9 +33753,10 @@ var ts; if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + if (node.kind === 64 || node.kind === 92 || node.kind === 90 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return getReferencesForNode(node, [ + sourceFile + ], true, false, false); } switch (node.kind) { case 83: @@ -28887,8 +33793,8 @@ var ts; break; case 66: case 72: - if (hasKind(parent(parent(node)), 188)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent); + if (hasKind(parent(parent(parent(node))), 188)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 65: @@ -28898,9 +33804,7 @@ var ts; } break; case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + if (hasKind(node.parent, 181) || hasKind(node.parent, 182) || hasKind(node.parent, 183)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -28921,8 +33825,7 @@ var ts; return getGetAndSetOccurrences(node.parent); } default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + if (ts.isModifier(node.kind) && node.parent && (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -29031,7 +33934,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 220) { + if (ts.isFunctionBlock(parent) || parent.kind === 221) { return parent; } if (parent.kind === 191) { @@ -29079,7 +33982,7 @@ var ts; function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); - ts.forEach(switchStatement.clauses, function (clause) { + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { @@ -29167,15 +34070,16 @@ var ts; function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { + return pushKeywordIf(keywords, child, 115, 119); + }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (!(container.kind === 196 || (declaration.kind === 128 && hasKind(container, 133)))) { return undefined; } } @@ -29185,7 +34089,7 @@ var ts; } } else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 220)) { + if (!(container.kind === 201 || container.kind === 221)) { return undefined; } } @@ -29197,7 +34101,7 @@ var ts; var nodes; switch (container.kind) { case 201: - case 220: + case 221: nodes = container.statements; break; case 133: @@ -29219,7 +34123,9 @@ var ts; } ts.forEach(nodes, function (node) { if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + ts.forEach(node.modifiers, function (child) { + return pushKeywordIf(keywords, child, modifier); + }); } }); return ts.map(keywords, getReferenceEntryFromNode); @@ -29273,9 +34179,7 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 64 && - !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && - !isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind !== 64 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); @@ -29285,7 +34189,9 @@ var ts; if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [ + getReferenceEntryFromNode(node) + ]; } else { return getLabelReferencesInNode(node.parent, node); @@ -29299,7 +34205,9 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return [ + getReferenceEntryFromNode(node) + ]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -29333,17 +34241,17 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && - (location.parent.kind === 207 || location.parent.kind === 211) && - location.parent.propertyName === location; + return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 207 || declaration.kind === 211; + return declaration.kind === 208 || declaration.kind === 212; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29357,7 +34265,9 @@ var ts; if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29376,7 +34286,9 @@ var ts; } function getSymbolScope(symbol) { if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { + return (d.flags & 32) ? d : undefined; + }); if (privateDeclaration) { return ts.getAncestor(privateDeclaration, 196); } @@ -29398,7 +34310,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 220 && !ts.isExternalModule(container)) { + if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -29420,8 +34332,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -29439,8 +34350,7 @@ var ts; if (!node || node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || - (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { result.push(getReferenceEntryFromNode(node)); } }); @@ -29452,8 +34362,7 @@ var ts; case 64: return node.getWidth() === searchSymbolName.length; case 8: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { return node.getWidth() === searchSymbolName.length + 2; } break; @@ -29476,8 +34385,7 @@ var ts; cancellationToken.throwIfCancellationRequested(); var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); if (!isValidReferencePosition(referenceLocation, searchText)) { - if ((findInStrings && isInString(position)) || - (findInComments && isInComment(position))) { + if ((findInStrings && isInString(position)) || (findInComments && isInComment(position))) { result.push({ fileName: sourceFile.fileName, textSpan: ts.createTextSpan(position, searchText.length), @@ -29575,7 +34483,7 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 220: + case 221: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } @@ -29586,7 +34494,7 @@ var ts; return undefined; } var result = []; - if (searchSpaceNode.kind === 220) { + if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -29624,8 +34532,8 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 220: - if (container.kind === 220 && !ts.isExternalModule(container)) { + case 221: + if (container.kind === 221 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -29634,7 +34542,9 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [symbol]; + var result = [ + symbol + ]; if (isImportOrExportSpecifierImportSymbol(symbol)) { result.push(typeInfoResolver.getAliasedSymbol(symbol)); } @@ -29687,13 +34597,14 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return true; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { + if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { return true; } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { + return searchSymbols.indexOf(s) >= 0; + }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { @@ -29703,7 +34614,9 @@ var ts; if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { var result = []; getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); - return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(result, function (s) { + return searchSymbols.indexOf(s) >= 0; + }); } return false; }); @@ -29717,7 +34630,9 @@ var ts; if (contextualType.flags & 16384) { var unionProperty = contextualType.getProperty(name); if (unionProperty) { - return [unionProperty]; + return [ + unionProperty + ]; } else { var result = []; @@ -29733,7 +34648,9 @@ var ts; else { var symbol = contextualType.getProperty(name); if (symbol) { - return [symbol]; + return [ + symbol + ]; } } } @@ -29789,7 +34706,9 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { + return diagnostic.category === 1; + }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -29815,9 +34734,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 133: @@ -29826,7 +34745,7 @@ var ts; case 195: case 160: case 161: - case 216: + case 217: return 1; case 127: case 197: @@ -29846,14 +34765,14 @@ var ts; else { return 4; } - case 206: case 207: - case 202: - case 203: case 208: + case 203: + case 204: case 209: + case 210: return 1 | 2 | 4; - case 220: + case 221: return 4 | 1; } return 1 | 2 | 4; @@ -29883,15 +34802,13 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && - node.parent.right === node && - node.parent.parent.kind === 202) { + if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 208) { + if (node.parent.kind === 209) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -29944,8 +34861,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && - nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 200 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { @@ -29992,8 +34908,7 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || - (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -30118,16 +35033,11 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (token.parent.kind === 193 || token.parent.kind === 130 || token.parent.kind === 128) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 167 || token.parent.kind === 165 || token.parent.kind === 166 || token.parent.kind === 168) { return ClassificationTypeNames.operator; } } @@ -30225,14 +35135,22 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 14: return 15; - case 16: return 17; - case 18: return 19; - case 24: return 25; - case 15: return 14; - case 17: return 16; - case 19: return 18; - case 25: return 24; + case 14: + return 15; + case 16: + return 17; + case 18: + return 19; + case 24: + return 25; + case 15: + return 14; + case 17: + return 16; + case 19: + return 18; + case 25: + return 24; } return undefined; } @@ -30313,7 +35231,9 @@ var ts; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { + return "(" + escapeRegExp(d.text) + ")"; + }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; @@ -30321,9 +35241,7 @@ var ts; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { - return (char >= 97 && char <= 122) || - (char >= 65 && char <= 90) || - (char >= 48 && char <= 57); + return (char >= 97 && char <= 122) || (char >= 65 && char <= 90) || (char >= 48 && char <= 57); } } function getRenameInfo(fileName, position) { @@ -30424,9 +35342,7 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || - node.parent.kind === 212 || - isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -30436,10 +35352,7 @@ var ts; } } function isArgumentOfElementAccessExpression(node) { - return node && - node.parent && - node.parent.kind === 154 && - node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 154 && node.parent.argumentExpression === node; } function createClassifier() { var scanner = ts.createScanner(2, false); @@ -30468,10 +35381,7 @@ var ts; } function canFollow(keyword1, keyword2) { if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (keyword2 === 115 || keyword2 === 119 || keyword2 === 113 || keyword2 === 109) { return true; } return false; @@ -30529,18 +35439,13 @@ var ts; else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { token = 64; } - else if (lastNonTriviaToken === 64 && - token === 24) { + else if (lastNonTriviaToken === 64 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 111 || token === 120 || token === 118 || token === 112 || token === 121) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 64; } @@ -30591,9 +35496,7 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 - ? 3 - : 2; + result.finalLexState = quoteChar === 34 ? 3 : 2; } } } @@ -30625,7 +35528,10 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ length: length, classification: classification }); + result.entries.push({ + length: length, + classification: classification + }); } } } @@ -30720,7 +35626,9 @@ var ts; return 5; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine + }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -30735,7 +35643,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 220 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -30744,9 +35652,15 @@ var ts; Node.prototype = proto; return Node; }, - getSymbolConstructor: function () { return SymbolObject; }, - getTypeConstructor: function () { return TypeObject; }, - getSignatureConstructor: function () { return SignatureObject; } + getSymbolConstructor: function () { + return SymbolObject; + }, + getTypeConstructor: function () { + return TypeObject; + }, + getSignatureConstructor: function () { + return SignatureObject; + } }; } initializeServices(); @@ -30827,7 +35741,9 @@ var ts; return this.compilationSettings; }; LSHost.prototype.getScriptFileNames = function () { - return this.roots.map(function (root) { return root.fileName; }); + return this.roots.map(function (root) { + return root.fileName; + }); }; LSHost.prototype.getScriptVersion = function (filename) { return this.getScriptInfo(filename).svc.latestVersion().toString(); @@ -30920,7 +35836,10 @@ var ts; var script = this.filenameToScript[filename]; var index = script.snap().index; var lineCol = index.charOffsetToLineNumberAndPos(position); - return { line: lineCol.line, col: lineCol.col + 1 }; + return { + line: lineCol.line, + col: lineCol.col + 1 + }; }; return LSHost; })(); @@ -30998,7 +35917,9 @@ var ts; }; Project.prototype.filesToString = function () { var strBuilder = ""; - ts.forEachValue(this.filenameToSourceFile, function (sourceFile) { strBuilder += sourceFile.fileName + "\n"; }); + ts.forEachValue(this.filenameToSourceFile, function (sourceFile) { + strBuilder += sourceFile.fileName + "\n"; + }); return strBuilder; }; Project.prototype.setProjectOptions = function (projectOptions) { @@ -31095,8 +36016,7 @@ var ts; for (var i = 0, len = this.openFileRoots.length; i < len; i++) { var r = this.openFileRoots[i]; if (info.defaultProject.getSourceFile(r)) { - this.inferredProjects = - copyListRemovingItem(r.defaultProject, this.inferredProjects); + this.inferredProjects = copyListRemovingItem(r.defaultProject, this.inferredProjects); this.openFilesReferenced.push(r); r.defaultProject = info.defaultProject; } @@ -31218,7 +36138,9 @@ var ts; info = new ScriptInfo(this.host, fileName, content, openedByClient); this.filenameToScriptInfo[fileName] = info; if (!info.isOpen) { - info.fileWatcher = this.host.watchFile(fileName, function (_) { _this.watchedFileChanged(fileName); }); + info.fileWatcher = this.host.watchFile(fileName, function (_) { + _this.watchedFileChanged(fileName); + }); } } } @@ -31300,12 +36222,16 @@ var ts; var dirPath = ts.getDirectoryPath(configFilename); var rawConfig = ts.readConfigFile(configFilename); if (!rawConfig) { - return { errorMsg: "tsconfig syntax error" }; + return { + errorMsg: "tsconfig syntax error" + }; } else { var parsedCommandLine = ts.parseConfigFile(rawConfig); if (parsedCommandLine.errors) { - return { errorMsg: "tsconfig option errors" }; + return { + errorMsg: "tsconfig option errors" + }; } else if (parsedCommandLine.fileNames) { var proj = this.createProject(configFilename); @@ -31318,7 +36244,9 @@ var ts; proj.addRoot(info); } else { - return { errorMsg: "specified file " + rootFilename + " not found" }; + return { + errorMsg: "specified file " + rootFilename + " not found" + }; } } var projectOptions = { @@ -31329,10 +36257,15 @@ var ts; projectOptions.formatCodeOptions = rawConfig.formatCodeOptions; } proj.setProjectOptions(projectOptions); - return { success: true, project: proj }; + return { + success: true, + project: proj + }; } else { - return { errorMsg: "no files found" }; + return { + errorMsg: "no files found" + }; } } }; @@ -31409,8 +36342,12 @@ var ts; this.trailingText = ""; this.suppressTrailingText = false; this.lineIndex.root = new LineNode(); - this.startPath = [this.lineIndex.root]; - this.stack = [this.lineIndex.root]; + this.startPath = [ + this.lineIndex.root + ]; + this.stack = [ + this.lineIndex.root + ]; } EditWalker.prototype.insertLines = function (insertedText) { if (this.suppressTrailingText) { @@ -31602,9 +36539,7 @@ var ts; } ScriptVersionCache.prototype.edit = function (pos, deleteLen, insertedText) { this.changes[this.changes.length] = new TextChange(pos, deleteLen, insertedText); - if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) || - (deleteLen > ScriptVersionCache.changeLengthThreshold) || - (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) { + if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) || (deleteLen > ScriptVersionCache.changeLengthThreshold) || (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) { this.getSnapshot(); } }; @@ -31650,6 +36585,13 @@ var ts; this.currentVersion = snap.version; this.versions[snap.version] = snap; this.changes = []; + if ((this.currentVersion - this.minVersion) >= ScriptVersionCache.maxVersions) { + var oldMin = this.minVersion; + this.minVersion = (this.currentVersion - ScriptVersionCache.maxVersions) + 1; + for (var j = oldMin; j < this.minVersion; j++) { + this.versions[j] = undefined; + } + } } return snap; }; @@ -31685,6 +36627,7 @@ var ts; }; ScriptVersionCache.changeNumberThreshold = 8; ScriptVersionCache.changeLengthThreshold = 256; + ScriptVersionCache.maxVersions = 8; return ScriptVersionCache; })(); server.ScriptVersionCache = ScriptVersionCache; @@ -31701,7 +36644,9 @@ var ts; return this.index.root.charCount(); }; LineIndexSnapshot.prototype.getLineStartPositions = function () { - var starts = [-1]; + var starts = [ + -1 + ]; var count = 1; var pos = 0; this.index.every(function (ll, s, len) { @@ -31880,7 +36825,10 @@ var ts; LineIndex.linesFromText = function (text) { var lineStarts = ts.computeLineStarts(text); if (lineStarts.length == 0) { - return { lines: [], lineMap: lineStarts }; + return { + lines: [], + lineMap: lineStarts + }; } var lines = new Array(lineStarts.length); var lc = lineStarts.length - 1; @@ -31894,7 +36842,10 @@ var ts; else { lines.length--; } - return { lines: lines, lineMap: lineStarts }; + return { + lines: lines, + lineMap: lineStarts + }; }; return LineIndex; })(); @@ -32008,7 +36959,10 @@ var ts; } else { var lineInfo = this.lineNumberToInfo(this.lineCount(), 0); - return { line: this.lineCount(), col: lineInfo.leaf.charCount() }; + return { + line: this.lineCount(), + col: lineInfo.leaf.charCount() + }; } }; LineNode.prototype.lineNumberToInfo = function (lineNumber, charOffset) { @@ -32195,7 +37149,12 @@ var ts; (function (ts) { var server; (function (server) { - var spaceCache = [" ", " ", " ", " "]; + var spaceCache = [ + " ", + " ", + " ", + " " + ]; function generateSpaces(n) { if (!spaceCache[n]) { var strBuilder = ""; @@ -32281,16 +37240,22 @@ var ts; this.fileHash = {}; this.nextFileId = 1; this.changeSeq = 0; - this.projectService = - new server.ProjectService(host, logger, function (eventName, project, fileName) { - _this.handleEvent(eventName, project, fileName); - }); + this.projectService = new server.ProjectService(host, logger, function (eventName, project, fileName) { + _this.handleEvent(eventName, project, fileName); + }); } Session.prototype.handleEvent = function (eventName, project, fileName) { var _this = this; if (eventName == "context") { this.projectService.log("got context event, updating diagnostics for" + fileName, "Info"); - this.updateErrorCheck([{ fileName: fileName, project: project }], this.changeSeq, function (n) { return n == _this.changeSeq; }, 100); + this.updateErrorCheck([ + { + fileName: fileName, + project: project + } + ], this.changeSeq, function (n) { + return n == _this.changeSeq; + }, 100); } }; Session.prototype.logError = function (err, cmd) { @@ -32309,8 +37274,10 @@ var ts; }; Session.prototype.send = function (msg) { var json = JSON.stringify(msg); - this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + - '\r\n\r\n' + json); + if (this.logger.isVerbose()) { + this.logger.info(msg.type + ": " + json); + } + this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + '\r\n\r\n' + json); }; Session.prototype.event = function (info, eventName) { var ev = { @@ -32346,8 +37313,13 @@ var ts; try { var diags = project.compilerService.languageService.getSemanticDiagnostics(file); if (diags) { - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "semanticDiag"); + var bakedDiags = diags.map(function (diag) { + return formatDiag(file, project, diag); + }); + this.event({ + file: file, + diagnostics: bakedDiags + }, "semanticDiag"); } } catch (err) { @@ -32358,8 +37330,13 @@ var ts; try { var diags = project.compilerService.languageService.getSyntacticDiagnostics(file); if (diags) { - var bakedDiags = diags.map(function (diag) { return formatDiag(file, project, diag); }); - this.event({ file: file, diagnostics: bakedDiags }, "syntaxDiag"); + var bakedDiags = diags.map(function (diag) { + return formatDiag(file, project, diag); + }); + this.event({ + file: file, + diagnostics: bakedDiags + }, "syntaxDiag"); } } catch (err) { @@ -32428,11 +37405,13 @@ var ts; if (!definitions) { return undefined; } - return definitions.map(function (def) { return ({ - file: def.fileName, - start: compilerService.host.positionToLineCol(def.fileName, def.textSpan.start), - end: compilerService.host.positionToLineCol(def.fileName, ts.textSpanEnd(def.textSpan)) - }); }); + return definitions.map(function (def) { + return ({ + file: def.fileName, + start: compilerService.host.positionToLineCol(def.fileName, def.textSpan.start), + end: compilerService.host.positionToLineCol(def.fileName, ts.textSpanEnd(def.textSpan)) + }); + }); }; Session.prototype.getRenameLocations = function (line, col, fileName, findInComments, findInStrings) { var file = ts.normalizePath(fileName); @@ -32456,11 +37435,13 @@ var ts; if (!renameLocations) { return undefined; } - var bakedRenameLocs = renameLocations.map(function (location) { return ({ - file: location.fileName, - start: compilerService.host.positionToLineCol(location.fileName, location.textSpan.start), - end: compilerService.host.positionToLineCol(location.fileName, ts.textSpanEnd(location.textSpan)) - }); }).sort(function (a, b) { + var bakedRenameLocs = renameLocations.map(function (location) { + return ({ + file: location.fileName, + start: compilerService.host.positionToLineCol(location.fileName, location.textSpan.start), + end: compilerService.host.positionToLineCol(location.fileName, ts.textSpanEnd(location.textSpan)) + }); + }).sort(function (a, b) { if (a.file < b.file) { return -1; } @@ -32487,13 +37468,22 @@ var ts; } } if (!curFileAccum) { - curFileAccum = { file: cur.file, locs: [] }; + curFileAccum = { + file: cur.file, + locs: [] + }; accum.push(curFileAccum); } - curFileAccum.locs.push({ start: cur.start, end: cur.end }); + curFileAccum.locs.push({ + start: cur.start, + end: cur.end + }); return accum; }, []); - return { info: renameInfo, locs: bakedRenameLocs }; + return { + info: renameInfo, + locs: bakedRenameLocs + }; }; Session.prototype.getReferences = function (line, col, fileName) { var file = ts.normalizePath(fileName); @@ -32593,16 +37583,42 @@ var ts; var position = compilerService.host.lineColToPosition(file, line, col); var edits = compilerService.languageService.getFormattingEditsAfterKeystroke(file, position, key, compilerService.formatCodeOptions); if ((key == "\n") && ((!edits) || (edits.length == 0) || allEditsBeforePos(edits, position))) { - var editorOptions = { - IndentSize: 4, - TabSize: 4, - NewLineCharacter: "\n", - ConvertTabsToSpaces: true - }; - var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); - var spaces = generateSpaces(indentPosition); - if (indentPosition > 0) { - edits.push({ span: ts.createTextSpanFromBounds(position, position), newText: spaces }); + var scriptInfo = compilerService.host.getScriptInfo(file); + if (scriptInfo) { + var lineInfo = scriptInfo.getLineInfo(line); + if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) { + var lineText = lineInfo.leaf.text; + if (lineText.search("\\S") < 0) { + var editorOptions = { + IndentSize: 4, + TabSize: 4, + NewLineCharacter: "\n", + ConvertTabsToSpaces: true + }; + var indentPosition = compilerService.languageService.getIndentationAtPosition(file, position, editorOptions); + for (var i = 0, len = lineText.length; i < len; i++) { + if (lineText.charAt(i) == " ") { + indentPosition--; + } + else { + break; + } + } + if (indentPosition > 0) { + var spaces = generateSpaces(indentPosition); + edits.push({ + span: ts.createTextSpanFromBounds(position, position), + newText: spaces + }); + } + else if (indentPosition < 0) { + edits.push({ + span: ts.createTextSpanFromBounds(position, position - indentPosition), + newText: "" + }); + } + } + } } } if (!edits) { @@ -32660,12 +37676,17 @@ var ts; fileName = ts.normalizePath(fileName); var project = _this.projectService.getProjectForFile(fileName); if (project) { - accum.push({ fileName: fileName, project: project }); + accum.push({ + fileName: fileName, + project: project + }); } return accum; }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay); + this.updateErrorCheck(checkList, this.changeSeq, function (n) { + return n == _this.changeSeq; + }, delay); } }; Session.prototype.change = function (line, col, endLine, endCol, insertString, fileName) { @@ -32680,7 +37701,9 @@ var ts; compilerService.host.editScript(file, start, end, insertString); this.changeSeq++; } - this.updateProjectStructure(this.changeSeq, function (n) { return n == _this.changeSeq; }); + this.updateProjectStructure(this.changeSeq, function (n) { + return n == _this.changeSeq; + }); } }; Session.prototype.reload = function (fileName, tempFileName, reqSeq) { @@ -32714,16 +37737,20 @@ var ts; return undefined; } var compilerService = project.compilerService; - return items.map(function (item) { return ({ - text: item.text, - kind: item.kind, - kindModifiers: item.kindModifiers, - spans: item.spans.map(function (span) { return ({ - start: compilerService.host.positionToLineCol(fileName, span.start), - end: compilerService.host.positionToLineCol(fileName, ts.textSpanEnd(span)) - }); }), - childItems: _this.decorateNavigationBarItem(project, fileName, item.childItems) - }); }); + return items.map(function (item) { + return ({ + text: item.text, + kind: item.kind, + kindModifiers: item.kindModifiers, + spans: item.spans.map(function (span) { + return ({ + start: compilerService.host.positionToLineCol(fileName, span.start), + end: compilerService.host.positionToLineCol(fileName, ts.textSpanEnd(span)) + }); + }), + childItems: _this.decorateNavigationBarItem(project, fileName, item.childItems) + }); + }); }; Session.prototype.getNavigationBarItems = function (fileName) { var file = ts.normalizePath(fileName); @@ -32786,113 +37813,148 @@ var ts; if (!spans) { return undefined; } - return spans.map(function (span) { return ({ - start: compilerService.host.positionToLineCol(file, span.start), - end: compilerService.host.positionToLineCol(file, span.start + span.length) - }); }); + return spans.map(function (span) { + return ({ + start: compilerService.host.positionToLineCol(file, span.start), + end: compilerService.host.positionToLineCol(file, span.start + span.length) + }); + }); }; Session.prototype.onMessage = function (message) { + if (this.logger.isVerbose()) { + this.logger.info("request: " + message); + var start = process.hrtime(); + } try { var request = JSON.parse(message); var response; var errorMessage; var responseRequired = true; switch (request.command) { - case CommandNames.Definition: { - var defArgs = request.arguments; - response = this.getDefinition(defArgs.line, defArgs.col, defArgs.file); - break; - } - case CommandNames.References: { - var refArgs = request.arguments; - response = this.getReferences(refArgs.line, refArgs.col, refArgs.file); - break; - } - case CommandNames.Rename: { - var renameArgs = request.arguments; - response = this.getRenameLocations(renameArgs.line, renameArgs.col, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); - break; - } - case CommandNames.Open: { - var openArgs = request.arguments; - this.openClientFile(openArgs.file); - responseRequired = false; - break; - } - case CommandNames.Quickinfo: { - var quickinfoArgs = request.arguments; - response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.col, quickinfoArgs.file); - break; - } - case CommandNames.Format: { - var formatArgs = request.arguments; - response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.col, formatArgs.endLine, formatArgs.endCol, formatArgs.file); - break; - } - case CommandNames.Formatonkey: { - var formatOnKeyArgs = request.arguments; - response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.col, formatOnKeyArgs.key, formatOnKeyArgs.file); - break; - } - case CommandNames.Completions: { - var completionsArgs = request.arguments; - response = this.getCompletions(request.arguments.line, request.arguments.col, completionsArgs.prefix, request.arguments.file); - break; - } - case CommandNames.CompletionDetails: { - var completionDetailsArgs = request.arguments; - response = this.getCompletionEntryDetails(request.arguments.line, request.arguments.col, completionDetailsArgs.entryNames, request.arguments.file); - break; - } - case CommandNames.Geterr: { - var geterrArgs = request.arguments; - response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); - responseRequired = false; - break; - } - case CommandNames.Change: { - var changeArgs = request.arguments; - this.change(changeArgs.line, changeArgs.col, changeArgs.endLine, changeArgs.endCol, changeArgs.insertString, changeArgs.file); - responseRequired = false; - break; - } - case CommandNames.Reload: { - var reloadArgs = request.arguments; - this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); - break; - } - case CommandNames.Saveto: { - var savetoArgs = request.arguments; - this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); - responseRequired = false; - break; - } - case CommandNames.Close: { - var closeArgs = request.arguments; - this.closeClientFile(closeArgs.file); - responseRequired = false; - break; - } - case CommandNames.Navto: { - var navtoArgs = request.arguments; - response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); - break; - } - case CommandNames.Brace: { - var braceArguments = request.arguments; - response = this.getBraceMatching(braceArguments.line, braceArguments.col, braceArguments.file); - break; - } - case CommandNames.NavBar: { - var navBarArgs = request.arguments; - response = this.getNavigationBarItems(navBarArgs.file); - break; - } - default: { - this.projectService.log("Unrecognized JSON command: " + message); - this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); - break; + case CommandNames.Definition: + { + var defArgs = request.arguments; + response = this.getDefinition(defArgs.line, defArgs.col, defArgs.file); + break; + } + case CommandNames.References: + { + var refArgs = request.arguments; + response = this.getReferences(refArgs.line, refArgs.col, refArgs.file); + break; + } + case CommandNames.Rename: + { + var renameArgs = request.arguments; + response = this.getRenameLocations(renameArgs.line, renameArgs.col, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); + break; + } + case CommandNames.Open: + { + var openArgs = request.arguments; + this.openClientFile(openArgs.file); + responseRequired = false; + break; + } + case CommandNames.Quickinfo: + { + var quickinfoArgs = request.arguments; + response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.col, quickinfoArgs.file); + break; + } + case CommandNames.Format: + { + var formatArgs = request.arguments; + response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.col, formatArgs.endLine, formatArgs.endCol, formatArgs.file); + break; + } + case CommandNames.Formatonkey: + { + var formatOnKeyArgs = request.arguments; + response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.col, formatOnKeyArgs.key, formatOnKeyArgs.file); + break; + } + case CommandNames.Completions: + { + var completionsArgs = request.arguments; + response = this.getCompletions(request.arguments.line, request.arguments.col, completionsArgs.prefix, request.arguments.file); + break; + } + case CommandNames.CompletionDetails: + { + var completionDetailsArgs = request.arguments; + response = this.getCompletionEntryDetails(request.arguments.line, request.arguments.col, completionDetailsArgs.entryNames, request.arguments.file); + break; + } + case CommandNames.Geterr: + { + var geterrArgs = request.arguments; + response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); + responseRequired = false; + break; + } + case CommandNames.Change: + { + var changeArgs = request.arguments; + this.change(changeArgs.line, changeArgs.col, changeArgs.endLine, changeArgs.endCol, changeArgs.insertString, changeArgs.file); + responseRequired = false; + break; + } + case CommandNames.Reload: + { + var reloadArgs = request.arguments; + this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); + break; + } + case CommandNames.Saveto: + { + var savetoArgs = request.arguments; + this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + responseRequired = false; + break; + } + case CommandNames.Close: + { + var closeArgs = request.arguments; + this.closeClientFile(closeArgs.file); + responseRequired = false; + break; + } + case CommandNames.Navto: + { + var navtoArgs = request.arguments; + response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); + break; + } + case CommandNames.Brace: + { + var braceArguments = request.arguments; + response = this.getBraceMatching(braceArguments.line, braceArguments.col, braceArguments.file); + break; + } + case CommandNames.NavBar: + { + var navBarArgs = request.arguments; + response = this.getNavigationBarItems(navBarArgs.file); + break; + } + default: + { + this.projectService.log("Unrecognized JSON command: " + message); + this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); + break; + } + } + if (this.logger.isVerbose()) { + var elapsed = process.hrtime(start); + var seconds = elapsed[0]; + var nanoseconds = elapsed[1]; + var elapsedMs = ((1e9 * seconds) + nanoseconds) / 1000000.0; + var leader = "Elapsed time (in milliseconds)"; + if (!responseRequired) { + leader = "Async elapsed time (in milliseconds)"; } + this.logger.msg(leader + ": " + elapsedMs.toFixed(4).toString(), "Perf"); } if (response) { this.output(response, request.command, request.seq); @@ -32927,8 +37989,9 @@ var ts; terminal: false }); var Logger = (function () { - function Logger(logFilename) { + function Logger(logFilename, level) { this.logFilename = logFilename; + this.level = level; this.fd = -1; this.seq = 0; this.inGroup = false; @@ -32957,10 +38020,18 @@ var ts; this.seq++; this.firstInGroup = true; }; + Logger.prototype.loggingEnabled = function () { + return !!this.logFilename; + }; + Logger.prototype.isVerbose = function () { + return this.loggingEnabled() && (this.level == "verbose"); + }; Logger.prototype.msg = function (s, type) { if (type === void 0) { type = "Err"; } if (this.fd < 0) { - this.fd = fs.openSync(this.logFilename, "w"); + if (this.logFilename) { + this.fd = fs.openSync(this.logFilename, "w"); + } } if (this.fd >= 0) { s = s + "\n"; @@ -33064,19 +38135,58 @@ var ts; _this.onMessage(message); }); rl.on('close', function () { - _this.projectService.closeLog(); _this.projectService.log("Exiting..."); + _this.projectService.closeLog(); process.exit(0); }); }; return IOSession; })(server.Session); - var logger = new Logger(__dirname + "/.log" + process.pid.toString()); + function parseLoggingEnvironmentString(logEnvStr) { + var logEnv = {}; + var args = logEnvStr.split(' '); + for (var i = 0, len = args.length; i < (len - 1); i += 2) { + var option = args[i]; + var value = args[i + 1]; + if (option && value) { + switch (option) { + case "-file": + logEnv.file = value; + break; + case "-level": + logEnv.detailLevel = value; + break; + } + } + } + return logEnv; + } + function createLoggerFromEnv() { + var fileName = undefined; + var detailLevel = "normal"; + var logEnvStr = process.env["TSS_LOG"]; + if (logEnvStr) { + var logEnv = parseLoggingEnvironmentString(logEnvStr); + if (logEnv.file) { + fileName = logEnv.file; + } + else { + fileName = __dirname + "/.log" + process.pid.toString(); + } + if (logEnv.detailLevel) { + detailLevel = logEnv.detailLevel; + } + } + return new Logger(fileName, detailLevel); + } + var logger = createLoggerFromEnv(); var watchedFileSet = new WatchedFileSet(); ts.sys.watchFile = function (fileName, callback) { var watchedFile = watchedFileSet.addFile(fileName, callback); return { - close: function () { return watchedFileSet.removeFile(watchedFile); } + close: function () { + return watchedFileSet.removeFile(watchedFile); + } }; }; var ioSession = new IOSession(ts.sys, logger); diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index 3de69b45409b6..bf6b204d3bb8e 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -224,27 +224,28 @@ declare module "typescript" { EnumDeclaration = 199, ModuleDeclaration = 200, ModuleBlock = 201, - ImportEqualsDeclaration = 202, - ImportDeclaration = 203, - ImportClause = 204, - NamespaceImport = 205, - NamedImports = 206, - ImportSpecifier = 207, - ExportAssignment = 208, - ExportDeclaration = 209, - NamedExports = 210, - ExportSpecifier = 211, - ExternalModuleReference = 212, - CaseClause = 213, - DefaultClause = 214, - HeritageClause = 215, - CatchClause = 216, - PropertyAssignment = 217, - ShorthandPropertyAssignment = 218, - EnumMember = 219, - SourceFile = 220, - SyntaxList = 221, - Count = 222, + CaseBlock = 202, + ImportEqualsDeclaration = 203, + ImportDeclaration = 204, + ImportClause = 205, + NamespaceImport = 206, + NamedImports = 207, + ImportSpecifier = 208, + ExportAssignment = 209, + ExportDeclaration = 210, + NamedExports = 211, + ExportSpecifier = 212, + ExternalModuleReference = 213, + CaseClause = 214, + DefaultClause = 215, + HeritageClause = 216, + CatchClause = 217, + PropertyAssignment = 218, + ShorthandPropertyAssignment = 219, + EnumMember = 220, + SourceFile = 221, + SyntaxList = 222, + Count = 223, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, @@ -619,6 +620,9 @@ declare module "typescript" { } interface SwitchStatement extends Statement { expression: Expression; + caseBlock: CaseBlock; + } + interface CaseBlock extends Node { clauses: NodeArray; } interface CaseClause extends Node { @@ -1197,6 +1201,7 @@ declare module "typescript" { version?: boolean; watch?: boolean; stripInternal?: boolean; + preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1437,12 +1442,15 @@ declare module "typescript" { function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; } declare module "typescript" { + /** The version of the TypeScript compiler release */ + var version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } declare module "typescript" { + /** The version of the language service API */ var servicesVersion: string; interface Node { getSourceFile(): SourceFile; diff --git a/bin/typescript.js b/bin/typescript.js index f3c487b20793e..0fb345eea1b46 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -218,27 +218,28 @@ var ts; SyntaxKind[SyntaxKind["EnumDeclaration"] = 199] = "EnumDeclaration"; SyntaxKind[SyntaxKind["ModuleDeclaration"] = 200] = "ModuleDeclaration"; SyntaxKind[SyntaxKind["ModuleBlock"] = 201] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 202] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 203] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 204] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 205] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 206] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 207] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 208] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 209] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 210] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 211] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 212] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["CaseClause"] = 213] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 214] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 215] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 216] = "CatchClause"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 217] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 218] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 219] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 220] = "SourceFile"; - SyntaxKind[SyntaxKind["SyntaxList"] = 221] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 222] = "Count"; + SyntaxKind[SyntaxKind["CaseBlock"] = 202] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 203] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 204] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 205] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 206] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 207] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 208] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 209] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 210] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 211] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 212] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["CaseClause"] = 214] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 215] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 216] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 217] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 218] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 219] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 220] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 221] = "SourceFile"; + SyntaxKind[SyntaxKind["SyntaxList"] = 222] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 223] = "Count"; SyntaxKind[SyntaxKind["FirstAssignment"] = 52] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 63] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 65] = "FirstReservedWord"; @@ -824,18 +825,21 @@ var ts; ts.arrayToMap = arrayToMap; function formatStringFromArgs(text, args, baseIndex) { baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + return text.replace(/{(\d+)}/g, function (match, index) { + return args[+index + baseIndex]; + }); } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] - ? ts.localizedDiagnosticMessages[message] - : message; + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { + var end = start + length; Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); + Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); @@ -898,12 +902,7 @@ var ts; return diagnostic.file ? diagnostic.file.fileName : undefined; } function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || - compareValues(d1.start, d2.start) || - compareValues(d1.length, d2.length) || - compareValues(d1.code, d2.code) || - compareMessageText(d1.messageText, d2.messageText) || - 0; + return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || 0; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { @@ -930,7 +929,9 @@ var ts; if (diagnostics.length < 2) { return diagnostics; } - var newDiagnostics = [diagnostics[0]]; + var newDiagnostics = [ + diagnostics[0] + ]; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; @@ -1007,7 +1008,9 @@ var ts; ts.isRootedDiskPath = isRootedDiskPath; function normalizedPathComponents(path, rootLength) { var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); + return [ + path.substr(0, rootLength) + ].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { var path = normalizeSlashes(path); @@ -1041,7 +1044,9 @@ var ts; } } if (rootLength === urlLength) { - return [url]; + return [ + url + ]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -1049,7 +1054,9 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [url + ts.directorySeparator]; + return [ + url + ts.directorySeparator + ]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -1111,7 +1118,11 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; + var supportedExtensions = [ + ".d.ts", + ".ts", + ".js" + ]; function removeFileExtension(path) { for (var i = 0; i < supportedExtensions.length; i++) { var ext = supportedExtensions[i]; @@ -1165,9 +1176,15 @@ var ts; }; return Node; }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } + getSymbolConstructor: function () { + return Symbol; + }, + getTypeConstructor: function () { + return Type; + }, + getSignatureConstructor: function () { + return Signature; + } }; (function (AssertionLevel) { AssertionLevel[AssertionLevel["None"] = 0] = "None"; @@ -1392,9 +1409,14 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + _fs.watchFile(fileName, { + persistent: true, + interval: 250 + }, fileChanged); return { - close: function () { _fs.unwatchFile(fileName, fileChanged); } + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } }; function fileChanged(curr, prev) { if (+curr.mtime <= +prev.mtime) { @@ -1445,493 +1467,2436 @@ var ts; else { return undefined; } - })(); -})(ts || (ts = {})); -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: 1, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1, key: "'{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." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + })(); +})(ts || (ts = {})); +var ts; +(function (ts) { + ts.Diagnostics = { + Unterminated_string_literal: { + code: 1002, + category: 1, + key: "Unterminated string literal." + }, + Identifier_expected: { + code: 1003, + category: 1, + key: "Identifier expected." + }, + _0_expected: { + code: 1005, + category: 1, + key: "'{0}' expected." + }, + A_file_cannot_have_a_reference_to_itself: { + code: 1006, + category: 1, + key: "A file cannot have a reference to itself." + }, + Trailing_comma_not_allowed: { + code: 1009, + category: 1, + key: "Trailing comma not allowed." + }, + Asterisk_Slash_expected: { + code: 1010, + category: 1, + key: "'*/' expected." + }, + Unexpected_token: { + code: 1012, + category: 1, + key: "Unexpected token." + }, + A_rest_parameter_must_be_last_in_a_parameter_list: { + code: 1014, + category: 1, + key: "A rest parameter must be last in a parameter list." + }, + Parameter_cannot_have_question_mark_and_initializer: { + code: 1015, + category: 1, + key: "Parameter cannot have question mark and initializer." + }, + A_required_parameter_cannot_follow_an_optional_parameter: { + code: 1016, + category: 1, + key: "A required parameter cannot follow an optional parameter." + }, + An_index_signature_cannot_have_a_rest_parameter: { + code: 1017, + category: 1, + key: "An index signature cannot have a rest parameter." + }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { + code: 1018, + category: 1, + key: "An index signature parameter cannot have an accessibility modifier." + }, + An_index_signature_parameter_cannot_have_a_question_mark: { + code: 1019, + category: 1, + key: "An index signature parameter cannot have a question mark." + }, + An_index_signature_parameter_cannot_have_an_initializer: { + code: 1020, + category: 1, + key: "An index signature parameter cannot have an initializer." + }, + An_index_signature_must_have_a_type_annotation: { + code: 1021, + category: 1, + key: "An index signature must have a type annotation." + }, + An_index_signature_parameter_must_have_a_type_annotation: { + code: 1022, + category: 1, + key: "An index signature parameter must have a type annotation." + }, + An_index_signature_parameter_type_must_be_string_or_number: { + code: 1023, + category: 1, + key: "An index signature parameter type must be 'string' or 'number'." + }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { + code: 1024, + category: 1, + key: "A class or interface declaration can only have one 'extends' clause." + }, + An_extends_clause_must_precede_an_implements_clause: { + code: 1025, + category: 1, + key: "An 'extends' clause must precede an 'implements' clause." + }, + A_class_can_only_extend_a_single_class: { + code: 1026, + category: 1, + key: "A class can only extend a single class." + }, + A_class_declaration_can_only_have_one_implements_clause: { + code: 1027, + category: 1, + key: "A class declaration can only have one 'implements' clause." + }, + Accessibility_modifier_already_seen: { + code: 1028, + category: 1, + key: "Accessibility modifier already seen." + }, + _0_modifier_must_precede_1_modifier: { + code: 1029, + category: 1, + key: "'{0}' modifier must precede '{1}' modifier." + }, + _0_modifier_already_seen: { + code: 1030, + category: 1, + key: "'{0}' modifier already seen." + }, + _0_modifier_cannot_appear_on_a_class_element: { + code: 1031, + category: 1, + key: "'{0}' modifier cannot appear on a class element." + }, + An_interface_declaration_cannot_have_an_implements_clause: { + code: 1032, + category: 1, + key: "An interface declaration cannot have an 'implements' clause." + }, + super_must_be_followed_by_an_argument_list_or_member_access: { + code: 1034, + category: 1, + key: "'super' must be followed by an argument list or member access." + }, + Only_ambient_modules_can_use_quoted_names: { + code: 1035, + category: 1, + key: "Only ambient modules can use quoted names." + }, + Statements_are_not_allowed_in_ambient_contexts: { + code: 1036, + category: 1, + key: "Statements are not allowed in ambient contexts." + }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { + code: 1038, + category: 1, + key: "A 'declare' modifier cannot be used in an already ambient context." + }, + Initializers_are_not_allowed_in_ambient_contexts: { + code: 1039, + category: 1, + key: "Initializers are not allowed in ambient contexts." + }, + _0_modifier_cannot_appear_on_a_module_element: { + code: 1044, + category: 1, + key: "'{0}' modifier cannot appear on a module element." + }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { + code: 1045, + category: 1, + key: "A 'declare' modifier cannot be used with an interface declaration." + }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { + code: 1046, + category: 1, + key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." + }, + A_rest_parameter_cannot_be_optional: { + code: 1047, + category: 1, + key: "A rest parameter cannot be optional." + }, + A_rest_parameter_cannot_have_an_initializer: { + code: 1048, + category: 1, + key: "A rest parameter cannot have an initializer." + }, + A_set_accessor_must_have_exactly_one_parameter: { + code: 1049, + category: 1, + key: "A 'set' accessor must have exactly one parameter." + }, + A_set_accessor_cannot_have_an_optional_parameter: { + code: 1051, + category: 1, + key: "A 'set' accessor cannot have an optional parameter." + }, + A_set_accessor_parameter_cannot_have_an_initializer: { + code: 1052, + category: 1, + key: "A 'set' accessor parameter cannot have an initializer." + }, + A_set_accessor_cannot_have_rest_parameter: { + code: 1053, + category: 1, + key: "A 'set' accessor cannot have rest parameter." + }, + A_get_accessor_cannot_have_parameters: { + code: 1054, + category: 1, + key: "A 'get' accessor cannot have parameters." + }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { + code: 1056, + category: 1, + key: "Accessors are only available when targeting ECMAScript 5 and higher." + }, + Enum_member_must_have_initializer: { + code: 1061, + category: 1, + key: "Enum member must have initializer." + }, + An_export_assignment_cannot_be_used_in_an_internal_module: { + code: 1063, + category: 1, + key: "An export assignment cannot be used in an internal module." + }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { + code: 1066, + category: 1, + key: "Ambient enum elements can only have integer literal initializers." + }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { + code: 1068, + category: 1, + key: "Unexpected token. A constructor, method, accessor, or property was expected." + }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { + code: 1079, + category: 1, + key: "A 'declare' modifier cannot be used with an import declaration." + }, + Invalid_reference_directive_syntax: { + code: 1084, + category: 1, + key: "Invalid 'reference' directive syntax." + }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { + code: 1085, + category: 1, + key: "Octal literals are not available when targeting ECMAScript 5 and higher." + }, + An_accessor_cannot_be_declared_in_an_ambient_context: { + code: 1086, + category: 1, + key: "An accessor cannot be declared in an ambient context." + }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { + code: 1089, + category: 1, + key: "'{0}' modifier cannot appear on a constructor declaration." + }, + _0_modifier_cannot_appear_on_a_parameter: { + code: 1090, + category: 1, + key: "'{0}' modifier cannot appear on a parameter." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { + code: 1091, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...in' statement." + }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { + code: 1092, + category: 1, + key: "Type parameters cannot appear on a constructor declaration." + }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { + code: 1093, + category: 1, + key: "Type annotation cannot appear on a constructor declaration." + }, + An_accessor_cannot_have_type_parameters: { + code: 1094, + category: 1, + key: "An accessor cannot have type parameters." + }, + A_set_accessor_cannot_have_a_return_type_annotation: { + code: 1095, + category: 1, + key: "A 'set' accessor cannot have a return type annotation." + }, + An_index_signature_must_have_exactly_one_parameter: { + code: 1096, + category: 1, + key: "An index signature must have exactly one parameter." + }, + _0_list_cannot_be_empty: { + code: 1097, + category: 1, + key: "'{0}' list cannot be empty." + }, + Type_parameter_list_cannot_be_empty: { + code: 1098, + category: 1, + key: "Type parameter list cannot be empty." + }, + Type_argument_list_cannot_be_empty: { + code: 1099, + category: 1, + key: "Type argument list cannot be empty." + }, + Invalid_use_of_0_in_strict_mode: { + code: 1100, + category: 1, + key: "Invalid use of '{0}' in strict mode." + }, + with_statements_are_not_allowed_in_strict_mode: { + code: 1101, + category: 1, + key: "'with' statements are not allowed in strict mode." + }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { + code: 1102, + category: 1, + key: "'delete' cannot be called on an identifier in strict mode." + }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { + code: 1104, + category: 1, + key: "A 'continue' statement can only be used within an enclosing iteration statement." + }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { + code: 1105, + category: 1, + key: "A 'break' statement can only be used within an enclosing iteration or switch statement." + }, + Jump_target_cannot_cross_function_boundary: { + code: 1107, + category: 1, + key: "Jump target cannot cross function boundary." + }, + A_return_statement_can_only_be_used_within_a_function_body: { + code: 1108, + category: 1, + key: "A 'return' statement can only be used within a function body." + }, + Expression_expected: { + code: 1109, + category: 1, + key: "Expression expected." + }, + Type_expected: { + code: 1110, + category: 1, + key: "Type expected." + }, + A_class_member_cannot_be_declared_optional: { + code: 1112, + category: 1, + key: "A class member cannot be declared optional." + }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { + code: 1113, + category: 1, + key: "A 'default' clause cannot appear more than once in a 'switch' statement." + }, + Duplicate_label_0: { + code: 1114, + category: 1, + key: "Duplicate label '{0}'" + }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { + code: 1115, + category: 1, + key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." + }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { + code: 1116, + category: 1, + key: "A 'break' statement can only jump to a label of an enclosing statement." + }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { + code: 1117, + category: 1, + key: "An object literal cannot have multiple properties with the same name in strict mode." + }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { + code: 1118, + category: 1, + key: "An object literal cannot have multiple get/set accessors with the same name." + }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { + code: 1119, + category: 1, + key: "An object literal cannot have property and accessor with the same name." + }, + An_export_assignment_cannot_have_modifiers: { + code: 1120, + category: 1, + key: "An export assignment cannot have modifiers." + }, + Octal_literals_are_not_allowed_in_strict_mode: { + code: 1121, + category: 1, + key: "Octal literals are not allowed in strict mode." + }, + A_tuple_type_element_list_cannot_be_empty: { + code: 1122, + category: 1, + key: "A tuple type element list cannot be empty." + }, + Variable_declaration_list_cannot_be_empty: { + code: 1123, + category: 1, + key: "Variable declaration list cannot be empty." + }, + Digit_expected: { + code: 1124, + category: 1, + key: "Digit expected." + }, + Hexadecimal_digit_expected: { + code: 1125, + category: 1, + key: "Hexadecimal digit expected." + }, + Unexpected_end_of_text: { + code: 1126, + category: 1, + key: "Unexpected end of text." + }, + Invalid_character: { + code: 1127, + category: 1, + key: "Invalid character." + }, + Declaration_or_statement_expected: { + code: 1128, + category: 1, + key: "Declaration or statement expected." + }, + Statement_expected: { + code: 1129, + category: 1, + key: "Statement expected." + }, + case_or_default_expected: { + code: 1130, + category: 1, + key: "'case' or 'default' expected." + }, + Property_or_signature_expected: { + code: 1131, + category: 1, + key: "Property or signature expected." + }, + Enum_member_expected: { + code: 1132, + category: 1, + key: "Enum member expected." + }, + Type_reference_expected: { + code: 1133, + category: 1, + key: "Type reference expected." + }, + Variable_declaration_expected: { + code: 1134, + category: 1, + key: "Variable declaration expected." + }, + Argument_expression_expected: { + code: 1135, + category: 1, + key: "Argument expression expected." + }, + Property_assignment_expected: { + code: 1136, + category: 1, + key: "Property assignment expected." + }, + Expression_or_comma_expected: { + code: 1137, + category: 1, + key: "Expression or comma expected." + }, + Parameter_declaration_expected: { + code: 1138, + category: 1, + key: "Parameter declaration expected." + }, + Type_parameter_declaration_expected: { + code: 1139, + category: 1, + key: "Type parameter declaration expected." + }, + Type_argument_expected: { + code: 1140, + category: 1, + key: "Type argument expected." + }, + String_literal_expected: { + code: 1141, + category: 1, + key: "String literal expected." + }, + Line_break_not_permitted_here: { + code: 1142, + category: 1, + key: "Line break not permitted here." + }, + or_expected: { + code: 1144, + category: 1, + key: "'{' or ';' expected." + }, + Modifiers_not_permitted_on_index_signature_members: { + code: 1145, + category: 1, + key: "Modifiers not permitted on index signature members." + }, + Declaration_expected: { + code: 1146, + category: 1, + key: "Declaration expected." + }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { + code: 1147, + category: 1, + key: "Import declarations in an internal module cannot reference an external module." + }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { + code: 1148, + category: 1, + key: "Cannot compile external modules unless the '--module' flag is provided." + }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { + code: 1149, + category: 1, + key: "File name '{0}' differs from already included file name '{1}' only in casing" + }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { + code: 1150, + category: 1, + key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." + }, + var_let_or_const_expected: { + code: 1152, + category: 1, + key: "'var', 'let' or 'const' expected." + }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1153, + category: 1, + key: "'let' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1154, + category: 1, + key: "'const' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_must_be_initialized: { + code: 1155, + category: 1, + key: "'const' declarations must be initialized" + }, + const_declarations_can_only_be_declared_inside_a_block: { + code: 1156, + category: 1, + key: "'const' declarations can only be declared inside a block." + }, + let_declarations_can_only_be_declared_inside_a_block: { + code: 1157, + category: 1, + key: "'let' declarations can only be declared inside a block." + }, + Unterminated_template_literal: { + code: 1160, + category: 1, + key: "Unterminated template literal." + }, + Unterminated_regular_expression_literal: { + code: 1161, + category: 1, + key: "Unterminated regular expression literal." + }, + An_object_member_cannot_be_declared_optional: { + code: 1162, + category: 1, + key: "An object member cannot be declared optional." + }, + yield_expression_must_be_contained_within_a_generator_declaration: { + code: 1163, + category: 1, + key: "'yield' expression must be contained_within a generator declaration." + }, + Computed_property_names_are_not_allowed_in_enums: { + code: 1164, + category: 1, + key: "Computed property names are not allowed in enums." + }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { + code: 1165, + category: 1, + key: "A computed property name in an ambient context must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { + code: 1166, + category: 1, + key: "A computed property name in a class property declaration must directly refer to a built-in symbol." + }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1167, + category: 1, + key: "Computed property names are only available when targeting ECMAScript 6 and higher." + }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { + code: 1168, + category: 1, + key: "A computed property name in a method overload must directly refer to a built-in symbol." + }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { + code: 1169, + category: 1, + key: "A computed property name in an interface must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { + code: 1170, + category: 1, + key: "A computed property name in a type literal must directly refer to a built-in symbol." + }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { + code: 1171, + category: 1, + key: "A comma expression is not allowed in a computed property name." + }, + extends_clause_already_seen: { + code: 1172, + category: 1, + key: "'extends' clause already seen." + }, + extends_clause_must_precede_implements_clause: { + code: 1173, + category: 1, + key: "'extends' clause must precede 'implements' clause." + }, + Classes_can_only_extend_a_single_class: { + code: 1174, + category: 1, + key: "Classes can only extend a single class." + }, + implements_clause_already_seen: { + code: 1175, + category: 1, + key: "'implements' clause already seen." + }, + Interface_declaration_cannot_have_implements_clause: { + code: 1176, + category: 1, + key: "Interface declaration cannot have 'implements' clause." + }, + Binary_digit_expected: { + code: 1177, + category: 1, + key: "Binary digit expected." + }, + Octal_digit_expected: { + code: 1178, + category: 1, + key: "Octal digit expected." + }, + Unexpected_token_expected: { + code: 1179, + category: 1, + key: "Unexpected token. '{' expected." + }, + Property_destructuring_pattern_expected: { + code: 1180, + category: 1, + key: "Property destructuring pattern expected." + }, + Array_element_destructuring_pattern_expected: { + code: 1181, + category: 1, + key: "Array element destructuring pattern expected." + }, + A_destructuring_declaration_must_have_an_initializer: { + code: 1182, + category: 1, + key: "A destructuring declaration must have an initializer." + }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { + code: 1183, + category: 1, + key: "Destructuring declarations are not allowed in ambient contexts." + }, + An_implementation_cannot_be_declared_in_ambient_contexts: { + code: 1184, + category: 1, + key: "An implementation cannot be declared in ambient contexts." + }, + Modifiers_cannot_appear_here: { + code: 1184, + category: 1, + key: "Modifiers cannot appear here." + }, + Merge_conflict_marker_encountered: { + code: 1185, + category: 1, + key: "Merge conflict marker encountered." + }, + A_rest_element_cannot_have_an_initializer: { + code: 1186, + category: 1, + key: "A rest element cannot have an initializer." + }, + A_parameter_property_may_not_be_a_binding_pattern: { + code: 1187, + category: 1, + key: "A parameter property may not be a binding pattern." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { + code: 1188, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...of' statement." + }, + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { + code: 1189, + category: 1, + key: "The variable declaration of a 'for...in' statement cannot have an initializer." + }, + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { + code: 1190, + category: 1, + key: "The variable declaration of a 'for...of' statement cannot have an initializer." + }, + An_import_declaration_cannot_have_modifiers: { + code: 1191, + category: 1, + key: "An import declaration cannot have modifiers." + }, + External_module_0_has_no_default_export_or_export_assignment: { + code: 1192, + category: 1, + key: "External module '{0}' has no default export or export assignment." + }, + An_export_declaration_cannot_have_modifiers: { + code: 1193, + category: 1, + key: "An export declaration cannot have modifiers." + }, + Export_declarations_are_not_permitted_in_an_internal_module: { + code: 1194, + category: 1, + key: "Export declarations are not permitted in an internal module." + }, + Catch_clause_variable_name_must_be_an_identifier: { + code: 1195, + category: 1, + key: "Catch clause variable name must be an identifier." + }, + Catch_clause_variable_cannot_have_a_type_annotation: { + code: 1196, + category: 1, + key: "Catch clause variable cannot have a type annotation." + }, + Catch_clause_variable_cannot_have_an_initializer: { + code: 1197, + category: 1, + key: "Catch clause variable cannot have an initializer." + }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { + code: 1198, + category: 1, + key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." + }, + Unterminated_Unicode_escape_sequence: { + code: 1199, + category: 1, + key: "Unterminated Unicode escape sequence." + }, + Duplicate_identifier_0: { + code: 2300, + category: 1, + key: "Duplicate identifier '{0}'." + }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { + code: 2301, + category: 1, + key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." + }, + Static_members_cannot_reference_class_type_parameters: { + code: 2302, + category: 1, + key: "Static members cannot reference class type parameters." + }, + Circular_definition_of_import_alias_0: { + code: 2303, + category: 1, + key: "Circular definition of import alias '{0}'." + }, + Cannot_find_name_0: { + code: 2304, + category: 1, + key: "Cannot find name '{0}'." + }, + Module_0_has_no_exported_member_1: { + code: 2305, + category: 1, + key: "Module '{0}' has no exported member '{1}'." + }, + File_0_is_not_an_external_module: { + code: 2306, + category: 1, + key: "File '{0}' is not an external module." + }, + Cannot_find_external_module_0: { + code: 2307, + category: 1, + key: "Cannot find external module '{0}'." + }, + A_module_cannot_have_more_than_one_export_assignment: { + code: 2308, + category: 1, + key: "A module cannot have more than one export assignment." + }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { + code: 2309, + category: 1, + key: "An export assignment cannot be used in a module with other exported elements." + }, + Type_0_recursively_references_itself_as_a_base_type: { + code: 2310, + category: 1, + key: "Type '{0}' recursively references itself as a base type." + }, + A_class_may_only_extend_another_class: { + code: 2311, + category: 1, + key: "A class may only extend another class." + }, + An_interface_may_only_extend_a_class_or_another_interface: { + code: 2312, + category: 1, + key: "An interface may only extend a class or another interface." + }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { + code: 2313, + category: 1, + key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." + }, + Generic_type_0_requires_1_type_argument_s: { + code: 2314, + category: 1, + key: "Generic type '{0}' requires {1} type argument(s)." + }, + Type_0_is_not_generic: { + code: 2315, + category: 1, + key: "Type '{0}' is not generic." + }, + Global_type_0_must_be_a_class_or_interface_type: { + code: 2316, + category: 1, + key: "Global type '{0}' must be a class or interface type." + }, + Global_type_0_must_have_1_type_parameter_s: { + code: 2317, + category: 1, + key: "Global type '{0}' must have {1} type parameter(s)." + }, + Cannot_find_global_type_0: { + code: 2318, + category: 1, + key: "Cannot find global type '{0}'." + }, + Named_property_0_of_types_1_and_2_are_not_identical: { + code: 2319, + category: 1, + key: "Named property '{0}' of types '{1}' and '{2}' are not identical." + }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { + code: 2320, + category: 1, + key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." + }, + Excessive_stack_depth_comparing_types_0_and_1: { + code: 2321, + category: 1, + key: "Excessive stack depth comparing types '{0}' and '{1}'." + }, + Type_0_is_not_assignable_to_type_1: { + code: 2322, + category: 1, + key: "Type '{0}' is not assignable to type '{1}'." + }, + Property_0_is_missing_in_type_1: { + code: 2324, + category: 1, + key: "Property '{0}' is missing in type '{1}'." + }, + Property_0_is_private_in_type_1_but_not_in_type_2: { + code: 2325, + category: 1, + key: "Property '{0}' is private in type '{1}' but not in type '{2}'." + }, + Types_of_property_0_are_incompatible: { + code: 2326, + category: 1, + key: "Types of property '{0}' are incompatible." + }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { + code: 2327, + category: 1, + key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." + }, + Types_of_parameters_0_and_1_are_incompatible: { + code: 2328, + category: 1, + key: "Types of parameters '{0}' and '{1}' are incompatible." + }, + Index_signature_is_missing_in_type_0: { + code: 2329, + category: 1, + key: "Index signature is missing in type '{0}'." + }, + Index_signatures_are_incompatible: { + code: 2330, + category: 1, + key: "Index signatures are incompatible." + }, + this_cannot_be_referenced_in_a_module_body: { + code: 2331, + category: 1, + key: "'this' cannot be referenced in a module body." + }, + this_cannot_be_referenced_in_current_location: { + code: 2332, + category: 1, + key: "'this' cannot be referenced in current location." + }, + this_cannot_be_referenced_in_constructor_arguments: { + code: 2333, + category: 1, + key: "'this' cannot be referenced in constructor arguments." + }, + this_cannot_be_referenced_in_a_static_property_initializer: { + code: 2334, + category: 1, + key: "'this' cannot be referenced in a static property initializer." + }, + super_can_only_be_referenced_in_a_derived_class: { + code: 2335, + category: 1, + key: "'super' can only be referenced in a derived class." + }, + super_cannot_be_referenced_in_constructor_arguments: { + code: 2336, + category: 1, + key: "'super' cannot be referenced in constructor arguments." + }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { + code: 2337, + category: 1, + key: "Super calls are not permitted outside constructors or in nested functions inside constructors" + }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { + code: 2338, + category: 1, + key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" + }, + Property_0_does_not_exist_on_type_1: { + code: 2339, + category: 1, + key: "Property '{0}' does not exist on type '{1}'." + }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { + code: 2340, + category: 1, + key: "Only public and protected methods of the base class are accessible via the 'super' keyword" + }, + Property_0_is_private_and_only_accessible_within_class_1: { + code: 2341, + category: 1, + key: "Property '{0}' is private and only accessible within class '{1}'." + }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { + code: 2342, + category: 1, + key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." + }, + Type_0_does_not_satisfy_the_constraint_1: { + code: 2344, + category: 1, + key: "Type '{0}' does not satisfy the constraint '{1}'." + }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { + code: 2345, + category: 1, + key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." + }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { + code: 2346, + category: 1, + key: "Supplied parameters do not match any signature of call target." + }, + Untyped_function_calls_may_not_accept_type_arguments: { + code: 2347, + category: 1, + key: "Untyped function calls may not accept type arguments." + }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { + code: 2348, + category: 1, + key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" + }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { + code: 2349, + category: 1, + key: "Cannot invoke an expression whose type lacks a call signature." + }, + Only_a_void_function_can_be_called_with_the_new_keyword: { + code: 2350, + category: 1, + key: "Only a void function can be called with the 'new' keyword." + }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { + code: 2351, + category: 1, + key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." + }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { + code: 2352, + category: 1, + key: "Neither type '{0}' nor type '{1}' is assignable to the other." + }, + No_best_common_type_exists_among_return_expressions: { + code: 2354, + category: 1, + key: "No best common type exists among return expressions." + }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2355, + category: 1, + key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." + }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { + code: 2356, + category: 1, + key: "An arithmetic operand must be of type 'any', 'number' or an enum type." + }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { + code: 2357, + category: 1, + key: "The operand of an increment or decrement operator must be a variable, property or indexer." + }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2358, + category: 1, + key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." + }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { + code: 2359, + category: 1, + key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." + }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { + code: 2360, + category: 1, + key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." + }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2361, + category: 1, + key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" + }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2362, + category: 1, + key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2363, + category: 1, + key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + Invalid_left_hand_side_of_assignment_expression: { + code: 2364, + category: 1, + key: "Invalid left-hand side of assignment expression." + }, + Operator_0_cannot_be_applied_to_types_1_and_2: { + code: 2365, + category: 1, + key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." + }, + Type_parameter_name_cannot_be_0: { + code: 2368, + category: 1, + key: "Type parameter name cannot be '{0}'" + }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { + code: 2369, + category: 1, + key: "A parameter property is only allowed in a constructor implementation." + }, + A_rest_parameter_must_be_of_an_array_type: { + code: 2370, + category: 1, + key: "A rest parameter must be of an array type." + }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { + code: 2371, + category: 1, + key: "A parameter initializer is only allowed in a function or constructor implementation." + }, + Parameter_0_cannot_be_referenced_in_its_initializer: { + code: 2372, + category: 1, + key: "Parameter '{0}' cannot be referenced in its initializer." + }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { + code: 2373, + category: 1, + key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." + }, + Duplicate_string_index_signature: { + code: 2374, + category: 1, + key: "Duplicate string index signature." + }, + Duplicate_number_index_signature: { + code: 2375, + category: 1, + key: "Duplicate number index signature." + }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { + code: 2376, + category: 1, + key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." + }, + Constructors_for_derived_classes_must_contain_a_super_call: { + code: 2377, + category: 1, + key: "Constructors for derived classes must contain a 'super' call." + }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2378, + category: 1, + key: "A 'get' accessor must return a value or consist of a single 'throw' statement." + }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { + code: 2379, + category: 1, + key: "Getter and setter accessors do not agree in visibility." + }, + get_and_set_accessor_must_have_the_same_type: { + code: 2380, + category: 1, + key: "'get' and 'set' accessor must have the same type." + }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { + code: 2381, + category: 1, + key: "A signature with an implementation cannot use a string literal type." + }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { + code: 2382, + category: 1, + key: "Specialized overload signature is not assignable to any non-specialized signature." + }, + Overload_signatures_must_all_be_exported_or_not_exported: { + code: 2383, + category: 1, + key: "Overload signatures must all be exported or not exported." + }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { + code: 2384, + category: 1, + key: "Overload signatures must all be ambient or non-ambient." + }, + Overload_signatures_must_all_be_public_private_or_protected: { + code: 2385, + category: 1, + key: "Overload signatures must all be public, private or protected." + }, + Overload_signatures_must_all_be_optional_or_required: { + code: 2386, + category: 1, + key: "Overload signatures must all be optional or required." + }, + Function_overload_must_be_static: { + code: 2387, + category: 1, + key: "Function overload must be static." + }, + Function_overload_must_not_be_static: { + code: 2388, + category: 1, + key: "Function overload must not be static." + }, + Function_implementation_name_must_be_0: { + code: 2389, + category: 1, + key: "Function implementation name must be '{0}'." + }, + Constructor_implementation_is_missing: { + code: 2390, + category: 1, + key: "Constructor implementation is missing." + }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { + code: 2391, + category: 1, + key: "Function implementation is missing or not immediately following the declaration." + }, + Multiple_constructor_implementations_are_not_allowed: { + code: 2392, + category: 1, + key: "Multiple constructor implementations are not allowed." + }, + Duplicate_function_implementation: { + code: 2393, + category: 1, + key: "Duplicate function implementation." + }, + Overload_signature_is_not_compatible_with_function_implementation: { + code: 2394, + category: 1, + key: "Overload signature is not compatible with function implementation." + }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { + code: 2395, + category: 1, + key: "Individual declarations in merged declaration {0} must be all exported or all local." + }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { + code: 2396, + category: 1, + key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." + }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { + code: 2399, + category: 1, + key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." + }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { + code: 2400, + category: 1, + key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." + }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { + code: 2401, + category: 1, + key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." + }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { + code: 2402, + category: 1, + key: "Expression resolves to '_super' that compiler uses to capture base class reference." + }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { + code: 2403, + category: 1, + key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." + }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { + code: 2404, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot use a type annotation." + }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { + code: 2405, + category: 1, + key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." + }, + Invalid_left_hand_side_in_for_in_statement: { + code: 2406, + category: 1, + key: "Invalid left-hand side in 'for...in' statement." + }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2407, + category: 1, + key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." + }, + Setters_cannot_return_a_value: { + code: 2408, + category: 1, + key: "Setters cannot return a value." + }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { + code: 2409, + category: 1, + key: "Return type of constructor signature must be assignable to the instance type of the class" + }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { + code: 2410, + category: 1, + key: "All symbols within a 'with' block will be resolved to 'any'." + }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { + code: 2411, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." + }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { + code: 2412, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." + }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { + code: 2413, + category: 1, + key: "Numeric index type '{0}' is not assignable to string index type '{1}'." + }, + Class_name_cannot_be_0: { + code: 2414, + category: 1, + key: "Class name cannot be '{0}'" + }, + Class_0_incorrectly_extends_base_class_1: { + code: 2415, + category: 1, + key: "Class '{0}' incorrectly extends base class '{1}'." + }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { + code: 2417, + category: 1, + key: "Class static side '{0}' incorrectly extends base class static side '{1}'." + }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { + code: 2419, + category: 1, + key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." + }, + Class_0_incorrectly_implements_interface_1: { + code: 2420, + category: 1, + key: "Class '{0}' incorrectly implements interface '{1}'." + }, + A_class_may_only_implement_another_class_or_interface: { + code: 2422, + category: 1, + key: "A class may only implement another class or interface." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { + code: 2423, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { + code: 2424, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." + }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2425, + category: 1, + key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." + }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2426, + category: 1, + key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." + }, + Interface_name_cannot_be_0: { + code: 2427, + category: 1, + key: "Interface name cannot be '{0}'" + }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { + code: 2428, + category: 1, + key: "All declarations of an interface must have identical type parameters." + }, + Interface_0_incorrectly_extends_interface_1: { + code: 2430, + category: 1, + key: "Interface '{0}' incorrectly extends interface '{1}'." + }, + Enum_name_cannot_be_0: { + code: 2431, + category: 1, + key: "Enum name cannot be '{0}'" + }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { + code: 2432, + category: 1, + key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." + }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { + code: 2433, + category: 1, + key: "A module declaration cannot be in a different file from a class or function with which it is merged" + }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { + code: 2434, + category: 1, + key: "A module declaration cannot be located prior to a class or function with which it is merged" + }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { + code: 2435, + category: 1, + key: "Ambient external modules cannot be nested in other modules." + }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { + code: 2436, + category: 1, + key: "Ambient external module declaration cannot specify relative module name." + }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { + code: 2437, + category: 1, + key: "Module '{0}' is hidden by a local declaration with the same name" + }, + Import_name_cannot_be_0: { + code: 2438, + category: 1, + key: "Import name cannot be '{0}'" + }, + Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { + code: 2439, + category: 1, + key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." + }, + Import_declaration_conflicts_with_local_declaration_of_0: { + code: 2440, + category: 1, + key: "Import declaration conflicts with local declaration of '{0}'" + }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { + code: 2441, + category: 1, + key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." + }, + Types_have_separate_declarations_of_a_private_property_0: { + code: 2442, + category: 1, + key: "Types have separate declarations of a private property '{0}'." + }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { + code: 2443, + category: 1, + key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." + }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { + code: 2444, + category: 1, + key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." + }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { + code: 2445, + category: 1, + key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." + }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { + code: 2446, + category: 1, + key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." + }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { + code: 2447, + category: 1, + key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." + }, + Block_scoped_variable_0_used_before_its_declaration: { + code: 2448, + category: 1, + key: "Block-scoped variable '{0}' used before its declaration." + }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { + code: 2449, + category: 1, + key: "The operand of an increment or decrement operator cannot be a constant." + }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { + code: 2450, + category: 1, + key: "Left-hand side of assignment expression cannot be a constant." + }, + Cannot_redeclare_block_scoped_variable_0: { + code: 2451, + category: 1, + key: "Cannot redeclare block-scoped variable '{0}'." + }, + An_enum_member_cannot_have_a_numeric_name: { + code: 2452, + category: 1, + key: "An enum member cannot have a numeric name." + }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { + code: 2453, + category: 1, + key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." + }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { + code: 2455, + category: 1, + key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." + }, + Type_alias_0_circularly_references_itself: { + code: 2456, + category: 1, + key: "Type alias '{0}' circularly references itself." + }, + Type_alias_name_cannot_be_0: { + code: 2457, + category: 1, + key: "Type alias name cannot be '{0}'" + }, + An_AMD_module_cannot_have_multiple_name_assignments: { + code: 2458, + category: 1, + key: "An AMD module cannot have multiple name assignments." + }, + Type_0_has_no_property_1_and_no_string_index_signature: { + code: 2459, + category: 1, + key: "Type '{0}' has no property '{1}' and no string index signature." + }, + Type_0_has_no_property_1: { + code: 2460, + category: 1, + key: "Type '{0}' has no property '{1}'." + }, + Type_0_is_not_an_array_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type." + }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { + code: 2462, + category: 1, + key: "A rest element must be last in an array destructuring pattern" + }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { + code: 2463, + category: 1, + key: "A binding pattern parameter cannot be optional in an implementation signature." + }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { + code: 2464, + category: 1, + key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." + }, + this_cannot_be_referenced_in_a_computed_property_name: { + code: 2465, + category: 1, + key: "'this' cannot be referenced in a computed property name." + }, + super_cannot_be_referenced_in_a_computed_property_name: { + code: 2466, + category: 1, + key: "'super' cannot be referenced in a computed property name." + }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { + code: 2467, + category: 1, + key: "A computed property name cannot reference a type parameter from its containing type." + }, + Cannot_find_global_value_0: { + code: 2468, + category: 1, + key: "Cannot find global value '{0}'." + }, + The_0_operator_cannot_be_applied_to_type_symbol: { + code: 2469, + category: 1, + key: "The '{0}' operator cannot be applied to type 'symbol'." + }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { + code: 2470, + category: 1, + key: "'Symbol' reference does not refer to the global Symbol constructor object." + }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { + code: 2471, + category: 1, + key: "A computed property name of the form '{0}' must be of type 'symbol'." + }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 2472, + category: 1, + key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." + }, + Enum_declarations_must_all_be_const_or_non_const: { + code: 2473, + category: 1, + key: "Enum declarations must all be const or non-const." + }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { + code: 2474, + category: 1, + key: "In 'const' enum declarations member initializer must be constant expression." + }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { + code: 2475, + category: 1, + key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." + }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { + code: 2476, + category: 1, + key: "A const enum member can only be accessed using a string literal." + }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { + code: 2477, + category: 1, + key: "'const' enum member initializer was evaluated to a non-finite value." + }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { + code: 2478, + category: 1, + key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." + }, + Property_0_does_not_exist_on_const_enum_1: { + code: 2479, + category: 1, + key: "Property '{0}' does not exist on 'const' enum '{1}'." + }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { + code: 2480, + category: 1, + key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." + }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { + code: 2481, + category: 1, + key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." + }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { + code: 2483, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot use a type annotation." + }, + Export_declaration_conflicts_with_exported_declaration_of_0: { + code: 2484, + category: 1, + key: "Export declaration conflicts with exported declaration of '{0}'" + }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { + code: 2485, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { + code: 2486, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." + }, + Invalid_left_hand_side_in_for_of_statement: { + code: 2487, + category: 1, + key: "Invalid left-hand side in 'for...of' statement." + }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { + code: 2488, + category: 1, + key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." + }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { + code: 2489, + category: 1, + key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." + }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { + code: 2490, + category: 1, + key: "The type returned by the 'next()' method of an iterator must have a 'value' property." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { + code: 2491, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." + }, + Cannot_redeclare_identifier_0_in_catch_clause: { + code: 2492, + category: 1, + key: "Cannot redeclare identifier '{0}' in catch clause" + }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { + code: 2493, + category: 1, + key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." + }, + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { + code: 2494, + category: 1, + key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." + }, + Type_0_is_not_an_array_type_or_a_string_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type or a string type." + }, + Import_declaration_0_is_using_private_name_1: { + code: 4000, + category: 1, + key: "Import declaration '{0}' is using private name '{1}'." + }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4002, + category: 1, + key: "Type parameter '{0}' of exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4004, + category: 1, + key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4006, + category: 1, + key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4008, + category: 1, + key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4010, + category: 1, + key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4012, + category: 1, + key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4014, + category: 1, + key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4016, + category: 1, + key: "Type parameter '{0}' of exported function has or is using private name '{1}'." + }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4019, + category: 1, + key: "Implements clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4020, + category: 1, + key: "Extends clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { + code: 4022, + category: 1, + key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." + }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4023, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." + }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { + code: 4024, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." + }, + Exported_variable_0_has_or_is_using_private_name_1: { + code: 4025, + category: 1, + key: "Exported variable '{0}' has or is using private name '{1}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4026, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4027, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4028, + category: 1, + key: "Public static property '{0}' of exported class has or is using private name '{1}'." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4029, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4030, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4031, + category: 1, + key: "Public property '{0}' of exported class has or is using private name '{1}'." + }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4032, + category: 1, + key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." + }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4033, + category: 1, + key: "Property '{0}' of exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4034, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4035, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4036, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4037, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4038, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4039, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4040, + category: 1, + key: "Return type of public static property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4041, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4042, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4043, + category: 1, + key: "Return type of public property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4044, + category: 1, + key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4045, + category: 1, + key: "Return type of constructor signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4046, + category: 1, + key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4047, + category: 1, + key: "Return type of call signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4048, + category: 1, + key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4049, + category: 1, + key: "Return type of index signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4050, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4051, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4052, + category: 1, + key: "Return type of public static method from exported class has or is using private name '{0}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4053, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4054, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4055, + category: 1, + key: "Return type of public method from exported class has or is using private name '{0}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4056, + category: 1, + key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { + code: 4057, + category: 1, + key: "Return type of method from exported interface has or is using private name '{0}'." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4058, + category: 1, + key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { + code: 4059, + category: 1, + key: "Return type of exported function has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { + code: 4060, + category: 1, + key: "Return type of exported function has or is using private name '{0}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4061, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4062, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { + code: 4063, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4064, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4065, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4066, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4067, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4068, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4069, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4070, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4071, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4072, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4073, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4074, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4075, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4076, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { + code: 4077, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4078, + category: 1, + key: "Parameter '{0}' of exported function has or is using private name '{1}'." + }, + Exported_type_alias_0_has_or_is_using_private_name_1: { + code: 4081, + category: 1, + key: "Exported type alias '{0}' has or is using private name '{1}'." + }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { + code: 4091, + category: 1, + key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." + }, + The_current_host_does_not_support_the_0_option: { + code: 5001, + category: 1, + key: "The current host does not support the '{0}' option." + }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { + code: 5009, + category: 1, + key: "Cannot find the common subdirectory path for the input files." + }, + Cannot_read_file_0_Colon_1: { + code: 5012, + category: 1, + key: "Cannot read file '{0}': {1}" + }, + Unsupported_file_encoding: { + code: 5013, + category: 1, + key: "Unsupported file encoding." + }, + Unknown_compiler_option_0: { + code: 5023, + category: 1, + key: "Unknown compiler option '{0}'." + }, + Compiler_option_0_requires_a_value_of_type_1: { + code: 5024, + category: 1, + key: "Compiler option '{0}' requires a value of type {1}." + }, + Could_not_write_file_0_Colon_1: { + code: 5033, + category: 1, + key: "Could not write file '{0}': {1}" + }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5038, + category: 1, + key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5039, + category: 1, + key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { + code: 5040, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." + }, + Option_noEmit_cannot_be_specified_with_option_declaration: { + code: 5041, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'declaration'." + }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { + code: 5042, + category: 1, + key: "Option 'project' cannot be mixed with source files on a command line." + }, + Concatenate_and_emit_output_to_single_file: { + code: 6001, + category: 2, + key: "Concatenate and emit output to single file." + }, + Generates_corresponding_d_ts_file: { + code: 6002, + category: 2, + key: "Generates corresponding '.d.ts' file." + }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { + code: 6003, + category: 2, + key: "Specifies the location where debugger should locate map files instead of generated locations." + }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { + code: 6004, + category: 2, + key: "Specifies the location where debugger should locate TypeScript files instead of source locations." + }, + Watch_input_files: { + code: 6005, + category: 2, + key: "Watch input files." + }, + Redirect_output_structure_to_the_directory: { + code: 6006, + category: 2, + key: "Redirect output structure to the directory." + }, + Do_not_erase_const_enum_declarations_in_generated_code: { + code: 6007, + category: 2, + key: "Do not erase const enum declarations in generated code." + }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { + code: 6008, + category: 2, + key: "Do not emit outputs if any type checking errors were reported." + }, + Do_not_emit_comments_to_output: { + code: 6009, + category: 2, + key: "Do not emit comments to output." + }, + Do_not_emit_outputs: { + code: 6010, + category: 2, + key: "Do not emit outputs." + }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { + code: 6015, + category: 2, + key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" + }, + Specify_module_code_generation_Colon_commonjs_or_amd: { + code: 6016, + category: 2, + key: "Specify module code generation: 'commonjs' or 'amd'" + }, + Print_this_message: { + code: 6017, + category: 2, + key: "Print this message." + }, + Print_the_compiler_s_version: { + code: 6019, + category: 2, + key: "Print the compiler's version." + }, + Compile_the_project_in_the_given_directory: { + code: 6020, + category: 2, + key: "Compile the project in the given directory." + }, + Syntax_Colon_0: { + code: 6023, + category: 2, + key: "Syntax: {0}" + }, + options: { + code: 6024, + category: 2, + key: "options" + }, + file: { + code: 6025, + category: 2, + key: "file" + }, + Examples_Colon_0: { + code: 6026, + category: 2, + key: "Examples: {0}" + }, + Options_Colon: { + code: 6027, + category: 2, + key: "Options:" + }, + Version_0: { + code: 6029, + category: 2, + key: "Version {0}" + }, + Insert_command_line_options_and_files_from_a_file: { + code: 6030, + category: 2, + key: "Insert command line options and files from a file." + }, + File_change_detected_Starting_incremental_compilation: { + code: 6032, + category: 2, + key: "File change detected. Starting incremental compilation..." + }, + KIND: { + code: 6034, + category: 2, + key: "KIND" + }, + FILE: { + code: 6035, + category: 2, + key: "FILE" + }, + VERSION: { + code: 6036, + category: 2, + key: "VERSION" + }, + LOCATION: { + code: 6037, + category: 2, + key: "LOCATION" + }, + DIRECTORY: { + code: 6038, + category: 2, + key: "DIRECTORY" + }, + Compilation_complete_Watching_for_file_changes: { + code: 6042, + category: 2, + key: "Compilation complete. Watching for file changes." + }, + Generates_corresponding_map_file: { + code: 6043, + category: 2, + key: "Generates corresponding '.map' file." + }, + Compiler_option_0_expects_an_argument: { + code: 6044, + category: 1, + key: "Compiler option '{0}' expects an argument." + }, + Unterminated_quoted_string_in_response_file_0: { + code: 6045, + category: 1, + key: "Unterminated quoted string in response file '{0}'." + }, + Argument_for_module_option_must_be_commonjs_or_amd: { + code: 6046, + category: 1, + key: "Argument for '--module' option must be 'commonjs' or 'amd'." + }, + Argument_for_target_option_must_be_es3_es5_or_es6: { + code: 6047, + category: 1, + key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." + }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { + code: 6048, + category: 1, + key: "Locale must be of the form or -. For example '{0}' or '{1}'." + }, + Unsupported_locale_0: { + code: 6049, + category: 1, + key: "Unsupported locale '{0}'." + }, + Unable_to_open_file_0: { + code: 6050, + category: 1, + key: "Unable to open file '{0}'." + }, + Corrupted_locale_file_0: { + code: 6051, + category: 1, + key: "Corrupted locale file {0}." + }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { + code: 6052, + category: 2, + key: "Raise error on expressions and declarations with an implied 'any' type." + }, + File_0_not_found: { + code: 6053, + category: 1, + key: "File '{0}' not found." + }, + File_0_must_have_extension_ts_or_d_ts: { + code: 6054, + category: 1, + key: "File '{0}' must have extension '.ts' or '.d.ts'." + }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { + code: 6055, + category: 2, + key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." + }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { + code: 6056, + category: 2, + key: "Do not emit declarations for code that has an '@internal' annotation." + }, + Preserve_new_lines_when_emitting_code: { + code: 6057, + category: 2, + key: "Preserve new-lines when emitting code." + }, + Variable_0_implicitly_has_an_1_type: { + code: 7005, + category: 1, + key: "Variable '{0}' implicitly has an '{1}' type." + }, + Parameter_0_implicitly_has_an_1_type: { + code: 7006, + category: 1, + key: "Parameter '{0}' implicitly has an '{1}' type." + }, + Member_0_implicitly_has_an_1_type: { + code: 7008, + category: 1, + key: "Member '{0}' implicitly has an '{1}' type." + }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { + code: 7009, + category: 1, + key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." + }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { + code: 7010, + category: 1, + key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." + }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { + code: 7011, + category: 1, + key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." + }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7013, + category: 1, + key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { + code: 7016, + category: 1, + key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." + }, + Index_signature_of_object_type_implicitly_has_an_any_type: { + code: 7017, + category: 1, + key: "Index signature of object type implicitly has an 'any' type." + }, + Object_literal_s_property_0_implicitly_has_an_1_type: { + code: 7018, + category: 1, + key: "Object literal's property '{0}' implicitly has an '{1}' type." + }, + Rest_parameter_0_implicitly_has_an_any_type: { + code: 7019, + category: 1, + key: "Rest parameter '{0}' implicitly has an 'any[]' type." + }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7020, + category: 1, + key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { + code: 7021, + category: 1, + key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." + }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { + code: 7022, + category: 1, + key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." + }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7023, + category: 1, + key: "'{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." + }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7024, + category: 1, + key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." + }, + You_cannot_rename_this_element: { + code: 8000, + category: 1, + key: "You cannot rename this element." + }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { + code: 8001, + category: 1, + key: "You cannot rename elements that are defined in the standard TypeScript library." + }, + yield_expressions_are_not_currently_supported: { + code: 9000, + category: 1, + key: "'yield' expressions are not currently supported." + }, + Generators_are_not_currently_supported: { + code: 9001, + category: 1, + key: "Generators are not currently supported." + }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { + code: 9002, + category: 1, + key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." + } }; })(ts || (ts = {})); var ts; @@ -2048,10 +4013,2806 @@ var ts; "|=": 62, "^=": 63 }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1610, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1786, + 1788, + 1808, + 1808, + 1810, + 1836, + 1920, + 1957, + 2309, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2784, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3294, + 3294, + 3296, + 3297, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3424, + 3425, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3805, + 3840, + 3840, + 3904, + 3911, + 3913, + 3946, + 3976, + 3979, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4176, + 4181, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6067, + 6176, + 6263, + 6272, + 6312, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8319, + 8319, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12445, + 12446, + 12449, + 12538, + 12540, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES3IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 768, + 846, + 864, + 866, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1155, + 1158, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1441, + 1443, + 1465, + 1467, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1476, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1621, + 1632, + 1641, + 1648, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1773, + 1776, + 1788, + 1808, + 1836, + 1840, + 1866, + 1920, + 1968, + 2305, + 2307, + 2309, + 2361, + 2364, + 2381, + 2384, + 2388, + 2392, + 2403, + 2406, + 2415, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2492, + 2494, + 2500, + 2503, + 2504, + 2507, + 2509, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2562, + 2562, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2649, + 2652, + 2654, + 2654, + 2662, + 2676, + 2689, + 2691, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2784, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2876, + 2883, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2913, + 2918, + 2927, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3031, + 3031, + 3047, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3134, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3168, + 3169, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3262, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3297, + 3302, + 3311, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3390, + 3395, + 3398, + 3400, + 3402, + 3405, + 3415, + 3415, + 3424, + 3425, + 3430, + 3439, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3805, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3946, + 3953, + 3972, + 3974, + 3979, + 3984, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4140, + 4146, + 4150, + 4153, + 4160, + 4169, + 4176, + 4185, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 4969, + 4977, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6099, + 6112, + 6121, + 6160, + 6169, + 6176, + 6263, + 6272, + 6313, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8255, + 8256, + 8319, + 8319, + 8400, + 8412, + 8417, + 8417, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12441, + 12442, + 12445, + 12446, + 12449, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65056, + 65059, + 65075, + 65076, + 65101, + 65103, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65381, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 880, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1568, + 1610, + 1646, + 1647, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1774, + 1775, + 1786, + 1788, + 1791, + 1791, + 1808, + 1808, + 1810, + 1839, + 1869, + 1957, + 1969, + 1969, + 1994, + 2026, + 2036, + 2037, + 2042, + 2042, + 2048, + 2069, + 2074, + 2074, + 2084, + 2084, + 2088, + 2088, + 2112, + 2136, + 2208, + 2208, + 2210, + 2220, + 2308, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2417, + 2423, + 2425, + 2431, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2493, + 2493, + 2510, + 2510, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2785, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2929, + 2929, + 2947, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3024, + 3024, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3133, + 3160, + 3161, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3261, + 3261, + 3294, + 3294, + 3296, + 3297, + 3313, + 3314, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3389, + 3406, + 3406, + 3424, + 3425, + 3450, + 3455, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3807, + 3840, + 3840, + 3904, + 3911, + 3913, + 3948, + 3976, + 3980, + 4096, + 4138, + 4159, + 4159, + 4176, + 4181, + 4186, + 4189, + 4193, + 4193, + 4197, + 4198, + 4206, + 4208, + 4213, + 4225, + 4238, + 4238, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5905, + 5920, + 5937, + 5952, + 5969, + 5984, + 5996, + 5998, + 6000, + 6016, + 6067, + 6103, + 6103, + 6108, + 6108, + 6176, + 6263, + 6272, + 6312, + 6314, + 6314, + 6320, + 6389, + 6400, + 6428, + 6480, + 6509, + 6512, + 6516, + 6528, + 6571, + 6593, + 6599, + 6656, + 6678, + 6688, + 6740, + 6823, + 6823, + 6917, + 6963, + 6981, + 6987, + 7043, + 7072, + 7086, + 7087, + 7098, + 7141, + 7168, + 7203, + 7245, + 7247, + 7258, + 7293, + 7401, + 7404, + 7406, + 7409, + 7413, + 7414, + 7424, + 7615, + 7680, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11502, + 11506, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11648, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11823, + 11823, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42527, + 42538, + 42539, + 42560, + 42606, + 42623, + 42647, + 42656, + 42735, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43009, + 43011, + 43013, + 43015, + 43018, + 43020, + 43042, + 43072, + 43123, + 43138, + 43187, + 43250, + 43255, + 43259, + 43259, + 43274, + 43301, + 43312, + 43334, + 43360, + 43388, + 43396, + 43442, + 43471, + 43471, + 43520, + 43560, + 43584, + 43586, + 43588, + 43595, + 43616, + 43638, + 43642, + 43642, + 43648, + 43695, + 43697, + 43697, + 43701, + 43702, + 43705, + 43709, + 43712, + 43712, + 43714, + 43714, + 43739, + 43741, + 43744, + 43754, + 43762, + 43764, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44002, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 768, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1155, + 1159, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1477, + 1479, + 1479, + 1488, + 1514, + 1520, + 1522, + 1552, + 1562, + 1568, + 1641, + 1646, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1788, + 1791, + 1791, + 1808, + 1866, + 1869, + 1969, + 1984, + 2037, + 2042, + 2042, + 2048, + 2093, + 2112, + 2139, + 2208, + 2208, + 2210, + 2220, + 2276, + 2302, + 2304, + 2403, + 2406, + 2415, + 2417, + 2423, + 2425, + 2431, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2500, + 2503, + 2504, + 2507, + 2510, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2561, + 2563, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2641, + 2641, + 2649, + 2652, + 2654, + 2654, + 2662, + 2677, + 2689, + 2691, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2787, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2876, + 2884, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2915, + 2918, + 2927, + 2929, + 2929, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3024, + 3024, + 3031, + 3031, + 3046, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3160, + 3161, + 3168, + 3171, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3260, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3299, + 3302, + 3311, + 3313, + 3314, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3396, + 3398, + 3400, + 3402, + 3406, + 3415, + 3415, + 3424, + 3427, + 3430, + 3439, + 3450, + 3455, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3807, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3948, + 3953, + 3972, + 3974, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4169, + 4176, + 4253, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4957, + 4959, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5908, + 5920, + 5940, + 5952, + 5971, + 5984, + 5996, + 5998, + 6000, + 6002, + 6003, + 6016, + 6099, + 6103, + 6103, + 6108, + 6109, + 6112, + 6121, + 6155, + 6157, + 6160, + 6169, + 6176, + 6263, + 6272, + 6314, + 6320, + 6389, + 6400, + 6428, + 6432, + 6443, + 6448, + 6459, + 6470, + 6509, + 6512, + 6516, + 6528, + 6571, + 6576, + 6601, + 6608, + 6617, + 6656, + 6683, + 6688, + 6750, + 6752, + 6780, + 6783, + 6793, + 6800, + 6809, + 6823, + 6823, + 6912, + 6987, + 6992, + 7001, + 7019, + 7027, + 7040, + 7155, + 7168, + 7223, + 7232, + 7241, + 7245, + 7293, + 7376, + 7378, + 7380, + 7414, + 7424, + 7654, + 7676, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8204, + 8205, + 8255, + 8256, + 8276, + 8276, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8400, + 8412, + 8417, + 8417, + 8421, + 8432, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11647, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11744, + 11775, + 11823, + 11823, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12441, + 12442, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42539, + 42560, + 42607, + 42612, + 42621, + 42623, + 42647, + 42655, + 42737, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43047, + 43072, + 43123, + 43136, + 43204, + 43216, + 43225, + 43232, + 43255, + 43259, + 43259, + 43264, + 43309, + 43312, + 43347, + 43360, + 43388, + 43392, + 43456, + 43471, + 43481, + 43520, + 43574, + 43584, + 43597, + 43600, + 43609, + 43616, + 43638, + 43642, + 43643, + 43648, + 43714, + 43739, + 43741, + 43744, + 43759, + 43762, + 43766, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44010, + 44012, + 44013, + 44016, + 44025, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65024, + 65039, + 65056, + 65062, + 65075, + 65076, + 65101, + 65103, + 65136, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -2075,15 +6836,11 @@ var ts; return false; } function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierStart) : - lookupInUnicodeMap(code, unicodeES3IdentifierStart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierPart) : - lookupInUnicodeMap(code, unicodeES3IdentifierPart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } function makeReverseMap(source) { var result = []; @@ -2156,9 +6913,7 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { @@ -2245,8 +7000,7 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -2326,7 +7080,11 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ + pos: startPos, + end: pos, + hasTrailingNewLine: hasTrailingNewLine + }); } continue; } @@ -2353,15 +7111,11 @@ var ts; } ts.getTrailingCommentRanges = getTrailingCommentRanges; function isIdentifierStart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } ts.isIdentifierStart = isIdentifierStart; function isIdentifierPart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; function createScanner(languageVersion, skipTrivia, text, onError) { @@ -2380,14 +7134,10 @@ var ts; } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } function isIdentifierPart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; @@ -3110,17 +7860,39 @@ var ts; } setText(text); return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, - isUnterminated: function () { return tokenIsUnterminated; }, + getStartPos: function () { + return startPos; + }, + getTextPos: function () { + return pos; + }, + getToken: function () { + return token; + }, + getTokenPos: function () { + return tokenPos; + }, + getTokenText: function () { + return text.substring(tokenPos, pos); + }, + getTokenValue: function () { + return tokenValue; + }, + hasExtendedUnicodeEscape: function () { + return hasExtendedUnicodeEscape; + }, + hasPrecedingLineBreak: function () { + return precedingLineBreak; + }, + isIdentifier: function () { + return token === 64 || token > 100; + }, + isReservedWord: function () { + return token >= 65 && token <= 100; + }, + isUnterminated: function () { + return tokenIsUnterminated; + }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3150,9 +7922,13 @@ var ts; function getSingleLineStringWriter() { if (stringWriters.length == 0) { var str = ""; - var writeText = function (text) { return str += text; }; + var writeText = function (text) { + return str += text; + }; return { - string: function () { return str; }, + string: function () { + return str; + }, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, @@ -3160,11 +7936,18 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, - writeLine: function () { return str += " "; }, - increaseIndent: function () { }, - decreaseIndent: function () { }, - clear: function () { return str = ""; }, - trackSymbol: function () { } + writeLine: function () { + return str += " "; + }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { + return str = ""; + }, + trackSymbol: function () { + } }; } return stringWriters.pop(); @@ -3186,8 +7969,7 @@ var ts; ts.containsParseError = containsParseError; function aggregateChildData(node) { if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || - ts.forEachChild(node, containsParseError); + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { node.parserContextFlags |= 32; } @@ -3195,7 +7977,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 220) { + while (node && node.kind !== 221) { node = node.parent; } return node; @@ -3266,15 +8048,35 @@ var ts; } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || - isCatchClauseVariableDeclaration(declaration); + return (getCombinedNodeFlags(declaration) & 12288) !== 0 || isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function getEnclosingBlockScopeContainer(node) { + var current = node; + while (current) { + if (isFunctionLike(current)) { + return current; + } + switch (current.kind) { + case 221: + case 202: + case 217: + case 200: + case 181: + case 182: + case 183: + return current; + case 174: + if (!isFunctionLike(current.parent)) { + return current; + } + } + current = current.parent; + } + } + ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && - declaration.kind === 193 && - declaration.parent && - declaration.parent.kind === 216; + return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3317,7 +8119,7 @@ var ts; case 197: case 200: case 199: - case 219: + case 220: case 195: case 160: errorNode = node.name; @@ -3326,9 +8128,7 @@ var ts; if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); + var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); return createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -3391,9 +8191,7 @@ var ts; function getJsDocComments(node, sourceFileOfNode) { return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), isJsDocComment); function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; } } ts.getJsDocComments = getJsDocComments; @@ -3404,6 +8202,7 @@ var ts; switch (node.kind) { case 186: return visitor(node); + case 202: case 174: case 178: case 179: @@ -3413,11 +8212,11 @@ var ts; case 183: case 187: case 188: - case 213: case 214: + case 215: case 189: case 191: - case 216: + case 217: return ts.forEachChild(node, traverse); } } @@ -3427,12 +8226,12 @@ var ts; if (node) { switch (node.kind) { case 150: - case 219: + case 220: case 128: - case 217: + case 218: case 130: case 129: - case 218: + case 219: case 193: return true; } @@ -3510,7 +8309,7 @@ var ts; case 134: case 135: case 199: - case 220: + case 221: return node; } } @@ -3601,8 +8400,8 @@ var ts; case 128: case 130: case 129: - case 219: - case 217: + case 220: + case 218: case 150: return parent.initializer === node; case 177: @@ -3612,20 +8411,17 @@ var ts; case 186: case 187: case 188: - case 213: + case 214: case 190: case 188: return parent.expression === node; case 181: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; case 182: case 183: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || - forInStatement.expression === node; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || forInStatement.expression === node; case 158: return node === parent.expression; case 173: @@ -3643,12 +8439,11 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 || (preserveConstEnums && moduleState === 2); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind === 212; + return node.kind === 203 && node.moduleReference.kind === 213; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3657,20 +8452,20 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind !== 212; + return node.kind === 203 && node.moduleReference.kind !== 213; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 203) { + if (node.kind === 204) { return node.moduleSpecifier; } - if (node.kind === 202) { + if (node.kind === 203) { var reference = node.moduleReference; - if (reference.kind === 212) { + if (reference.kind === 213) { return reference.expression; } } - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } } @@ -3687,8 +8482,8 @@ var ts; case 132: case 131: return node.questionToken !== undefined; + case 219: case 218: - case 217: case 130: case 129: return node.questionToken !== undefined; @@ -3734,25 +8529,25 @@ var ts; case 196: case 133: case 199: - case 219: - case 211: + case 220: + case 212: case 195: case 160: case 134: - case 204: - case 202: - case 207: + case 205: + case 203: + case 208: case 197: case 132: case 131: case 200: - case 205: + case 206: case 128: - case 217: + case 218: case 130: case 129: case 135: - case 218: + case 219: case 198: case 127: case 193: @@ -3781,7 +8576,7 @@ var ts; case 175: case 180: case 187: - case 208: + case 209: return true; default: return false; @@ -3793,7 +8588,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 207 || parent.kind === 211) { + if (parent.kind === 208 || parent.kind === 212) { if (parent.propertyName) { return true; } @@ -3891,9 +8686,7 @@ var ts; } ts.isTrivia = isTrivia; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 126 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && declaration.name.kind === 126 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { @@ -3997,7 +8790,10 @@ var ts; if (length < 0) { throw new Error("length < 0"); } - return { start: start, length: length }; + return { + start: start, + length: length + }; } ts.createTextSpan = createTextSpan; function createTextSpanFromBounds(start, end) { @@ -4016,7 +8812,10 @@ var ts; if (newLength < 0) { throw new Error("newLength < 0"); } - return { span: span, newLength: newLength }; + return { + span: span, + newLength: newLength + }; } ts.createTextChangeRange = createTextChangeRange; ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); @@ -4047,11 +8846,11 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 220; + return isFunctionLike(n) || n.kind === 200 || n.kind === 221; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { - return node.pos === -1 && node.end === -1; + return node.pos === -1; } ts.nodeIsSynthesized = nodeIsSynthesized; function createSynthesizedNode(kind, startsOnNewLine) { @@ -4177,15 +8976,15 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; + return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { + return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + }) : s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(222); + var nodeConstructors = new Array(223); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4223,35 +9022,23 @@ var ts; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { case 125: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); case 127: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.constraint) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); case 128: case 130: case 129: - case 217: case 218: + case 219: case 193: case 150: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.dotDotDotToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); case 140: case 141: case 136: case 137: case 138: - return visitNodes(cbNodes, node.modifiers) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); case 132: case 131: case 133: @@ -4260,17 +9047,9 @@ var ts; case 160: case 195: case 161: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); case 139: - return visitNode(cbNode, node.typeName) || - visitNodes(cbNodes, node.typeArguments); + return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); case 142: return visitNode(cbNode, node.exprName); case 143: @@ -4291,23 +9070,16 @@ var ts; case 152: return visitNodes(cbNodes, node.properties); case 153: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.dotToken) || - visitNode(cbNode, node.name); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); case 154: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); case 155: case 156: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments) || - visitNodes(cbNodes, node.arguments); + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); case 157: - return visitNode(cbNode, node.tag) || - visitNode(cbNode, node.template); + return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); case 158: - return visitNode(cbNode, node.type) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); case 159: return visitNode(cbNode, node.expression); case 162: @@ -4319,149 +9091,100 @@ var ts; case 165: return visitNode(cbNode, node.operand); case 170: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); case 166: return visitNode(cbNode, node.operand); case 167: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.operatorToken) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); case 168: - return visitNode(cbNode, node.condition) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.whenTrue) || - visitNode(cbNode, node.colonToken) || - visitNode(cbNode, node.whenFalse); + return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); case 171: return visitNode(cbNode, node.expression); case 174: case 201: return visitNodes(cbNodes, node.statements); - case 220: - return visitNodes(cbNodes, node.statements) || - visitNode(cbNode, node.endOfFileToken); + case 221: + return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); case 175: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.declarationList); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); case 194: return visitNodes(cbNodes, node.declarations); case 177: return visitNode(cbNode, node.expression); case 178: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.thenStatement) || - visitNode(cbNode, node.elseStatement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); case 179: - return visitNode(cbNode, node.statement) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); case 180: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 181: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 184: case 185: return visitNode(cbNode, node.label); case 186: return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 188: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.clauses); - case 213: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); + case 202: + return visitNodes(cbNodes, node.clauses); case 214: + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); + case 215: return visitNodes(cbNodes, node.statements); case 189: - return visitNode(cbNode, node.label) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); case 190: return visitNode(cbNode, node.expression); case 191: - return visitNode(cbNode, node.tryBlock) || - visitNode(cbNode, node.catchClause) || - visitNode(cbNode, node.finallyBlock); - case 216: - return visitNode(cbNode, node.variableDeclaration) || - visitNode(cbNode, node.block); + return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); + case 217: + return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 196: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 197: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 198: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); case 199: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 219: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); + case 220: + return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.body); - case 202: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.moduleReference); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); case 203: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.importClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); case 204: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.namedBindings); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); case 206: - case 210: - return visitNodes(cbNodes, node.elements); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.exportClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNode(cbNode, node.name); case 207: case 211: - return visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.elements); + case 210: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); case 208: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); + case 212: + return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + case 209: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 126: return visitNode(cbNode, node.expression); - case 215: + case 216: return visitNodes(cbNodes, node.types); - case 212: + case 213: return visitNode(cbNode, node.expression); } } @@ -4499,40 +9222,69 @@ var ts; })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0: return ts.Diagnostics.Declaration_or_statement_expected; - case 1: return ts.Diagnostics.Declaration_or_statement_expected; - case 2: return ts.Diagnostics.Statement_expected; - case 3: return ts.Diagnostics.case_or_default_expected; - case 4: return ts.Diagnostics.Statement_expected; - case 5: return ts.Diagnostics.Property_or_signature_expected; - case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; - case 9: return ts.Diagnostics.Variable_declaration_expected; - case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; - case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; - case 12: return ts.Diagnostics.Argument_expression_expected; - case 13: return ts.Diagnostics.Property_assignment_expected; - case 14: return ts.Diagnostics.Expression_or_comma_expected; - case 15: return ts.Diagnostics.Parameter_declaration_expected; - case 16: return ts.Diagnostics.Type_parameter_declaration_expected; - case 17: return ts.Diagnostics.Type_argument_expected; - case 18: return ts.Diagnostics.Type_expected; - case 19: return ts.Diagnostics.Unexpected_token_expected; - case 20: return ts.Diagnostics.Identifier_expected; + case 0: + return ts.Diagnostics.Declaration_or_statement_expected; + case 1: + return ts.Diagnostics.Declaration_or_statement_expected; + case 2: + return ts.Diagnostics.Statement_expected; + case 3: + return ts.Diagnostics.case_or_default_expected; + case 4: + return ts.Diagnostics.Statement_expected; + case 5: + return ts.Diagnostics.Property_or_signature_expected; + case 6: + return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7: + return ts.Diagnostics.Enum_member_expected; + case 8: + return ts.Diagnostics.Type_reference_expected; + case 9: + return ts.Diagnostics.Variable_declaration_expected; + case 10: + return ts.Diagnostics.Property_destructuring_pattern_expected; + case 11: + return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 12: + return ts.Diagnostics.Argument_expression_expected; + case 13: + return ts.Diagnostics.Property_assignment_expected; + case 14: + return ts.Diagnostics.Expression_or_comma_expected; + case 15: + return ts.Diagnostics.Parameter_declaration_expected; + case 16: + return ts.Diagnostics.Type_parameter_declaration_expected; + case 17: + return ts.Diagnostics.Type_argument_expected; + case 18: + return ts.Diagnostics.Type_expected; + case 19: + return ts.Diagnostics.Unexpected_token_expected; + case 20: + return ts.Diagnostics.Identifier_expected; } } ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 109: + return 128; + case 108: + return 16; + case 107: + return 64; + case 106: + return 32; + case 77: + return 1; + case 114: + return 2; + case 69: + return 8192; + case 72: + return 256; } return 0; } @@ -4763,8 +9515,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && - (node.text === "eval" || node.text === "arguments"); + return node.kind === 64 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; function isUseStrictPrologueDirective(sourceFile, node) { @@ -4850,7 +9601,7 @@ var ts; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(220, 0); + var sourceFile = createNode(221, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4986,9 +9737,7 @@ var ts; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; var saveContextFlags = contextFlags; - var result = isLookAhead - ? scanner.lookAhead(callback) - : scanner.tryScan(callback); + var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); if (!result || isLookAhead) { token = saveToken; @@ -5039,8 +9788,7 @@ var ts; return undefined; } function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { - return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + return parseOptionalToken(t) || createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); } function parseTokenNode() { var node = createNode(token); @@ -5117,9 +9865,7 @@ var ts; return createIdentifier(isIdentifierOrKeyword()); } function isLiteralPropertyName() { - return isIdentifierOrKeyword() || - token === 8 || - token === 7; + return isIdentifierOrKeyword() || token === 8 || token === 7; } function parsePropertyName() { if (token === 8 || token === 7) { @@ -5172,10 +9918,7 @@ var ts; return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 - || isLiteralPropertyName(); + return token === 18 || token === 14 || token === 35 || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); @@ -5233,8 +9976,7 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { + if (token === 102 || token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -5400,10 +10142,10 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 196: case 197: case 200: @@ -5431,8 +10173,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 213: case 214: + case 215: return true; } } @@ -5467,7 +10209,7 @@ var ts; return false; } function isReusableEnumMember(node) { - return node.kind === 219; + return node.kind === 220; } function isReusableTypeMember(node) { if (node) { @@ -5615,9 +10357,7 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + if (node.kind === 7 && sourceText.charCodeAt(tokenPos) === 48 && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { node.flags |= 16384; } return node; @@ -5656,9 +10396,7 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 - ? parseLiteralNode(true) - : parseType(); + return token === 8 ? parseLiteralNode(true) : parseType(); } return undefined; } @@ -5816,11 +10554,7 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || - canParseSemicolon(); + return token === 16 || token === 24 || token === 50 || token === 51 || canParseSemicolon(); } function parseTypeMember() { switch (token) { @@ -5828,9 +10562,7 @@ var ts; case 24: return parseSignatureMember(136); case 18: - return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) - : parsePropertyOrMethodSignature(); + return isIndexSignature() ? parseIndexSignatureDeclaration(undefined) : parsePropertyOrMethodSignature(); case 87: if (lookAhead(isStartOfConstructSignature)) { return parseSignatureMember(137); @@ -5852,9 +10584,7 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) - : undefined; + return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -5960,7 +10690,9 @@ var ts; function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); if (token === 44) { - var types = [type]; + var types = [ + type + ]; types.pos = type.pos; while (parseOptional(44)) { types.push(parseArrayTypeOrHigher()); @@ -5985,9 +10717,7 @@ var ts; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 52 || - isIdentifier() || ts.isModifier(token)) { + if (token === 51 || token === 23 || token === 50 || token === 52 || isIdentifier() || ts.isModifier(token)) { return true; } if (token === 17) { @@ -6115,8 +10845,7 @@ var ts; function parseYieldExpression() { var node = createNode(170); nextToken(); - if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { + if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { node.asteriskToken = parseOptionalToken(35); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -6131,7 +10860,9 @@ var ts; var parameter = createNode(128, identifier.pos); parameter.name = identifier; finishNode(parameter); - node.parameters = [parameter]; + node.parameters = [ + parameter + ]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; parseExpected(32); @@ -6143,9 +10874,7 @@ var ts; if (triState === 0) { return undefined; } - var arrowFunction = triState === 1 - ? parseParenthesizedArrowFunctionExpressionHead(true) - : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); + var arrowFunction = triState === 1 ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { return undefined; } @@ -6367,9 +11096,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 - ? parseSuperExpression() - : parseMemberExpressionOrHigher(); + var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -6423,9 +11150,7 @@ var ts; if (token === 10 || token === 11) { var tagExpression = createNode(157, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 - ? parseLiteralNode() - : parseTemplateExpression(); + tagExpression.template = token === 10 ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); continue; } @@ -6471,9 +11196,7 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() - ? typeArguments - : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -6548,9 +11271,7 @@ var ts; return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : - parseAssignmentExpressionOrHigher(); + return token === 21 ? parseSpreadElement() : token === 23 ? createNode(172) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return allowInAnd(parseArgumentOrArrayLiteralElement); @@ -6589,13 +11310,13 @@ var ts; return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(218, fullStart); + var shorthandDeclaration = createNode(219, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(217, fullStart); + var propertyAssignment = createNode(218, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6761,7 +11482,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(213); + var node = createNode(214); parseExpected(66); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -6769,7 +11490,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(214); + var node = createNode(215); parseExpected(72); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -6784,9 +11505,11 @@ var ts; parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); + var caseBlock = createNode(202, scanner.getStartPos()); parseExpected(14); - node.clauses = parseList(3, false, parseCaseOrDefaultClause); + caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); + node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { @@ -6808,7 +11531,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(216); + var result = createNode(217); parseExpected(67); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -7198,11 +11921,7 @@ var ts; if (isIndexSignature()) { return parseIndexSignatureDeclaration(modifiers); } - if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { + if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { return parsePropertyOrMethodDeclaration(fullStart, modifiers); } ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -7215,9 +11934,7 @@ var ts; node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { - node.members = inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseClassMembers) - : parseClassMembers(); + node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); parseExpected(15); } else { @@ -7227,9 +11944,7 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseHeritageClausesWorker) - : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); } return undefined; } @@ -7238,7 +11953,7 @@ var ts; } function parseHeritageClause() { if (token === 78 || token === 102) { - var node = createNode(215); + var node = createNode(216); node.token = token; nextToken(); node.types = parseDelimitedList(8, parseTypeReference); @@ -7273,7 +11988,7 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(220, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); @@ -7308,9 +12023,7 @@ var ts; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) - : parseModuleBlock(); + node.body = parseOptional(20) ? parseInternalModuleTail(getNodePos(), undefined, 1) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { @@ -7322,21 +12035,17 @@ var ts; } function parseModuleDeclaration(fullStart, modifiers) { parseExpected(116); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + return token === 8 ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && - lookAhead(nextTokenIsOpenParen); + return token === 117 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { return nextToken() === 16; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 123; + return token === 23 || token === 123; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { parseExpected(84); @@ -7345,7 +12054,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(202, fullStart); + var importEqualsDeclaration = createNode(203, fullStart); setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; parseExpected(52); @@ -7354,11 +12063,9 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(203, fullStart); + var importDeclaration = createNode(204, fullStart); setModifiers(importDeclaration, modifiers); - if (identifier || - token === 35 || - token === 14) { + if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(123); } @@ -7367,23 +12074,20 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(204, fullStart); + var importClause = createNode(205, fullStart); if (identifier) { importClause.name = identifier; } - if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(206); + if (!importClause.name || parseOptional(23)) { + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); } return finishNode(importClause); } function parseModuleReference() { - return isExternalModuleReference() - ? parseExternalModuleReference() - : parseEntityName(false); + return isExternalModuleReference() ? parseExternalModuleReference() : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(212); + var node = createNode(213); parseExpected(117); parseExpected(16); node.expression = parseModuleSpecifier(); @@ -7398,7 +12102,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(205); + var namespaceImport = createNode(206); parseExpected(35); parseExpected(101); namespaceImport.name = parseIdentifier(); @@ -7406,14 +12110,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 206 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(211); + return parseImportOrExportSpecifier(212); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(207); + return parseImportOrExportSpecifier(208); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -7439,14 +12143,14 @@ var ts; return finishNode(node); } function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(209, fullStart); + var node = createNode(210, fullStart); setModifiers(node, modifiers); if (parseOptional(35)) { parseExpected(123); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(210); + node.exportClause = parseNamedImportsOrExports(211); if (parseOptional(123)) { node.moduleSpecifier = parseModuleSpecifier(); } @@ -7455,7 +12159,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, modifiers) { - var node = createNode(208, fullStart); + var node = createNode(209, fullStart); setModifiers(node, modifiers); if (parseOptional(52)) { node.isExportEquals = true; @@ -7510,13 +12214,11 @@ var ts; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 || token === 35 || token === 14; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 52 || token === 35 || token === 14 || token === 72 || isDeclarationStart(); } function nextTokenIsDeclarationStart() { nextToken(); @@ -7570,9 +12272,7 @@ var ts; return parseSourceElementOrModuleElement(); } function parseSourceElementOrModuleElement() { - return isDeclarationStart() - ? parseDeclaration() - : parseStatement(); + return isDeclarationStart() ? parseDeclaration() : parseStatement(); } function processReferenceComments(sourceFile) { var triviaScanner = ts.createScanner(sourceFile.languageVersion, false, sourceText); @@ -7587,7 +12287,10 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos() + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -7618,7 +12321,10 @@ var ts; var pathMatchResult = pathRegex.exec(comment); var nameMatchResult = nameRegex.exec(comment); if (pathMatchResult) { - var amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; + var amdDependency = { + path: pathMatchResult[2], + name: nameMatchResult ? nameMatchResult[2] : undefined + }; amdDependencies.push(amdDependency); } } @@ -7630,13 +12336,7 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 202 && node.moduleReference.kind === 212 - || node.kind === 203 - || node.kind === 208 - || node.kind === 209 - ? node - : undefined; + return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; }); } } @@ -7690,7 +12390,7 @@ var ts; else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 203 || node.kind === 202) && !(node.flags & 1)) { + else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { return 0; } else if (node.kind === 201) { @@ -7783,9 +12483,9 @@ var ts; return "__new"; case 138: return "__index"; - case 209: + case 210: return "__export"; - case 208: + case 209: return "default"; case 195: case 196: @@ -7804,9 +12504,7 @@ var ts; if (node.name) { node.name.parent = node; } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; + var message = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); }); @@ -7843,7 +12541,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 211 || (node.kind === 202 && hasExportModifier)) { + if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -7852,9 +12550,7 @@ var ts; } else { if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); node.localSymbol = local; @@ -7880,7 +12576,7 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 220); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); } ts.forEachChild(node, bind); container = saveContainer; @@ -7892,7 +12588,7 @@ var ts; case 200: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -7970,7 +12666,7 @@ var ts; case 200: declareModuleMember(node, 2, 107455); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, 2, 107455); break; @@ -8011,11 +12707,11 @@ var ts; case 129: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 217: case 218: + case 219: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 219: + case 220: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; case 136: @@ -8053,7 +12749,7 @@ var ts; case 161: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 216: + case 217: bindCatchVariableDeclaration(node); break; case 196: @@ -8076,13 +12772,13 @@ var ts; case 200: bindModuleDeclaration(node); break; - case 202: - case 205: - case 207: - case 211: + case 203: + case 206: + case 208: + case 212: bindDeclaration(node, 8388608, 8388608, false); break; - case 204: + case 205: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -8090,13 +12786,13 @@ var ts; bindChildren(node, 0, false); } break; - case 209: + case 210: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 208: + case 209: if (node.expression.kind === 64) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); } @@ -8105,7 +12801,7 @@ var ts; } bindChildren(node, 0, false); break; - case 220: + case 221: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; @@ -8113,11 +12809,11 @@ var ts; case 174: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 216: + case 217: case 181: case 182: case 183: - case 188: + case 202: bindChildren(node, 0, true); break; default: @@ -8134,9 +12830,7 @@ var ts; else { bindDeclaration(node, 1, 107455, false); } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { + if (node.flags & 112 && node.parent.kind === 133 && node.parent.parent.kind === 196) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -8168,12 +12862,24 @@ var ts; var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); var checker = { - getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getNodeCount: function () { + return ts.sum(host.getSourceFiles(), "nodeCount"); + }, + getIdentifierCount: function () { + return ts.sum(host.getSourceFiles(), "identifierCount"); + }, + getSymbolCount: function () { + return ts.sum(host.getSourceFiles(), "symbolCount"); + }, + getTypeCount: function () { + return typeCount; + }, + isUndefinedSymbol: function (symbol) { + return symbol === undefinedSymbol; + }, + isArgumentsSymbol: function (symbol) { + return symbol === argumentsSymbol; + }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, @@ -8269,9 +12975,7 @@ var ts; return emitResolver; } function error(location, message, arg0, arg1, arg2) { - var diagnostic = location - ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) - : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); diagnostics.add(diagnostic); } function createSymbol(flags, name) { @@ -8357,8 +13061,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); }); @@ -8405,10 +13108,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 220); + return ts.getAncestor(node, 221); } function isGlobalSourceFile(node) { - return node.kind === 220 && !ts.isExternalModule(node); + return node.kind === 221 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8449,12 +13152,12 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 211)) { + if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { break loop; } result = undefined; @@ -8538,28 +13241,54 @@ var ts; return undefined; } if (result.flags & 2) { - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); - } + checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert((result.flags & 2) !== 0); + var declaration = ts.forEach(result.declarations, function (d) { + return ts.isBlockOrCatchScoped(d) ? d : undefined; + }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); + if (!isUsedBeforeDeclaration) { + var variableDeclaration = ts.getAncestor(declaration, 193); + var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); + if (variableDeclaration.parent.parent.kind === 175 || variableDeclaration.parent.parent.kind === 181) { + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); + } + else if (variableDeclaration.parent.parent.kind === 183 || variableDeclaration.parent.parent.kind === 182) { + var expression = variableDeclaration.parent.parent.expression; + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); + } + } + if (isUsedBeforeDeclaration) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + if (!parent) { + return false; + } + for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { + if (current === parent) { + return true; + } + } + return false; + } function isAliasSymbolDeclaration(node) { - return node.kind === 202 || - node.kind === 204 && !!node.name || - node.kind === 205 || - node.kind === 207 || - node.kind === 211 || - node.kind === 208; + return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { + return isAliasSymbolDeclaration(d) ? d : undefined; + }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 212) { + if (node.moduleReference.kind === 213) { var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); return exportAssignmentSymbol || moduleSymbol; @@ -8597,26 +13326,24 @@ var ts; return getExternalModuleMember(node.parent.parent.parent, node); } function getTargetOfExportSpecifier(node) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { return resolveEntityName(node.expression, 107455 | 793056 | 1536); } function getTargetOfImportDeclaration(node) { switch (node.kind) { - case 202: + case 203: return getTargetOfImportEqualsDeclaration(node); - case 204: - return getTargetOfImportClause(node); case 205: + return getTargetOfImportClause(node); + case 206: return getTargetOfNamespaceImport(node); - case 207: + case 208: return getTargetOfImportSpecifier(node); - case 211: + case 212: return getTargetOfExportSpecifier(node); - case 208: + case 209: return getTargetOfExportAssignment(node); } } @@ -8651,10 +13378,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 208) { + if (node.kind === 209) { checkExpressionCached(node.expression); } - else if (node.kind === 211) { + else if (node.kind === 212) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8664,7 +13391,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 202); + importDeclaration = ts.getAncestor(entityName, 203); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -8674,7 +13401,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 202); + ts.Debug.assert(entityName.parent.kind === 203); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8814,9 +13541,7 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 - ? getMergedSymbol(symbol.exportSymbol) - : symbol; + return symbol && (symbol.flags & 1048576) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { if (symbol.flags & 16777216) { @@ -8855,10 +13580,7 @@ var ts; return type; } function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 && - name.charCodeAt(1) === 95 && - name.charCodeAt(2) !== 95 && - name.charCodeAt(2) !== 64; + return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && name.charCodeAt(2) !== 95 && name.charCodeAt(2) !== 64; } function getNamedMembers(members) { var result; @@ -8899,7 +13621,7 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) { break; } @@ -8932,24 +13654,28 @@ var ts; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; + return [ + symbol + ]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; + return [ + symbolFromSymbolTable + ]; } var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + return [ + symbolFromSymbolTable + ].concat(accessibleSymbolsFromExports); } } } @@ -9014,7 +13740,9 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { + accessibility: 0 + }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -9024,20 +13752,22 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 220 && ts.isExternalModule(declaration)); + return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + if (ts.forEach(symbol.declarations, function (declaration) { + return !getIsDeclarationVisible(declaration); + })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { + accessibility: 0, + aliasesToMakeVisible: aliasesToMakeVisible + }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 202 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 203 && !(declaration.flags & 1) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9045,7 +13775,9 @@ var ts; } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [ + declaration + ]; } return true; } @@ -9059,8 +13791,7 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 202) { + else if (entityName.kind === 125 || entityName.parent.kind === 203) { meaning = 1536; } else { @@ -9146,8 +13877,7 @@ var ts; function walkSymbol(symbol, meaning) { if (symbol) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { @@ -9179,8 +13909,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + writer.writeKeyword(!(globalFlags & 16) && (type.flags & 1) ? "any" : type.intrinsicName); } else if (type.flags & 4096) { writeTypeReference(type, flags); @@ -9273,16 +14002,14 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && - ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && - (type.symbol.parent || - ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 220 || declaration.parent.kind === 201; - })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.flags & 128; + })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.parent.kind === 221 || declaration.parent.kind === 201; + })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + return !!(flags & 2) || (typeStack && ts.contains(typeStack, type)); } } } @@ -9512,7 +14239,7 @@ var ts; return node; } } - else if (node.kind === 220) { + else if (node.kind === 221) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9562,10 +14289,9 @@ var ts; case 198: case 195: case 199: - case 202: + case 203: var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 202 && parent.kind !== 220 && ts.isInAmbientContext(parent))) { + if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -9594,7 +14320,7 @@ var ts; case 147: return isDeclarationVisible(node.parent); case 127: - case 220: + case 221: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -9620,7 +14346,9 @@ var ts; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; + return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { + return anyType; + })) : classType; } function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); @@ -9640,9 +14368,7 @@ var ts; } if (pattern.kind === 148) { var name = declaration.propertyName || declaration.name; - var type = getTypeOfPropertyOfType(parentType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + var type = getTypeOfPropertyOfType(parentType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; @@ -9657,7 +14383,12 @@ var ts; var propName = "" + ts.indexOf(pattern.elements, declaration); var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + if (isTupleType(parentType)) { + error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); + } + else { + error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + } return unknownType; } } @@ -9672,7 +14403,7 @@ var ts; return anyType; } if (declaration.parent.parent.kind === 183) { - return getTypeForVariableDeclarationInForOfStatement(declaration.parent.parent); + return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); @@ -9696,7 +14427,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 218) { + if (declaration.kind === 219) { return checkIdentifier(declaration.name); } return undefined; @@ -9733,9 +14464,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 - ? getTypeFromObjectBindingPattern(pattern) - : getTypeFromArrayBindingPattern(pattern); + return pattern.kind === 148 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); @@ -9743,7 +14472,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 217 ? getWidenedType(type) : type; + return declaration.kind !== 218 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9764,10 +14493,10 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 216) { + if (declaration.parent.kind === 217) { return links.type = anyType; } - if (declaration.kind === 208) { + if (declaration.kind === 209) { return links.type = checkExpression(declaration.expression); } links.type = resolvingType; @@ -9779,9 +14508,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); } } @@ -9915,7 +14642,9 @@ var ts; ts.forEach(declaration.typeParameters, function (node) { var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); if (!result) { - result = [tp]; + result = [ + tp + ]; } else if (!ts.contains(result, tp)) { result.push(tp); @@ -10161,14 +14890,15 @@ var ts; var baseType = classType.baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? - getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + var signature = baseType.flags & 4096 ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; return signature; }); } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + return [ + createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false) + ]; } function createTupleTypeMemberSymbols(memberTypes) { var members = {}; @@ -10197,7 +14927,9 @@ var ts; return true; } function getUnionSignatures(types, kind) { - var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatureLists = ts.map(types, function (t) { + return getSignaturesOfType(t, kind); + }); var signatures = signatureLists[0]; for (var i = 0; i < signatures.length; i++) { if (signatures[i].typeParameters) { @@ -10213,7 +14945,9 @@ var ts; for (var i = 0; i < result.length; i++) { var s = result[i]; s.resolvedReturnType = undefined; - s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + s.unionSignatures = ts.map(signatureLists, function (signatures) { + return signatures[i]; + }); } return result; } @@ -10357,7 +15091,9 @@ var ts; return undefined; } if (!props) { - props = [prop]; + props = [ + prop + ]; } else { props.push(prop); @@ -10457,8 +15193,7 @@ var ts; var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; var minArgumentCount = -1; @@ -10589,8 +15324,12 @@ var ts; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; + type.callSignatures = !isConstructor ? [ + signature + ] : emptyArray; + type.constructSignatures = isConstructor ? [ + signature + ] : emptyArray; signature.isolatedSignatureType = type; } return signature.isolatedSignatureType; @@ -10617,9 +15356,7 @@ var ts; } function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType - : undefined; + return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { if (!type.constraint) { @@ -10673,7 +15410,9 @@ var ts; return links.isIllegalTypeReferenceInConstraint; } var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { + return d.parent === currentNode.parent; + })) { currentNode = currentNode.parent; } links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; @@ -10687,7 +15426,9 @@ var ts; if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { + return d.parent == typeParameter.parent; + }); } } if (links.isIllegalTypeReferenceInConstraint) { @@ -10786,7 +15527,9 @@ var ts; } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; + return arrayType !== emptyObjectType ? createTypeReference(arrayType, [ + elementType + ]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); @@ -10972,15 +15715,21 @@ var ts; return items; } function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + return function (t) { + return t === source ? target : t; + }; } function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + return function (t) { + return t === source1 ? target1 : t === source2 ? target2 : t; + }; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: return createUnaryTypeMapper(sources[0], targets[0]); - case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10991,15 +15740,21 @@ var ts; }; } function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; + return function (t) { + return t === source ? anyType : t; + }; } function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; + return function (t) { + return t === source1 || t === source2 ? anyType : t; + }; } function createTypeEraser(sources) { switch (sources.length) { - case 1: return createUnaryTypeEraser(sources[0]); - case 2: return createBinaryTypeEraser(sources[0], sources[1]); + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11023,7 +15778,9 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { + return mapper2(mapper1(t)); + }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -11083,8 +15840,7 @@ var ts; return mapper(type); } if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? - instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11109,12 +15865,10 @@ var ts; case 151: return ts.forEach(node.elements, isContextSensitive); case 168: - return isContextSensitive(node.whenTrue) || - isContextSensitive(node.whenFalse); + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); case 167: - return node.operatorToken.kind === 49 && - (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 217: + return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 218: return isContextSensitive(node.initializer); case 132: case 131: @@ -11125,7 +15879,9 @@ var ts; return false; } function isContextSensitiveFunctionLikeDeclaration(node) { - return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); + return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { + return p.type; + }); } function getTypeWithoutConstructors(type) { if (type.flags & 48128) { @@ -11264,8 +16020,7 @@ var ts; } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { errorInfo = saveErrorInfo; return result; } @@ -11722,9 +16477,7 @@ var ts; if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { return 0; } var result = -1; @@ -11767,7 +16520,9 @@ var ts; return true; } function getCommonSupertype(types) { - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); + return ts.forEach(types, function (t) { + return isSupertypeOfEach(t, types) ? t : undefined; + }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { var bestSupertype; @@ -11804,6 +16559,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isTupleType(type) { + return (type.flags & 8192) && !!type.elementTypes; + } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); var members = {}; @@ -11883,9 +16641,7 @@ var ts; var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; case 128: - var diagnostic = declaration.dotDotDotToken ? - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; + var diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; case 195: case 132: @@ -11941,7 +16697,10 @@ var ts; function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ + primary: undefined, + secondary: undefined + }); } return { typeParameters: typeParameters, @@ -11986,9 +16745,7 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); if (!ts.contains(candidates, source)) candidates.push(source); break; @@ -12028,8 +16785,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & 48128 && (target.flags & (4096 | 8192) || - (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { + else if (source.flags & 48128 && (target.flags & (4096 | 8192) || (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12136,16 +16892,23 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind) { + function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { if (type.flags & 16384) { var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (narrowedType !== emptyObjectType) { + if (ts.forEach(types, function (t) { + return !!(t.flags & typeKind) === isOfTypeKind; + })) { + var narrowedType = getUnionType(ts.filter(types, function (t) { + return !(t.flags & typeKind) === isOfTypeKind; + })); + if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; } } } + else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + return getUnionType(emptyArray); + } return type; } function hasInitializer(node) { @@ -12217,12 +16980,12 @@ var ts; case 186: case 187: case 188: - case 213: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12231,12 +16994,13 @@ var ts; function resolveLocation(node) { var containerNodes = []; for (var parent = node.parent; parent; parent = parent.parent) { - if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(parent)) { + if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && isContextSensitive(parent)) { containerNodes.unshift(parent); } } - ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); + ts.forEach(containerNodes, function (node) { + getTypeOfNode(node); + }); } function getSymbolAtLocation(node) { resolveLocation(node); @@ -12278,7 +17042,7 @@ var ts; } } break; - case 220: + case 221: case 200: case 195: case 132: @@ -12312,16 +17076,16 @@ var ts; } if (assumeTrue) { if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true); + return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); } if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } - return removeTypesFromUnionType(type, typeInfo.flags, false); + return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true); + return removeTypesFromUnionType(type, typeInfo.flags, true, false); } return type; } @@ -12365,7 +17129,9 @@ var ts; return targetType; } if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + return getUnionType(ts.filter(type.types, function (t) { + return isTypeSubtypeOf(t, targetType); + })); } return type; } @@ -12421,9 +17187,7 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 216) { + if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -12530,21 +17294,10 @@ var ts; } if (container && container.parent && container.parent.kind === 196) { if (container.flags & 128) { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135; } else { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135 || container.kind === 130 || container.kind === 129 || container.kind === 133; } } } @@ -12591,8 +17344,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } - if (indexOfParameter === (func.parameters.length - 1) && - funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); } } @@ -12677,7 +17429,10 @@ var ts; mappedType = t; } else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + mappedTypes = [ + mappedType, + t + ]; } else { mappedTypes.push(t); @@ -12693,13 +17448,17 @@ var ts; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + return applyToContextualType(type, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } function contextualTypeHasIndexSignature(type, kind) { - return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }) : getIndexTypeOfObjectOrUnionType(type, kind)); } function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); @@ -12719,8 +17478,7 @@ var ts; return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || getIndexTypeOfContextualType(type, 0); } return undefined; } @@ -12729,9 +17487,7 @@ var ts; var type = getContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); - return getTypeOfPropertyOfContextualType(type, "" + index) - || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); } return undefined; } @@ -12764,7 +17520,7 @@ var ts; return getTypeFromTypeNode(parent.type); case 167: return getContextualTypeForBinaryOperand(node); - case 217: + case 218: return getContextualTypeForObjectLiteralElement(parent); case 151: return getContextualTypeForElementExpression(node); @@ -12795,9 +17551,7 @@ var ts; } function getContextualSignature(node) { ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); - var type = ts.isObjectLiteralMethod(node) - ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } @@ -12807,14 +17561,15 @@ var ts; var signatureList; var types = type.types; for (var i = 0; i < types.length; i++) { - if (signatureList && - getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { return undefined; } var signature = getNonGenericSignature(types[i]); if (signature) { if (!signatureList) { - signatureList = [signature]; + signatureList = [ + signature + ]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -12840,7 +17595,7 @@ var ts; if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { return true; } - if (parent.kind === 217) { + if (parent.kind === 218) { return isAssignmentTarget(parent.parent); } if (parent.kind === 151) { @@ -12912,20 +17667,16 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 217 || - memberDecl.kind === 218 || - ts.isObjectLiteralMethod(memberDecl)) { - if (memberDecl.kind === 217) { + if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218) { var type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { var type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 218); - var type = memberDecl.name.kind === 126 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 219); + var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -13041,9 +17792,7 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 - ? node.expression - : node.left; + var left = node.kind === 153 ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); @@ -13080,8 +17829,7 @@ var ts; return unknownType; } var isConstEnum = isConstEnumObjectType(objectType); - if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + if (isConstEnum && (!node.argumentExpression || node.argumentExpression.kind !== 8)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } @@ -13248,8 +17996,7 @@ var ts; callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } - var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } @@ -13266,8 +18013,7 @@ var ts; function getSingleCallSignature(type) { if (type.flags & 48128) { var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; } } @@ -13337,9 +18083,7 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : - arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -13351,7 +18095,9 @@ var ts; var args; if (node.kind === 157) { var template = node.template; - args = [template]; + args = [ + template + ]; if (template.kind === 169) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); @@ -13603,10 +18349,7 @@ var ts; } if (node.kind === 156) { var declaration = signature.declaration; - if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + if (declaration && declaration.kind !== 133 && declaration.kind !== 137 && declaration.kind !== 141) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13631,13 +18374,9 @@ var ts; } function getTypeAtPosition(signature, pos) { if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } - return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + return signature.hasRestParameter ? getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : anyArrayType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -13937,12 +18676,9 @@ var ts; var properties = node.properties; for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var name = p.name; - var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { checkDestructuringAssignment(p.initializer || name, type); } @@ -13967,14 +18703,17 @@ var ts; if (e.kind !== 172) { if (e.kind !== 171) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : getIndexTypeOfType(sourceType, 1); if (type) { checkDestructuringAssignment(e, type, contextualMapper); } else { - error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + if (isTupleType(sourceType)) { + error(e, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), sourceType.elementTypes.length, elements.length); + } + else { + error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + } } } else { @@ -14045,9 +18784,7 @@ var ts; if (rightType.flags & (32 | 64)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && - (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { + if ((leftType.flags & 8) && (rightType.flags & 8) && (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operatorToken.kind), ts.tokenToString(suggestedOperator)); } else { @@ -14109,7 +18846,10 @@ var ts; case 48: return rightType; case 49: - return getUnionType([leftType, rightType]); + return getUnionType([ + leftType, + rightType + ]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -14117,9 +18857,7 @@ var ts; return rightType; } function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : - undefined; + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : someConstituentTypeHasKind(rightType, 1048576) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); return false; @@ -14165,7 +18903,10 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - return getUnionType([type1, type2]); + return getUnionType([ + type1, + type2 + ]); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -14229,9 +18970,7 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 153 && node.parent.expression === node) || (node.parent.kind === 154 && node.parent.expression === node) || ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -14341,9 +19080,7 @@ var ts; if (node.kind === 138) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || node.kind === 136 || node.kind === 133 || node.kind === 137) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14436,8 +19173,10 @@ var ts; case 160: case 195: case 161: - case 152: return false; - default: return ts.forEachChild(n, containsSuperCall); + case 152: + return false; + default: + return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { @@ -14449,14 +19188,13 @@ var ts; } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && - !(n.flags & 128) && - !!n.initializer; + return n.kind === 130 && !(n.flags & 128) && !!n.initializer; } if (ts.getClassBaseTypeNode(node.parent)) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { + return p.flags & (16 | 32 | 64); + }); if (superCallShouldBeFirst) { var statements = node.body.statements; if (!statements.length || statements[0].kind !== 177 || !isSuperCallExpression(statements[0].expression)) { @@ -14778,16 +19516,16 @@ var ts; case 197: return 2097152; case 200: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; + return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; case 196: case 199: return 2097152 | 1048576; - case 202: + case 203: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); + ts.forEach(target.declarations, function (d) { + result |= getDeclarationSpaces(d); + }); return result; default: return 1048576; @@ -14796,10 +19534,7 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionName(node.name) || - checkGrammarForGenerator(node); + checkFunctionLikeDeclaration(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -14854,12 +19589,7 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135) { + if (node.kind === 130 || node.kind === 129 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135) { return false; } if (ts.isInAmbientContext(node)) { @@ -14918,7 +19648,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 220 && ts.isExternalModule(parent)) { + if (parent.kind === 221 && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -14927,17 +19657,11 @@ var ts; var symbol = getSymbolOfNode(node); if (symbol.flags & 1) { var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 220); + var container = varDeclList.parent.kind === 175 && varDeclList.parent.parent; + var namesShareScope = container && (container.kind === 174 && ts.isFunctionLike(container.parent) || (container.kind === 201 && container.kind === 200) || container.kind === 221); 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); @@ -15096,18 +19820,13 @@ var ts; checkSourceElement(node.statement); } function checkForOfStatement(node) { - if (languageVersion < 2) { - grammarErrorOnFirstToken(node, ts.Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); - return; - } checkGrammarForInOrForOfStatement(node); if (node.initializer.kind === 194) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var rightType = checkExpression(node.expression); - var iteratedType = checkIteratedType(rightType, node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression); if (varExpr.kind === 151 || varExpr.kind === 152) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } @@ -15156,20 +19875,17 @@ var ts; checkVariableDeclaration(decl); } } - function getTypeForVariableDeclarationInForOfStatement(forOfStatement) { - if (languageVersion < 2) { - return anyType; - } - var expressionType = getTypeOfExpression(forOfStatement.expression); - return checkIteratedType(expressionType, forOfStatement.expression) || anyType; + function checkRightHandSideOfForOf(rhsExpression) { + var expressionType = getTypeOfExpression(rhsExpression); + return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, rhsExpression); } function checkIteratedType(iterable, expressionForError) { ts.Debug.assert(languageVersion >= 2); var iteratedType = getIteratedType(iterable, expressionForError); if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; + var completeIterableType = globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [ + iteratedType + ]) : emptyObjectType; checkTypeAssignableTo(iterable, completeIterableType, expressionForError); } return iteratedType; @@ -15217,6 +19933,39 @@ var ts; return iteratorNextValue; } } + function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + ts.Debug.assert(languageVersion < 2); + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var hasStringConstituent = arrayOrStringType !== arrayType; + var reportedError = false; + if (hasStringConstituent) { + if (languageVersion < 1) { + error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + if (arrayType === emptyObjectType) { + return stringType; + } + } + if (!isArrayLikeType(arrayType)) { + if (!reportedError) { + var diagnostic = hasStringConstituent ? ts.Diagnostics.Type_0_is_not_an_array_type : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(expressionForError, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : unknownType; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + if (hasStringConstituent) { + if (arrayElementType.flags & 258) { + return stringType; + } + return getUnionType([ + arrayElementType, + stringType + ]); + } + return arrayElementType; + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } @@ -15265,8 +20014,8 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (clause.kind === 214 && !hasDuplicateDefaultClause) { + ts.forEach(node.caseBlock.clauses, function (clause) { + if (clause.kind === 215 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -15278,7 +20027,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 213) { + if (produceDiagnostics && clause.kind === 214) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15375,7 +20124,9 @@ var ts; if (stringIndexType && numberIndexType) { errorNode = declaredNumberIndexer || declaredStringIndexer; if (!errorNode && (type.flags & 2048)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { + return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); + }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -15397,13 +20148,13 @@ var ts; errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { + return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); + }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 - ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 - : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } @@ -15567,7 +20318,12 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { + prop: p, + containingType: type + }; + }); var ok = true; for (var i = 0, len = type.baseTypes.length; i < len; ++i) { var base = type.baseTypes[i]; @@ -15575,7 +20331,10 @@ var ts; for (var j = 0, proplen = properties.length; j < proplen; ++j) { var prop = properties[j]; if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; + seen[prop.name] = { + prop: prop, + containingType: base + }; } else { var existing = seen[prop.name]; @@ -15678,9 +20437,12 @@ var ts; return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 33: + return value; + case 34: + return -value; + case 47: + return enumIsConst ? ~value : undefined; } return undefined; case 167: @@ -15696,17 +20458,28 @@ var ts; return undefined; } switch (e.operatorToken.kind) { - case 44: return left | right; - case 43: return left & right; - case 41: return left >> right; - case 42: return left >>> right; - case 40: return left << right; - case 45: return left ^ right; - case 35: return left * right; - case 36: return left / right; - case 33: return left + right; - case 34: return left - right; - case 37: return left % right; + case 44: + return left | right; + case 43: + return left & right; + case 41: + return left >> right; + case 42: + return left >>> right; + case 40: + return left << right; + case 45: + return left ^ right; + case 35: + return left * right; + case 36: + return left / right; + case 33: + return left + right; + case 34: + return left - right; + case 37: + return left % right; } return undefined; case 7: @@ -15729,8 +20502,7 @@ var ts; } else { if (e.kind === 154) { - if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } var enumType = getTypeOfNode(e.expression); @@ -15826,10 +20598,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 - && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15864,10 +20633,8 @@ var ts; return false; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 220 && !inAmbientExternalModule) { - error(moduleName, node.kind === 209 ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + if (node.parent.kind !== 221 && !inAmbientExternalModule) { + error(moduleName, node.kind === 210 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { @@ -15880,13 +20647,9 @@ var ts; var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | - (symbol.flags & 793056 ? 793056 : 0) | - (symbol.flags & 1536 ? 1536 : 0); + var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 211 ? - ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : - ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + var message = node.kind === 212 ? 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)); } } @@ -15907,7 +20670,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { checkImportBinding(importClause.namedBindings); } else { @@ -15957,7 +20720,7 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 220 ? node.parent : node.parent.parent; + var container = node.parent.kind === 221 ? node.parent : node.parent.parent; if (container.kind === 200 && container.name.kind === 64) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; @@ -15974,7 +20737,7 @@ var ts; checkExternalModuleExports(container); } function getModuleStatements(node) { - if (node.kind === 220) { + if (node.kind === 221) { return node.statements; } if (node.kind === 200 && node.body.kind === 201) { @@ -15988,7 +20751,7 @@ var ts; var statements = getModuleStatements(declarations[i]); for (var j = 0; j < statements.length; j++) { var node = statements[j]; - if (node.kind === 209) { + if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; @@ -16001,7 +20764,7 @@ var ts; } } } - else if (node.kind !== 208 && node.flags & 1 && !(node.flags & 256)) { + else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { return true; } } @@ -16111,13 +20874,13 @@ var ts; return checkEnumDeclaration(node); case 200: return checkModuleDeclaration(node); - case 203: + case 204: return checkImportDeclaration(node); - case 202: + case 203: return checkImportEqualsDeclaration(node); - case 209: + case 210: return checkExportDeclaration(node); - case 208: + case 209: return checkExportAssignment(node); case 176: checkGrammarStatementInAmbientContext(node); @@ -16158,7 +20921,7 @@ var ts; case 150: case 151: case 152: - case 217: + case 218: case 153: case 154: case 155: @@ -16190,19 +20953,20 @@ var ts; case 185: case 186: case 188: - case 213: + case 202: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: case 193: case 194: case 196: case 199: - case 219: - case 208: case 220: + case 209: + case 221: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16290,7 +21054,7 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: @@ -16318,9 +21082,7 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && - isTypeDeclaration(name.parent) && - name.parent.name === name; + return name.kind == 64 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { @@ -16402,10 +21164,10 @@ var ts; while (nodeOnRightSide.parent.kind === 125) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 202) { + if (nodeOnRightSide.parent.kind === 203) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16414,14 +21176,13 @@ var ts; return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); + return (node.parent.kind === 125 && node.parent.right === node) || (node.parent.kind === 153 && node.parent.name === node); } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 208) { + if (entityName.parent.kind === 209) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } if (entityName.kind !== 153) { @@ -16470,9 +21231,7 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 208 - ? getSymbolOfEntityNameOrPropertyAccessExpression(node) - : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -16491,10 +21250,7 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && - ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 203 || node.parent.kind === 209) && - node.parent.moduleSpecifier === node)) { + if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: @@ -16512,7 +21268,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 218) { + if (location && location.kind === 219) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16580,13 +21336,17 @@ var ts; else if (symbol.flags & 67108864) { var target = getSymbolLinks(symbol).target; if (target) { - return [target]; + return [ + target + ]; } } - return [symbol]; + return [ + symbol + ]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 220; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -16627,16 +21387,16 @@ var ts; case 199: generateNameForModuleOrEnum(node); break; - case 203: + case 204: generateNameForImportDeclaration(node); break; - case 209: + case 210: generateNameForExportDeclaration(node); break; - case 208: + case 209: generateNameForExportAssignment(node); break; - case 220: + case 221: case 201: ts.forEach(node.statements, generateNames); break; @@ -16665,12 +21425,11 @@ var ts; } function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + var baseName = expr.kind === 8 ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; assignGeneratedName(node, makeUniqueName(baseName)); } function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 206) { + if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { generateNameForImportOrExportDeclaration(node); } } @@ -16700,7 +21459,7 @@ var ts; } function getAliasNameSubstitution(symbol) { var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 207) { + if (declaration && declaration.kind === 208) { var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); var propertyName = declaration.propertyName || declaration.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -16739,7 +21498,7 @@ var ts; return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 220 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } return isAliasResolvedToValue(getSymbolOfNode(node)); @@ -16764,8 +21523,7 @@ var ts; if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || - (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); + return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; } @@ -16777,14 +21535,14 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 219) { + if (node.kind === 220) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 219) { + if (declaration.kind === 220) { return getEnumMemberValue(declaration); } } @@ -16792,9 +21550,7 @@ var ts; } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) - ? getTypeOfSymbol(symbol) - : unknownType; + var type = symbol && !(symbol.flags & (2048 | 131072)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -16802,29 +21558,20 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } function isUnknownIdentifier(location, name) { - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); + return !resolveName(location, name, 107455, undefined, undefined) && !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { + if (n.parent.kind === 153 && n.parent.name === n) { return undefined; } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { + if (n.parent.kind === 150 && n.parent.propertyName === n) { return undefined; } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || - getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 2 | 8388608, undefined, undefined); - var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 216; + var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || n.parent.kind === 150 ? getSymbolOfNode(n.parent) : undefined; + var symbol = declarationSymbol || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 2 | 8388608, undefined, undefined); + var isLetOrConst = symbol && (symbol.flags & 2) && symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -16901,10 +21648,10 @@ var ts; case 175: case 195: case 198: + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 128: break; default: @@ -16939,7 +21686,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -16948,7 +21695,7 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 128) { @@ -17001,7 +21748,7 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 203 || node.kind === 202) && flags & 2) { + else if ((node.kind === 204 || node.kind === 203) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 197 && flags & 2) { @@ -17114,8 +21861,7 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || - checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { @@ -17129,8 +21875,7 @@ var ts; } } function checkGrammarArguments(node, arguments) { - return checkGrammarForDisallowedTrailingComma(arguments) || - checkGrammarForOmittedArgument(node, arguments); + return checkGrammarForDisallowedTrailingComma(arguments) || checkGrammarForOmittedArgument(node, arguments); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -17226,13 +21971,12 @@ var ts; for (var i = 0, n = node.properties.length; i < n; i++) { var prop = node.properties[i]; var name = prop.name; - if (prop.kind === 172 || - name.kind === 126) { + if (prop.kind === 172 || name.kind === 126) { checkGrammarComputedPropertyName(name); continue; } var currentKind; - if (prop.kind === 217 || prop.kind === 218) { + if (prop.kind === 218 || prop.kind === 219) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 7) { checkGrammarNumbericLiteral(name); @@ -17283,22 +22027,16 @@ var ts; var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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); } } @@ -17352,9 +22090,7 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarForGenerator(node)) { return true; } if (node.parent.kind === 152) { @@ -17405,8 +22141,7 @@ var ts; switch (current.kind) { case 189: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 - && !isIterationStatement(current.statement, true); + var isMisplacedContinueLabel = node.kind === 184 && !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); } @@ -17427,15 +22162,11 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 - ? 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; + var message = node.kind === 185 ? 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 === 185 - ? 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; + var message = node.kind === 185 ? 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); } } @@ -17472,8 +22203,7 @@ var ts; } } var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); - return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || - checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 64) { @@ -17605,8 +22335,7 @@ var ts; } function checkGrammarProperty(node) { if (node.parent.kind === 196) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || - checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } @@ -17625,12 +22354,7 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 203 || - node.kind === 202 || - node.kind === 209 || - node.kind === 208 || - (node.flags & 2)) { + if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (node.flags & 2)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -17657,7 +22381,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 220) { + if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 221) { var links = getNodeLinks(node.parent); if (!links.hasReportedStatementInAmbientContext) { return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -17692,7 +22416,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var indentStrings = ["", " "]; + var indentStrings = [ + "", + " " + ]; function getIndentString(level) { if (indentStrings[level] === undefined) { indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; @@ -17767,21 +22494,34 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + increaseIndent: function () { + return indent++; + }, + decreaseIndent: function () { + return indent--; + }, + getIndent: function () { + return indent; + }, + getTextPos: function () { + return output.length; + }, + getLine: function () { + return lineCount + 1; + }, + getColumn: function () { + return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; + }, + getText: function () { + return output; + } }; } function getLineOfLocalPosition(currentSourceFile, pos) { return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { writer.writeLine(); } } @@ -17810,9 +22550,7 @@ var ts; var lineCount = ts.getLineStarts(currentSourceFile).length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); + var nextLineStart = (currentLine + 1) === lineCount ? currentSourceFile.text.length + 1 : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); if (pos !== comment.pos) { if (firstCommentLineIndent === undefined) { firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); @@ -17890,8 +22628,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { + if ((member.kind === 134 || member.kind === 135) && (member.flags & 128) === (accessor.flags & 128)) { var memberName = ts.getPropertyNameForPropertyNameNode(member.name); var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); if (memberName === accessorName) { @@ -17947,7 +22684,8 @@ var ts; var enclosingDeclaration; var currentSourceFile; var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; + var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { + } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; var aliasDeclarationEmitInfo = []; var referencePathsOutput = ""; @@ -17956,9 +22694,7 @@ var ts; var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { + if (referencedFile && ((referencedFile.flags & 2048) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); if (!isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; @@ -17975,8 +22711,7 @@ var ts; if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } @@ -18030,7 +22765,9 @@ var ts; function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { var oldWriter = writer; ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); + var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { + return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; + }); if (aliasEmitInfo) { createAndSetNewTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { @@ -18148,7 +22885,7 @@ var ts; ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 202 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -18355,15 +23092,8 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + if (node.parent.kind === 140 || node.parent.kind === 141 || (node.parent.parent && node.parent.parent.kind === 143)) { + ts.Debug.assert(node.parent.kind === 132 || node.parent.kind === 131 || node.parent.kind === 140 || node.parent.kind === 141 || node.parent.kind === 136 || node.parent.kind === 137); emitType(node.constraint); } else { @@ -18426,9 +23156,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.parent.parent.kind === 196) { - diagnosticMessage = isImplementsList ? - ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; @@ -18461,7 +23189,9 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + emitHeritageClause([ + baseTypeNode + ], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -18521,31 +23251,17 @@ var ts; function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 === 130 || node.kind === 129) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } return diagnosticMessage !== undefined ? { @@ -18562,7 +23278,9 @@ var ts; } } function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { + return resolver.isDeclarationVisible(varDeclaration); + }); if (hasDeclarationWithEmit) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -18607,25 +23325,17 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 - ? accessor.type - : accessor.parameters.length > 0 - ? accessor.parameters[0].type - : undefined; + return accessor.kind === 134 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (accessorWithTypeAnnotation.kind === 135) { if (accessorWithTypeAnnotation.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -18635,18 +23345,10 @@ var ts; } else { if (accessorWithTypeAnnotation.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { diagnosticMessage: diagnosticMessage, @@ -18660,8 +23362,7 @@ var ts; if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); if (node.kind === 195) { emitModuleElementDeclarationFlags(node); @@ -18728,48 +23429,28 @@ var ts; var diagnosticMessage; switch (node.kind) { case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 138: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 132: case 131: if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: ts.Debug.fail("This is unknown kind for signature: " + node.kind); @@ -18796,9 +23477,7 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 140 || node.parent.kind === 141 || node.parent.parent.kind === 143) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { @@ -18808,50 +23487,28 @@ var ts; var diagnosticMessage; switch (node.parent.kind) { case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 132: case 131: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); @@ -18888,26 +23545,22 @@ var ts; return emitClassDeclaration(node); case 198: return emitTypeAliasDeclaration(node); - case 219: + case 220: return emitEnumMemberDeclaration(node); case 199: return emitEnumDeclaration(node); case 200: return emitModuleDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 208: + case 209: return emitExportAssignment(node); - case 220: + case 221: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } @@ -18958,6 +23611,7 @@ var ts; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; var lastFrame; var currentScopeNames; @@ -18970,41 +23624,57 @@ var ts; var exportSpecifiers; var exportDefault; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; + var emitLeadingComments = compilerOptions.removeComments ? function (node) { + } : emitLeadingDeclarationComments; + var emitTrailingComments = compilerOptions.removeComments ? function (node) { + } : emitTrailingDeclarationComments; + var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { + } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { } : emitPinnedOrTripleSlashCommentsOfNode; + var emitDetachedComments = compilerOptions.removeComments ? function (node) { + } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; - var emit = emitNode; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; + var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var emit = emitNodeWithoutSourceMap; + var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; + var emitStart = function (node) { + }; + var emitEnd = function (node) { + }; var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; + var scopeEmitStart = function (scopeDeclaration, scopeName) { + }; + var scopeEmitEnd = function () { + }; var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); } if (root) { - emit(root); + emitSourceFile(root); } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); + emitSourceFile(sourceFile); } }); } writeLine(); writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); return; + function emitSourceFile(sourceFile) { + currentSourceFile = sourceFile; + emit(sourceFile); + } function enterNameScope() { var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { names: names, previous: lastFrame }; + lastFrame = { + names: names, + previous: lastFrame + }; return true; } return false; @@ -19024,8 +23694,13 @@ var ts; name = baseName; } else { - name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); + name = ts.generateUniqueName(baseName, function (n) { + return isExistingName(location, n); + }); } + return recordNameInCurrentScope(name); + } + function recordNameInCurrentScope(name) { if (!currentScopeNames) { currentScopeNames = {}; } @@ -19121,12 +23796,7 @@ var ts; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { encodeLastRecordedSourceMapSpan(); lastRecordedSourceMapSpan = { emittedLine: emittedLine, @@ -19189,20 +23859,10 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + else if (node.kind === 195 || node.kind === 160 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135 || node.kind === 200 || node.kind === 196 || node.kind === 199) { if (node.name) { var name = node.name; - scopeName = name.kind === 126 - ? ts.getTextOfNode(name) - : node.name.text; + scopeName = name.kind === 126 ? ts.getTextOfNode(name) : node.name.text; } recordScopeNameStart(scopeName); } @@ -19280,21 +23940,32 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithMap(node) { + function emitNodeWithSourceMap(node) { if (node) { - if (node.kind != 220) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node); + } + if (node.kind != 221) { recordEmitNodeStartSpan(node); - emitNode(node); + emitNodeWithoutSourceMap(node); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNode(node); + emitNodeWithoutSourceMap(node); } } } + function emitNodeWithSourceMapWithoutComments(node) { + if (node) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMapWithoutComments(node); + recordEmitNodeEndSpan(node); + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; + emit = emitNodeWithSourceMap; + emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19314,6 +23985,7 @@ var ts; name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); tempCount++; } + recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); result.text = name; return result; @@ -19375,7 +24047,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19385,7 +24057,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19395,12 +24067,11 @@ var ts; } emit(nodes[i]); } - var closeTokenIsOnSameLineAsLastElement = nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes)); if (nodes.hasTrailingComma && allowTrailingComma) { write(","); } decreaseIndent(); - if (closeTokenIsOnSameLineAsLastElement) { + if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19534,8 +24205,7 @@ var ts; if (node.template.kind === 169) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 167 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); } @@ -19546,8 +24216,7 @@ var ts; ts.forEachChild(node, emit); return; } - var emitOuterParens = ts.isExpression(node.parent) - && templateNeedsParens(node, node.parent); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); if (emitOuterParens) { write("("); } @@ -19558,8 +24227,7 @@ var ts; } for (var i = 0; i < node.templateSpans.length; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + var needsParens = templateSpan.expression.kind !== 159 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); } @@ -19640,9 +24308,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 195: @@ -19653,11 +24321,11 @@ var ts; case 197: case 199: case 200: - case 202: + case 203: return parent.name === node; case 185: case 184: - case 208: + case 209: return false; case 189: return node.parent.label === node; @@ -19845,9 +24513,9 @@ var ts; } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 217: - return property.initializer; case 218: + return property.initializer; + case 219: return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); case 132: return createFunctionExpression(property.parameters, property.body); @@ -19901,6 +24569,11 @@ var ts; result.right = right; return result; } + function createExpressionStatement(expression) { + var result = ts.createSynthesizedNode(177); + result.expression = expression; + return result; + } function createMemberAccessForPropertyName(expression, memberName) { if (memberName.kind === 64) { return createPropertyAccessExpression(expression, memberName); @@ -19916,7 +24589,7 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(217); + var result = ts.createSynthesizedNode(218); result.name = name; result.initializer = initializer; return result; @@ -20011,29 +24684,31 @@ var ts; } return false; } - function indentIfOnDifferentLines(parent, node1, node2) { - var isSynthesized = ts.nodeIsSynthesized(parent); - var realNodesAreOnDifferentLines = !isSynthesized && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { + var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); writeLine(); return true; } - return false; + else { + if (valueToWriteWhenNotIndenting) { + write(valueToWriteWhenNotIndenting); + } + return false; + } } function emitPropertyAccess(node) { if (tryEmitConstantValue(node)) { return; } emit(node.expression); - var indented = indentIfOnDifferentLines(node, node.expression, node.dotToken); + var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); - indented = indented || indentIfOnDifferentLines(node, node.dotToken, node.name); + var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); emit(node.name); - if (indented) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { emit(node.left); @@ -20050,7 +24725,9 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { + return e.kind === 171; + }); } function skipParentheses(node) { while (node.kind === 159 || node.kind === 158) { @@ -20163,14 +24840,7 @@ var ts; while (operand.kind == 158) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && - operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + if (operand.kind !== 165 && operand.kind !== 164 && operand.kind !== 163 && operand.kind !== 162 && operand.kind !== 166 && operand.kind !== 156 && !(operand.kind === 155 && node.parent.kind === 156) && !(operand.kind === 160 && node.parent.kind === 155)) { emit(operand); return; } @@ -20213,27 +24883,16 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node); + if (languageVersion < 2 && node.operatorToken.kind === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + emitDestructuring(node, node.parent.kind === 177); } else { emit(node.left); - var indented1 = indentIfOnDifferentLines(node, node.left, node.operatorToken); - if (!indented1 && node.operatorToken.kind !== 23) { - write(" "); - } + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); - if (!indented1) { - var indented2 = indentIfOnDifferentLines(node, node.operatorToken, node.right); - } - if (!indented2) { - write(" "); - } + var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); - if (indented1 || indented2) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); } } function synthesizedNodeStartsOnNewLine(node) { @@ -20241,34 +24900,22 @@ var ts; } function emitConditionalExpression(node) { emit(node.condition); - var indent1 = indentIfOnDifferentLines(node, node.condition, node.questionToken); - if (!indent1) { - write(" "); - } + var indentedBeforeQuestion = indentIfOnDifferentLines(node, node.condition, node.questionToken, " "); write("?"); - if (!indent1) { - var indent2 = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue); - } - if (!indent2) { - write(" "); - } + var indentedAfterQuestion = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue, " "); emit(node.whenTrue); - if (indent1 || indent2) { - decreaseIndent(); - } - var indent3 = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken); - if (!indent3) { - write(" "); - } + decreaseIndentIf(indentedBeforeQuestion, indentedAfterQuestion); + var indentedBeforeColon = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken, " "); write(":"); - if (!indent3) { - var indent4 = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse); - } - if (!indent4) { - write(" "); - } + var indentedAfterColon = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse, " "); emit(node.whenFalse); - if (indent3 || indent4) { + decreaseIndentIf(indentedBeforeColon, indentedAfterColon); + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { decreaseIndent(); } } @@ -20279,7 +24926,7 @@ var ts; } } function emitBlock(node) { - if (isSingleLineEmptyBlock(node)) { + if (preserveNewLines && isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20401,6 +25048,9 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { + if (languageVersion < 2 && node.kind === 183) { + return emitDownLevelForOfStatement(node); + } var endPos = emitToken(81, node.pos); write(" "); endPos = emitToken(16, endPos); @@ -20426,6 +25076,86 @@ var ts; emitToken(17, node.expression.end); emitEmbeddedStatement(node.statement); } + function emitDownLevelForOfStatement(node) { + var endPos = emitToken(81, node.pos); + write(" "); + endPos = emitToken(16, endPos); + var rhsIsIdentifier = node.expression.kind === 64; + var counter = createTempVariable(node, true); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + emitStart(node.expression); + write("var "); + emitNodeWithoutSourceMap(counter); + write(" = 0"); + emitEnd(node.expression); + if (!rhsIsIdentifier) { + write(", "); + emitStart(node.expression); + emitNodeWithoutSourceMap(rhsReference); + write(" = "); + emitNodeWithoutSourceMap(node.expression); + emitEnd(node.expression); + } + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write(" < "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + emitEnd(node.initializer); + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write("++"); + emitEnd(node.initializer); + emitToken(17, node.expression.end); + write(" {"); + writeLine(); + increaseIndent(); + var rhsIterationValue = createElementAccessExpression(rhsReference, counter); + emitStart(node.initializer); + if (node.initializer.kind === 194) { + write("var "); + var variableDeclarationList = node.initializer; + if (variableDeclarationList.declarations.length > 0) { + var declaration = variableDeclarationList.declarations[0]; + if (ts.isBindingPattern(declaration.name)) { + emitDestructuring(declaration, false, rhsIterationValue); + } + else { + emitNodeWithoutSourceMap(declaration); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + emitNodeWithoutSourceMap(createTempVariable(node, false)); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); + if (node.initializer.kind === 151 || node.initializer.kind === 152) { + emitDestructuring(assignmentExpression, true, undefined, node); + } + else { + emitNodeWithoutSourceMap(assignmentExpression); + } + } + emitEnd(node.initializer); + write(";"); + if (node.statement.kind === 174) { + emitLines(node.statement.statements); + } + else { + writeLine(); + emit(node.statement); + } + writeLine(); + decreaseIndent(); + write("}"); + } function emitBreakOrContinueStatement(node) { emitToken(node.kind === 185 ? 65 : 70, node.pos); emitOptional(" ", node.label); @@ -20449,7 +25179,10 @@ var ts; emit(node.expression); endPos = emitToken(17, node.expression.end); write(" "); - emitToken(14, endPos); + emitCaseBlock(node.caseBlock, endPos); + } + function emitCaseBlock(node, startPos) { + emitToken(14, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); @@ -20457,19 +25190,16 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 213) { + if (node.kind === 214) { write("case "); emit(node.expression); write(":"); @@ -20477,7 +25207,7 @@ var ts; else { write("default:"); } - if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20537,7 +25267,7 @@ var ts; emitContainingModuleName(node); write("."); } - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { @@ -20554,21 +25284,22 @@ var ts; emitStart(specifier.name); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNode(name); + emitNodeWithoutSourceMap(name); write(";"); }); } } - function emitDestructuring(root, value) { + function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } else { + ts.Debug.assert(!isAssignmentExpressionStatement); emitBindingElement(root, value); } function emitAssignment(name, value) { @@ -20587,7 +25318,7 @@ var ts; } function ensureIdentifier(expr) { if (expr.kind !== 64) { - var identifier = createTempVariable(root); + var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -20645,7 +25376,7 @@ var ts; } for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20690,7 +25421,7 @@ var ts; function emitAssignmentExpression(root) { var target = root.left; var value = root.right; - if (root.parent.kind === 177) { + if (isAssignmentExpressionStatement) { emitDestructuringAssignment(target, value); } else { @@ -20747,7 +25478,7 @@ var ts; function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { if (languageVersion < 2) { - emitDestructuring(node); + emitDestructuring(node, false); } else { emit(node.name); @@ -20755,15 +25486,12 @@ var ts; } } else { - var isLet = renameNonTopLevelLetAndConst(node.name); + renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && - (getCombinedFlagsForIdentifier(node.name) & 4096); - if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); + if (isUninitializedLet && node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { initializer = createVoidZero(); } } @@ -20779,29 +25507,6 @@ var ts; ts.forEach(name.elements, emitExportVariableAssignments); } } - function getEnclosingBlockScopeContainer(node) { - var current = node; - while (current) { - if (ts.isFunctionLike(current)) { - return current; - } - switch (current.kind) { - case 220: - case 91: - case 216: - case 200: - case 181: - case 182: - case 183: - return current; - case 174: - if (!ts.isFunctionLike(current.parent)) { - return current; - } - } - current = current.parent; - } - } function getCombinedFlagsForIdentifier(node) { if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return 0; @@ -20809,10 +25514,7 @@ var ts; return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || - ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 64 || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); @@ -20820,13 +25522,11 @@ var ts; return; } var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 220) { + if (list.parent.kind === 175 && list.parent.parent.kind === 221) { return; } - var blockScopeContainer = getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 220 - ? blockScopeContainer - : blockScopeContainer.parent; + var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); + var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; var generatedName = generateUniqueNameForLocation(parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { @@ -20873,7 +25573,7 @@ var ts; if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); - emitDestructuring(p, tempParameters[tempIndex]); + emitDestructuring(p, false, tempParameters[tempIndex]); write(";"); tempIndex++; } @@ -20881,14 +25581,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitNode(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -20904,7 +25604,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -20925,7 +25625,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -20943,7 +25643,7 @@ var ts; } function emitDeclarationName(node) { if (node.name) { - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(resolver.getGeneratedNameForNode(node)); @@ -21060,11 +25760,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitNode(body, true); + emitWithoutComments(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -21075,7 +25775,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emit(node.body, true); + emitWithoutComments(node.body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -21097,7 +25797,7 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { for (var i = 0, n = body.statements.length; i < n; i++) { write(" "); emit(body.statements[i]); @@ -21138,7 +25838,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitNode(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -21150,7 +25850,7 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } else if (memberName.kind === 126) { @@ -21158,7 +25858,7 @@ var ts; } else { write("."); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); } } function emitMemberAssignments(node, staticFlag) { @@ -21587,8 +26287,7 @@ var ts; emitImportDeclaration(node); return; } - if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); if (!(node.flags & 1)) @@ -21617,11 +26316,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitNode(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); }); @@ -21639,15 +26338,15 @@ var ts; } } function createExternalImportInfo(node) { - if (node.kind === 202) { - if (node.moduleReference.kind === 212) { + if (node.kind === 203) { + if (node.moduleReference.kind === 213) { return { rootNode: node, declarationNode: node }; } } - else if (node.kind === 203) { + else if (node.kind === 204) { var importClause = node.importClause; if (importClause) { if (importClause.name) { @@ -21656,7 +26355,7 @@ var ts; declarationNode: importClause }; } - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { return { rootNode: node, declarationNode: importClause.namedBindings @@ -21672,7 +26371,7 @@ var ts; rootNode: node }; } - else if (node.kind === 209) { + else if (node.kind === 210) { if (node.moduleSpecifier) { return { rootNode: node @@ -21685,7 +26384,7 @@ var ts; exportSpecifiers = {}; exportDefault = undefined; ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209 && !node.moduleSpecifier) { + if (node.kind === 210 && !node.moduleSpecifier) { ts.forEach(node.exportClause.elements, function (specifier) { if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; @@ -21694,7 +26393,7 @@ var ts; (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); }); } - else if (node.kind === 208) { + else if (node.kind === 209) { exportDefault = exportDefault || node; } else if (node.kind === 195 || node.kind === 196) { @@ -21724,7 +26423,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } }); @@ -21802,10 +26501,10 @@ var ts; writeLine(); emitStart(exportDefault); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 208) { + if (exportDefault.kind === 209) { emit(exportDefault.expression); } - else if (exportDefault.kind === 211) { + else if (exportDefault.kind === 212) { emit(exportDefault.propertyName); } else { @@ -21829,8 +26528,7 @@ var ts; } return statements.length; } - function emitSourceFile(node) { - currentSourceFile = node; + function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); @@ -21870,14 +26568,14 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emitNode(node, disableComments) { + function emitNodeWithoutSourceMapWithComments(node) { if (!node) { return; } if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = !disableComments && shouldEmitLeadingAndTrailingComments(node); + var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } @@ -21886,14 +26584,23 @@ var ts; emitTrailingComments(node); } } + function emitNodeWithoutSourceMapWithoutComments(node) { + if (!node) { + return; + } + if (node.flags & 2) { + return emitPinnedOrTripleSlashComments(node); + } + emitJavaScriptWorker(node); + } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { case 197: case 195: + case 204: case 203: - case 202: case 198: - case 208: + case 209: return false; case 200: return shouldEmitModuleDeclaration(node); @@ -21948,9 +26655,9 @@ var ts; return emitArrayLiteral(node); case 152: return emitObjectLiteral(node); - case 217: - return emitPropertyAssignment(node); case 218: + return emitPropertyAssignment(node); + case 219: return emitShorthandPropertyAssignment(node); case 126: return emitComputedPropertyName(node); @@ -22019,8 +26726,8 @@ var ts; return emitWithStatement(node); case 188: return emitSwitchStatement(node); - case 213: case 214: + case 215: return emitCaseOrDefaultClause(node); case 189: return emitLabelledStatement(node); @@ -22028,7 +26735,7 @@ var ts; return emitThrowStatement(node); case 191: return emitTryStatement(node); - case 216: + case 217: return emitCatchClause(node); case 192: return emitDebuggerStatement(node); @@ -22040,18 +26747,18 @@ var ts; return emitInterfaceDeclaration(node); case 199: return emitEnumDeclaration(node); - case 219: + case 220: return emitEnumMember(node); case 200: return emitModuleDeclaration(node); - case 203: + case 204: return emitImportDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 209: + case 210: return emitExportDeclaration(node); - case 220: - return emitSourceFile(node); + case 221: + return emitSourceFileNode(node); } } function hasDetachedComments(pos) { @@ -22069,7 +26776,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 220 || node.pos !== node.parent.pos) { + if (node.parent.kind === 221 || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -22088,7 +26795,7 @@ var ts; } function emitTrailingDeclarationComments(node) { if (node.parent) { - if (node.parent.kind === 220 || node.end !== node.parent.end) { + if (node.parent.kind === 221 || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } @@ -22102,7 +26809,10 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, { + pos: pos, + end: pos + }, leadingComments); emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node) { @@ -22127,27 +26837,29 @@ var ts; if (nodeLine >= lastCommentLine + 2) { emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { + nodePos: node.pos, + detachedCommentEndPos: detachedComments[detachedComments.length - 1].end + }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; + detachedCommentsInfo = [ + currentDetachedCommentInfo + ]; } } } } } - function emitPinnedOrTripleSlashCommentsOfNode(node) { + function emitPinnedOrTripleSlashComments(node) { var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); function isPinnedOrTripleSlashComment(comment) { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { return true; } } @@ -22184,6 +26896,7 @@ var ts; (function (ts) { ts.emitTime = 0; ts.ioReadTime = 0; + ts.version = "1.5.0.0"; function createCompilerHost(options) { var currentDirectory; var existingDirectories = {}; @@ -22199,9 +26912,7 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText : e.message); } text = ""; } @@ -22237,12 +26948,20 @@ var ts; } return { getSourceFile: getSourceFile, - getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, + getDefaultLibFileName: function (options) { + return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); + }, writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, + getCurrentDirectory: function () { + return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); + }, + useCaseSensitiveFileNames: function () { + return ts.sys.useCaseSensitiveFileNames; + }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { + return ts.sys.newLine; + } }; } ts.createCompilerHost = createCompilerHost; @@ -22282,7 +27001,9 @@ var ts; var seenNoDefaultLib = options.noLib; var commonSourceDirectory; host = host || createCompilerHost(options); - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { + return processRootFile(name, false); + }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } @@ -22291,21 +27012,35 @@ var ts; var noDiagnosticsTypeChecker; program = { getSourceFile: getSourceFile, - getSourceFiles: function () { return files; }, - getCompilerOptions: function () { return options; }, + getSourceFiles: function () { + return files; + }, + getCompilerOptions: function () { + return options; + }, getSyntacticDiagnostics: getSyntacticDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getTypeChecker: getTypeChecker, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: function () { + return commonSourceDirectory; + }, emit: emit, getCurrentDirectory: host.getCurrentDirectory, - getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, - getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, - getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); } + getNodeCount: function () { + return getDiagnosticsProducingTypeChecker().getNodeCount(); + }, + getIdentifierCount: function () { + return getDiagnosticsProducingTypeChecker().getIdentifierCount(); + }, + getSymbolCount: function () { + return getDiagnosticsProducingTypeChecker().getSymbolCount(); + }, + getTypeCount: function () { + return getDiagnosticsProducingTypeChecker().getTypeCount(); + } }; return program; function getEmitHost(writeFileCallback) { @@ -22332,7 +27067,11 @@ var ts; } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + return { + diagnostics: [], + sourceMaps: undefined, + emitSkipped: true + }; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); @@ -22474,7 +27213,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 203 || node.kind === 202 || node.kind === 209) { + if (node.kind === 204 || node.kind === 203 || node.kind === 210) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22496,8 +27235,7 @@ var ts; } else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { - if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { + if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { @@ -22525,19 +27263,17 @@ var ts; } return; } - var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); + var firstExternalModuleSourceFile = ts.forEach(files, function (f) { + return ts.isExternalModule(f) ? f : undefined; + }); if (firstExternalModuleSourceFile && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } - if (options.outDir || - options.sourceRoot || - (options.mapRoot && - (!options.out || firstExternalModuleSourceFile !== undefined))) { + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + if (!(sourceFile.flags & 2048) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); sourcePathComponents.pop(); if (commonPathComponents) { @@ -22715,10 +27451,20 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, + { + name: "preserveNewLines", + type: "boolean", + description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, + experimental: true + }, { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + type: { + "es3": 0, + "es5": 1, + "es6": 2 + }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -22898,7 +27644,9 @@ var ts; var files = []; if (ts.hasProperty(json, "files")) { if (json["files"] instanceof Array) { - var files = ts.map(json["files"], function (s) { return ts.combinePaths(basePath, s); }); + var files = ts.map(json["files"], function (s) { + return ts.combinePaths(basePath, s); + }); } } else { @@ -22948,14 +27696,7 @@ var ts; var parent = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent.kind === 179 || - parent.kind === 182 || - parent.kind === 183 || - parent.kind === 181 || - parent.kind === 178 || - parent.kind === 180 || - parent.kind === 187 || - parent.kind === 216) { + if (parent.kind === 179 || parent.kind === 182 || parent.kind === 183 || parent.kind === 181 || parent.kind === 178 || parent.kind === 180 || parent.kind === 187 || parent.kind === 217) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } @@ -22991,7 +27732,7 @@ var ts; case 197: case 199: case 152: - case 188: + case 202: var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); @@ -23042,7 +27783,13 @@ var ts; } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ + name: name, + fileName: fileName, + matchKind: matchKind, + isCaseSensitive: allMatchesAreCaseSensitive(matches), + declaration: declaration + }); } } }); @@ -23076,9 +27823,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || - node.kind === 8 || - node.kind === 7) { + if (node.kind === 64 || node.kind === 8 || node.kind === 7) { return node.text; } return undefined; @@ -23142,11 +27887,11 @@ var ts; } return bestMatchKind; } - var baseSensitivity = { sensitivity: "base" }; + var baseSensitivity = { + sensitivity: "base" + }; function compareNavigateToItems(i1, i2) { - return i1.matchKind - i2.matchKind || - i1.name.localeCompare(i2.name, undefined, baseSensitivity) || - i1.name.localeCompare(i2.name); + return i1.matchKind - i2.matchKind || i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); } function createNavigateToItem(rawItem) { var declaration = rawItem.declaration; @@ -23204,19 +27949,19 @@ var ts; case 149: ts.forEach(node.elements, visit); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { childNodes.push(importClause.namedBindings); } else { @@ -23236,9 +27981,9 @@ var ts; case 197: case 200: case 195: - case 202: - case 207: - case 211: + case 203: + case 208: + case 212: childNodes.push(node); break; } @@ -23296,7 +28041,9 @@ var ts; function isTopLevelFunctionDeclaration(functionDeclaration) { if (functionDeclaration.kind === 195) { if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { + return s.kind === 195 && !isEmpty(s.name.text); + })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23366,7 +28113,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 138: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 219: + case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 136: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -23405,16 +28152,18 @@ var ts; } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 211: - case 207: - case 202: - case 204: + case 212: + case 208: + case 203: case 205: + case 206: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; function createItem(node, name, scriptElementKind) { - return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); + return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ]); } } function isEmpty(text) { @@ -23439,7 +28188,7 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 220: + case 221: return createSourceFileItem(node); case 196: return createClassItem(node); @@ -23468,12 +28217,16 @@ var ts; function createModuleItem(node) { var moduleName = getModuleName(node); var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); - return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createFunctionItem(node) { if (node.name && node.body && node.body.kind === 174) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } return undefined; } @@ -23483,10 +28236,10 @@ var ts; return undefined; } hasGlobalNode = true; - var rootName = ts.isExternalModule(node) - ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" - : ""; - return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); + var rootName = ts.isExternalModule(node) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" : ""; + return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [ + getNodeSpan(node) + ], childItems); } function createClassItem(node) { if (!node.name) { @@ -23499,26 +28252,38 @@ var ts; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { - nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); + nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { + return !ts.isBindingPattern(p.name); + })); } var childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createIterfaceItem(node) { var childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { + return member.name === undefined || member.name.kind !== 126; + }); } function removeDynamicallyNamedProperties(node) { - return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); + return ts.filter(node.members, function (member) { + return !ts.hasDynamicName(member); + }); } function getInnermostModule(node) { while (node.body.kind === 200) { @@ -23527,9 +28292,7 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 220 - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); + return node.kind === 221 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -23559,7 +28322,9 @@ var ts; var stringToWordSpans = {}; pattern = pattern.trim(); var fullPatternSegment = createSegment(pattern); - var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); + var dotSeparatedSegments = pattern.split(".").map(function (p) { + return createSegment(p.trim()); + }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { getMatches: getMatches, @@ -23667,7 +28432,9 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [match]; + return [ + match + ]; } } var subWordTextChunks = segment.subWordTextChunks; @@ -23734,8 +28501,7 @@ var ts; for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { - if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || - !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { + if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; } } @@ -23756,10 +28522,7 @@ var ts; } ts.createPatternMatcher = createPatternMatcher; function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); + return compareType(match1, match2) || compareCamelCase(match1, match2) || compareCase(match1, match2) || comparePunctuation(match1, match2); } function comparePunctuation(result1, result2) { if (result1.punctuationStripped !== result2.punctuationStripped) { @@ -23908,11 +28671,7 @@ var ts; var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); var hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); - if (charIsPunctuation(identifier.charCodeAt(i - 1)) || - charIsPunctuation(identifier.charCodeAt(i)) || - lastIsDigit != currentIsDigit || - hasTransitionFromLowerToUpper || - hasTransitionFromUpperToLower) { + if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || lastIsDigit != currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { if (!isAllPunctuation(identifier, wordStart, i)) { result.push(ts.createTextSpan(wordStart, i - wordStart)); } @@ -23964,8 +28723,7 @@ var ts; } function transitionFromUpperToLower(identifier, word, index, wordStart) { if (word) { - if (index != wordStart && - index + 1 < identifier.length) { + if (index != wordStart && index + 1 < identifier.length) { var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { @@ -23983,9 +28741,7 @@ var ts; function transitionFromLowerToUpper(identifier, word, index) { var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - var transition = word - ? (currentIsUpper && !lastIsUpper) - : currentIsUpper; + var transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; return transition; } })(ts || (ts = {})); @@ -24021,8 +28777,7 @@ var ts; function getImmediatelyContainingArgumentInfo(node) { if (node.parent.kind === 155 || node.parent.kind === 156) { var callExpression = node.parent; - if (node.kind === 24 || - node.kind === 16) { + if (node.kind === 24 || node.kind === 16) { var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; ts.Debug.assert(list !== undefined); @@ -24031,15 +28786,15 @@ var ts; invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: 0, - argumentCount: getCommaBasedArgCount(list) + argumentCount: getArgumentCount(list) }; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { var list = listItemInfo.list; var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1; - var argumentCount = getCommaBasedArgCount(list); + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: isTypeArgList ? 0 : 1, @@ -24076,10 +28831,29 @@ var ts; } return undefined; } - function getCommaBasedArgCount(argumentsList) { - return argumentsList.getChildCount() === 0 - ? 0 - : 1 + ts.countWhere(argumentsList.getChildren(), function (arg) { return arg.kind === 23; }); + function getArgumentIndex(argumentsList, node) { + var argumentIndex = 0; + var listChildren = argumentsList.getChildren(); + for (var i = 0, n = listChildren.length; i < n; i++) { + var child = listChildren[i]; + if (child === node) { + break; + } + if (child.kind !== 23) { + argumentIndex++; + } + } + return argumentIndex; + } + function getArgumentCount(argumentsList) { + var listChildren = argumentsList.getChildren(); + var argumentCount = ts.countWhere(listChildren, function (arg) { + return arg.kind !== 23; + }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { + argumentCount++; + } + return argumentCount; } function getArgumentIndexForTemplatePiece(spanIndex, node) { ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); @@ -24092,9 +28866,7 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - var argumentCount = tagExpression.template.kind === 10 - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = tagExpression.template.kind === 10 ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: 2, @@ -24122,7 +28894,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 220; n = n.parent) { + for (var n = node; n.kind !== 221; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -24199,7 +28971,10 @@ var ts; isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23), ts.spacePart()], + separatorDisplayParts: [ + ts.punctuationPart(23), + ts.spacePart() + ], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; @@ -24308,24 +29083,31 @@ var ts; } ts.findListItemInfo = findListItemInfo; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.forEach(n.getChildren(sourceFile), function (c) { + return c.kind === kind && c; + }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 221 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { return c; } }); + ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; } ts.findContainingList = findContainingList; function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isWord(n.kind); + }); } ts.getTouchingWord = getTouchingWord; function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isPropertyName(n.kind); + }); } ts.getTouchingPropertyName = getTouchingPropertyName; function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { @@ -24379,8 +29161,7 @@ var ts; var children = n.getChildren(); for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || - (child.pos === previousToken.end); + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -24418,7 +29199,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 220); + ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -24483,8 +29264,7 @@ var ts; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { - return ts.isTemplateLiteralKind(node.kind) - && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); + return ts.isTemplateLiteralKind(node.kind) && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function compareDataObjects(dst, src) { @@ -24517,19 +29297,38 @@ var ts; var indent; resetWriter(); return { - displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + displayParts: function () { + return displayParts; + }, + writeKeyword: function (text) { + return writeKind(text, 5); + }, + writeOperator: function (text) { + return writeKind(text, 12); + }, + writePunctuation: function (text) { + return writeKind(text, 15); + }, + writeSpace: function (text) { + return writeKind(text, 16); + }, + writeStringLiteral: function (text) { + return writeKind(text, 8); + }, + writeParameter: function (text) { + return writeKind(text, 13); + }, writeSymbol: writeSymbol, writeLine: writeLine, - increaseIndent: function () { indent++; }, - decreaseIndent: function () { indent--; }, + increaseIndent: function () { + indent++; + }, + decreaseIndent: function () { + indent--; + }, clear: resetWriter, - trackSymbol: function () { } + trackSymbol: function () { + } }; function writeIndent() { if (lineStart) { @@ -24690,7 +29489,9 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, + lastTrailingTriviaWasNewLine: function () { + return wasNewLine; + }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -24751,8 +29552,7 @@ var ts; return container.kind === 9; } function shouldRescanTemplateToken(container) { - return container.kind === 12 || - container.kind === 13; + return container.kind === 12 || container.kind === 13; } function startsWithSlashToken(t) { return t === 36 || t === 56; @@ -24765,13 +29565,7 @@ var ts; token: undefined }; } - var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 - : shouldRescanSlashToken(n) - ? 2 - : shouldRescanTemplateToken(n) - ? 3 - : 0; + var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 : shouldRescanSlashToken(n) ? 2 : shouldRescanTemplateToken(n) ? 3 : 0; if (lastTokenInfo && expectedScanAction === lastScanAction) { return fixTokenKind(lastTokenInfo, n); } @@ -24951,9 +29745,7 @@ var ts; this.Flag = Flag; } Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + - "operation=" + this.Operation + "," + - "flag=" + this.Flag + "]"; + return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; }; return Rule; })(); @@ -24983,8 +29775,7 @@ var ts; this.RightTokenRange = RightTokenRange; } RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + - "rightRange=" + this.RightTokenRange + "]"; + return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; }; RuleDescriptor.create1 = function (left, right) { return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); @@ -25024,8 +29815,7 @@ var ts; this.Action = null; } RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + - "action=" + this.Action + "]"; + return "[context=" + this.Context + "," + "action=" + this.Action + "]"; }; RuleOperation.create1 = function (action) { return RuleOperation.create2(formatting.RuleOperationContext.Any, action); @@ -25091,7 +29881,12 @@ var ts; this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([ + 17, + 19, + 23, + 22 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25100,9 +29895,19 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 64, + 3 + ]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 17, + 3, + 74, + 95, + 80, + 75 + ]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -25121,79 +29926,151 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 97, + 93, + 87, + 73, + 89, + 96 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 104, + 69 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); - this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 17, + 74, + 75, + 66 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 95, + 80 + ]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 115, + 119 + ]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 116, + 117 + ]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 68, + 114, + 76, + 77, + 78, + 115, + 102, + 84, + 103, + 116, + 106, + 108, + 119, + 109 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([ + 78, + 102 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([ + 17, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([ + 16, + 18, + 25, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, this.SpaceBetweenCloseBraceAndElse, this.SpaceBetweenCloseBraceAndWhile, this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, this.NewLineAfterOpenBraceInBlockContext, this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.SpaceAfterLetConstInVariableDeclaration, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, + this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, + this.SpaceAfterColon, + this.NoSpaceBeforeQuestionMark, + this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, + this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, + this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, + this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, + this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, + this.SpaceAfterSubtractWhenFollowedByPredecrement, + this.NoSpaceAfterCloseBrace, + this.SpaceAfterOpenBrace, + this.SpaceBeforeCloseBrace, + this.NewLineBeforeCloseBraceInBlockContext, + this.SpaceAfterCloseBrace, + this.SpaceBetweenCloseBraceAndElse, + this.SpaceBetweenCloseBraceAndWhile, + this.NoSpaceBetweenEmptyBraceBrackets, + this.SpaceAfterFunctionInFuncDecl, + this.NewLineAfterOpenBraceInBlockContext, + this.SpaceAfterGetSetInMember, + this.NoSpaceBetweenReturnAndSemicolon, + this.SpaceAfterCertainKeywords, + this.SpaceAfterLetConstInVariableDeclaration, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, + this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.NoSpaceAfterConstructor, + this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, + this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, + this.SpaceBeforeOpenBraceInFunction, + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterOpenBracket, + this.NoSpaceBeforeCloseBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, + this.SpaceAfterTryFinally + ]; this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); @@ -25235,10 +30112,10 @@ var ts; case 167: case 168: return true; - case 202: + case 203: case 193: case 128: - case 219: + case 220: case 130: case 129: return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; @@ -25281,7 +30158,7 @@ var ts; } switch (node.kind) { case 174: - case 188: + case 202: case 152: case 201: return true; @@ -25324,7 +30201,7 @@ var ts; case 200: case 199: case 174: - case 216: + case 217: case 201: case 188: return true; @@ -25342,7 +30219,7 @@ var ts; case 191: case 179: case 187: - case 216: + case 217: return true; default: return false; @@ -25367,8 +30244,7 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && - context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 194 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; @@ -25402,8 +30278,7 @@ var ts; } }; Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; @@ -25446,8 +30321,7 @@ var ts; }; RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && - rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; + var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); @@ -25521,19 +30395,13 @@ var ts; RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { var position; if (rule.Operation.Action == 1) { - position = specificTokens ? - 0 : - RulesPosition.IgnoreRulesAny; + position = specificTokens ? 0 : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? - RulesPosition.ContextRulesSpecific : - RulesPosition.ContextRulesAny; + position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; } else { - position = specificTokens ? - RulesPosition.NoContextRulesSpecific : - RulesPosition.NoContextRulesAny; + position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; } var state = constructionState[rulesBucketIndex]; if (state === undefined) { @@ -25590,7 +30458,9 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; + return [ + this.token + ]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -25644,18 +30514,68 @@ var ts; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([ + 3 + ])); TokenRange.Keywords = TokenRange.FromRange(65, 124); TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([64, 118, 120, 112, 121, 98, 111]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([ + 85, + 86, + 124 + ]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([ + 38, + 39, + 47, + 46 + ]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([ + 7, + 64, + 16, + 18, + 14, + 92, + 87 + ]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.Comments = TokenRange.FromTokens([ + 2, + 3 + ]); + TokenRange.TypeNames = TokenRange.FromTokens([ + 64, + 118, + 120, + 112, + 121, + 98, + 111 + ]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -25804,16 +30724,11 @@ var ts; } function findOutermostParent(position, expectedTokenKind, sourceFile) { var precedingToken = ts.findPrecedingToken(position, sourceFile); - if (!precedingToken || - precedingToken.kind !== expectedTokenKind || - position !== precedingToken.getEnd()) { + if (!precedingToken || precedingToken.kind !== expectedTokenKind || position !== precedingToken.getEnd()) { return undefined; } var current = precedingToken; - while (current && - current.parent && - current.parent.end === precedingToken.end && - !isListElement(current.parent, current)) { + while (current && current.parent && current.parent.end === precedingToken.end && !isListElement(current.parent, current)) { current = current.parent; } return current; @@ -25826,11 +30741,11 @@ var ts; case 200: var body = parent.body; return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 220: + case 221: case 174: case 201: return ts.rangeContainsRange(parent.statements, node); - case 216: + case 217: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -25838,7 +30753,9 @@ var ts; function findEnclosingNode(range, sourceFile) { return find(sourceFile); function find(n) { - var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); + var candidate = ts.forEachChild(n, function (c) { + return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; + }); if (candidate) { var result = find(candidate); if (result) { @@ -25852,9 +30769,11 @@ var ts; if (!errors.length) { return rangeHasNoErrors; } - var sorted = errors - .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) - .sort(function (e1, e2) { return e1.start - e2.start; }); + var sorted = errors.filter(function (d) { + return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); + }).sort(function (e1, e2) { + return e1.start - e2.start; + }); if (!sorted.length) { return rangeHasNoErrors; } @@ -25948,10 +30867,7 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || - parent.kind === 220 || - parent.kind === 213 || - parent.kind === 214) { + if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -26000,8 +30916,12 @@ var ts; return nodeStartLine !== line ? indentation + delta : indentation; } }, - getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getIndentation: function () { + return indentation; + }, + getDelta: function () { + return delta; + }, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { if (lineAdded) { @@ -26194,8 +31114,7 @@ var ts; trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } else { - lineAdded = - processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + lineAdded = processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); } } previousRange = range; @@ -26223,9 +31142,7 @@ var ts; dynamicIndentation.recomputeIndentation(true); } } - trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + trimTrailingWhitespaces = (rule.Operation.Action & (4 | 2)) && rule.Flag !== 1; } else { trimTrailingWhitespaces = true; @@ -26262,10 +31179,16 @@ var ts; var startPos = commentRange.pos; for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); - parts.push({ pos: startPos, end: endOfLine }); + parts.push({ + pos: startPos, + end: endOfLine + }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } - parts.push({ pos: startPos, end: commentRange.end }); + parts.push({ + pos: startPos, + end: commentRange.end + }); } var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); @@ -26280,9 +31203,7 @@ var ts; var delta = indentation - nonWhitespaceColumnInFirstPart.column; for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceCharacterAndColumn = i === 0 - ? nonWhitespaceColumnInFirstPart - : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); + var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); @@ -26311,7 +31232,10 @@ var ts; } } function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; + return { + span: ts.createTextSpan(start, len), + newText: newText + }; } function recordDelete(start, len) { if (len) { @@ -26465,12 +31389,7 @@ var ts; if (!precedingToken) { return 0; } - var precedingTokenIsLiteral = precedingToken.kind === 8 || - precedingToken.kind === 9 || - precedingToken.kind === 10 || - precedingToken.kind === 11 || - precedingToken.kind === 12 || - precedingToken.kind === 13; + var precedingTokenIsLiteral = precedingToken.kind === 8 || precedingToken.kind === 9 || precedingToken.kind === 10 || precedingToken.kind === 11 || precedingToken.kind === 12 || precedingToken.kind === 13; if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } @@ -26530,8 +31449,7 @@ var ts; } } parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); if (actualIndentation !== -1) { @@ -26564,8 +31482,7 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 220 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26605,8 +31522,7 @@ var ts; if (node.parent) { switch (node.parent.kind) { case 139: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; @@ -26622,8 +31538,7 @@ var ts; case 136: case 137: var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { + if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { return node.parent.typeParameters; } if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { @@ -26633,12 +31548,10 @@ var ts; case 156: case 155: var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { + if (node.parent.arguments && ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -26690,7 +31603,10 @@ var ts; } character++; } - return { column: column, character: character }; + return { + column: column, + character: character + }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -26707,15 +31623,15 @@ var ts; case 201: case 152: case 143: - case 188: + case 202: + case 215: case 214: - case 213: case 159: case 155: case 156: case 175: case 193: - case 208: + case 209: case 186: case 168: return true; @@ -26771,9 +31687,9 @@ var ts; case 152: case 174: case 201: - case 188: + case 202: return nodeEndsWith(n, 15, sourceFile); - case 216: + case 217: return isCompletedNode(n.block, sourceFile); case 159: case 136: @@ -26797,9 +31713,15 @@ var ts; return isCompletedNode(n.expression, sourceFile); case 151: return nodeEndsWith(n, 19, sourceFile); - case 213: case 214: + case 215: return false; + case 181: + return isCompletedNode(n.statement, sourceFile); + case 182: + return isCompletedNode(n.statement, sourceFile); + case 183: + return isCompletedNode(n.statement, sourceFile); case 180: return isCompletedNode(n.statement, sourceFile); case 179: @@ -26898,7 +31820,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(221, nodes.pos, nodes.end, 1024, this); + var list = createNode(222, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -27067,10 +31989,7 @@ var ts; return pos; } function isName(pos, end, sourceFile, name) { - return pos + name.length < end && - sourceFile.text.substr(pos, name.length) === name && - (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || - ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); + return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { return isName(pos, end, sourceFile, paramTag); @@ -27286,7 +32205,9 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([ + this.declaration + ], undefined, false) : []; } return this.documentationComment; }; @@ -27320,9 +32241,7 @@ var ts; case 131: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; + var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; @@ -27339,12 +32258,12 @@ var ts; case 198: case 199: case 200: - case 202: - case 211: - case 207: - case 202: - case 204: + case 203: + case 212: + case 208: + case 203: case 205: + case 206: case 134: case 135: case 143: @@ -27374,24 +32293,24 @@ var ts; ts.forEachChild(node.name, visit); break; } - case 219: + case 220: case 130: case 129: namedDeclarations.push(node); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27536,7 +32455,9 @@ var ts; ts.ClassificationTypeNames = ClassificationTypeNames; function displayPartsToString(displayParts) { if (displayParts) { - return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); + return ts.map(displayParts, function (displayPart) { + return displayPart.text; + }).join(""); } return ""; } @@ -27553,7 +32474,7 @@ var ts; return false; } for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 220 || parent.kind === 201) { + if (parent.kind === 221 || parent.kind === 201) { return false; } } @@ -27713,7 +32634,9 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { + return name && name.charAt(0) === '_'; + }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; for (var i in entries) { @@ -27724,7 +32647,9 @@ var ts; references: entry.owners.slice(0) }); } - sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; }); + sourceFiles.sort(function (x, y) { + return y.refCount - x.refCount; + }); return { bucket: name, sourceFiles: sourceFiles @@ -27913,7 +32838,11 @@ var ts; processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { + referencedFiles: referencedFiles, + importedFiles: importedFiles, + isLibFile: isNoDefaultLib + }; } ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { @@ -27926,14 +32855,10 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && - node.parent.label === node; + return node.kind === 64 && (node.parent.kind === 185 || node.parent.kind === 184) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && - node.parent.label === node; + return node.kind === 64 && node.parent.kind === 189 && node.parent.label === node; } function isLabeledBy(node, labelName) { for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { @@ -27968,20 +32893,18 @@ var ts; return node.parent.kind === 200 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && - ts.isFunctionLike(node.parent) && node.parent.name === node; + return node.kind === 64 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 217 || node.parent.kind === 218) && node.parent.name === node; + return (node.kind === 64 || node.kind === 8 || node.kind === 7) && (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { case 130: case 129: - case 217: - case 219: + case 218: + case 220: case 132: case 131: case 134: @@ -27996,15 +32919,12 @@ var ts; } function isNameOfExternalModuleImportOrDeclaration(node) { if (node.kind === 8) { - return isNameOfModuleDeclaration(node) || - (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); + return isNameOfModuleDeclaration(node) || (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); } return false; } function isInsideComment(sourceFile, token, position) { - return position <= token.getStart(sourceFile) && - (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || - isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments) { return ts.forEach(comments, function (comment) { if (comment.pos < position && position < comment.end) { @@ -28017,8 +32937,7 @@ var ts; return true; } else { - return !(text.charCodeAt(comment.end - 1) === 47 && - text.charCodeAt(comment.end - 2) === 42); + return !(text.charCodeAt(comment.end - 1) === 47 && text.charCodeAt(comment.end - 2) === 42); } } return false; @@ -28055,7 +32974,7 @@ var ts; return undefined; } switch (node.kind) { - case 220: + case 221: case 132: case 131: case 195: @@ -28073,38 +32992,49 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; + case 200: + return ScriptElementKind.moduleElement; + case 196: + return ScriptElementKind.classElement; + case 197: + return ScriptElementKind.interfaceElement; + case 198: + return ScriptElementKind.typeElement; + case 199: + return ScriptElementKind.enumElement; case 193: - return ts.isConst(node) - ? ScriptElementKind.constElement - : ts.isLet(node) - ? ScriptElementKind.letElement - : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; + case 195: + return ScriptElementKind.functionElement; + case 134: + return ScriptElementKind.memberGetAccessorElement; + case 135: + return ScriptElementKind.memberSetAccessorElement; case 132: case 131: return ScriptElementKind.memberFunctionElement; case 130: case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 219: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 202: - case 207: - case 204: - case 211: + case 138: + return ScriptElementKind.indexSignatureElement; + case 137: + return ScriptElementKind.constructSignatureElement; + case 136: + return ScriptElementKind.callSignatureElement; + case 133: + return ScriptElementKind.constructorImplementationElement; + case 127: + return ScriptElementKind.typeParameterElement; + case 220: + return ScriptElementKind.variableElement; + case 128: + return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 203: + case 208: case 205: + case 212: + case 206: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -28155,13 +33085,26 @@ var ts; var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, - getCancellationToken: function () { return cancellationToken; }, - getCanonicalFileName: function (fileName) { return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); }, - useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return host.getNewLine ? host.getNewLine() : "\r\n"; }, - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: function (fileName, data, writeByteOrderMark) { }, - getCurrentDirectory: function () { return host.getCurrentDirectory(); } + getCancellationToken: function () { + return cancellationToken; + }, + getCanonicalFileName: function (fileName) { + return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); + }, + useCaseSensitiveFileNames: function () { + return useCaseSensitivefileNames; + }, + getNewLine: function () { + return host.getNewLine ? host.getNewLine() : "\r\n"; + }, + getDefaultLibFileName: function (options) { + return host.getDefaultLibFileName(options); + }, + writeFile: function (fileName, data, writeByteOrderMark) { + }, + getCurrentDirectory: function () { + return host.getCurrentDirectory(); + } }); if (program) { var oldSourceFiles = program.getSourceFiles(); @@ -28248,8 +33191,7 @@ var ts; if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { return undefined; } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 || firstCharCode === 34)) { displayName = displayName.substring(1, displayName.length - 1); } var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); @@ -28365,11 +33307,11 @@ var ts; getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); } } - else if (ts.getAncestor(previousToken, 204)) { + else if (ts.getAncestor(previousToken, 205)) { isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 203); + var importDeclaration = ts.getAncestor(previousToken, 204); ts.Debug.assert(importDeclaration !== undefined); var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); var filteredExports = filterModuleExports(exports, importDeclaration); @@ -28410,16 +33352,14 @@ var ts; } function isCompletionListBlocker(previousToken) { var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || - isIdentifierDefinitionLocation(previousToken) || - isRightOfIllegalDot(previousToken); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 206; + return node.parent.kind === 207; } } return false; @@ -28429,16 +33369,9 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 151 || containingNodeKind === 167; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 159; case 18: return containingNodeKind === 151; case 116: @@ -28448,8 +33381,7 @@ var ts; case 14: return containingNodeKind === 196; case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 193 || containingNodeKind === 167; case 11: return containingNodeKind === 169; case 12: @@ -28469,9 +33401,7 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 - || previousToken.kind === 9 - || ts.isTemplateLiteralKind(previousToken.kind)) { + if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); if (start < position && position < end) { @@ -28518,43 +33448,23 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || - containingNodeKind === 199 || - isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + return containingNodeKind === 193 || containingNodeKind === 194 || containingNodeKind === 175 || containingNodeKind === 199 || isFunction(containingNodeKind) || containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || containingNodeKind === 149 || containingNodeKind === 148; case 20: return containingNodeKind === 149; case 18: return containingNodeKind === 149; case 16: - return containingNodeKind === 216 || - isFunction(containingNodeKind); + return containingNodeKind === 217 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 199 || containingNodeKind === 197 || containingNodeKind === 143 || containingNodeKind === 148; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 129 && (previousToken.parent.parent.kind === 197 || previousToken.parent.parent.kind === 143); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - isFunction(containingNodeKind); + return containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || isFunction(containingNodeKind); case 109: return containingNodeKind === 130; case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); + return containingNodeKind === 128 || containingNodeKind === 133 || (previousToken.parent.parent.kind === 149); case 108: case 106: case 107: @@ -28599,8 +33509,7 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 206) { + if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -28609,7 +33518,9 @@ var ts; if (ts.isEmpty(exisingImports)) { return exports; } - return ts.filter(exports, function (e) { return !ts.lookUp(exisingImports, e.name); }); + return ts.filter(exports, function (e) { + return !ts.lookUp(exisingImports, e.name); + }); } function filterContextualMembersList(contextualMemberSymbols, existingMembers) { if (!existingMembers || existingMembers.length === 0) { @@ -28617,7 +33528,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 217 && m.kind !== 218) { + if (m.kind !== 218 && m.kind !== 219) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28659,7 +33570,9 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ + ts.displayPart(entryName, 5) + ], documentation: undefined }; } @@ -28757,9 +33670,7 @@ var ts; return ScriptElementKind.unknown; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 - ? ts.getNodeModifiers(symbol.declarations[0]) - : ScriptElementKindModifier.none; + return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } @@ -28842,8 +33753,7 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { var signature; var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); @@ -28858,8 +33768,7 @@ var ts; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; @@ -28935,7 +33844,7 @@ var ts; if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 219) { + if (declaration.kind === 220) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -28951,7 +33860,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202) { + if (declaration.kind === 203) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -28979,9 +33888,7 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 || - symbolKind === ScriptElementKind.localVariableElement) { + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 || symbolKind === ScriptElementKind.localVariableElement) { displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (type.symbol && type.symbol.flags & 262144) { @@ -28994,12 +33901,7 @@ var ts; displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 || - symbolFlags & 8192 || - symbolFlags & 16384 || - symbolFlags & 131072 || - symbolFlags & 98304 || - symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 || symbolFlags & 8192 || symbolFlags & 16384 || symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -29012,7 +33914,11 @@ var ts; if (!documentation) { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { + displayParts: displayParts, + documentation: documentation, + symbolKind: symbolKind + }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -29099,20 +34005,26 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [ + getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined) + ] : undefined; } - var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); + var comment = ts.forEach(sourceFile.referencedFiles, function (r) { + return (r.pos <= position && position < r.end) ? r : undefined; + }); if (comment) { var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); if (referenceFile) { - return [{ + return [ + { fileName: referenceFile.fileName, textSpan: ts.createTextSpanFromBounds(0, 0), kind: ScriptElementKind.scriptElement, name: comment.fileName, containerName: undefined, containerKind: undefined - }]; + } + ]; } return undefined; } @@ -29127,7 +34039,7 @@ var ts; } } var result = []; - if (node.parent.kind === 218) { + if (node.parent.kind === 219) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); @@ -29143,8 +34055,7 @@ var ts; var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); var containerSymbol = symbol.parent; var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); @@ -29164,8 +34075,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { declarations.push(d); if (d.body) definition = d; @@ -29205,9 +34115,10 @@ var ts; if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + if (node.kind === 64 || node.kind === 92 || node.kind === 90 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return getReferencesForNode(node, [ + sourceFile + ], true, false, false); } switch (node.kind) { case 83: @@ -29244,8 +34155,8 @@ var ts; break; case 66: case 72: - if (hasKind(parent(parent(node)), 188)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent); + if (hasKind(parent(parent(parent(node))), 188)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 65: @@ -29255,9 +34166,7 @@ var ts; } break; case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + if (hasKind(node.parent, 181) || hasKind(node.parent, 182) || hasKind(node.parent, 183)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -29278,8 +34187,7 @@ var ts; return getGetAndSetOccurrences(node.parent); } default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + if (ts.isModifier(node.kind) && node.parent && (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -29388,7 +34296,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 220) { + if (ts.isFunctionBlock(parent) || parent.kind === 221) { return parent; } if (parent.kind === 191) { @@ -29436,7 +34344,7 @@ var ts; function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); - ts.forEach(switchStatement.clauses, function (clause) { + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { @@ -29524,15 +34432,16 @@ var ts; function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { + return pushKeywordIf(keywords, child, 115, 119); + }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (!(container.kind === 196 || (declaration.kind === 128 && hasKind(container, 133)))) { return undefined; } } @@ -29542,7 +34451,7 @@ var ts; } } else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 220)) { + if (!(container.kind === 201 || container.kind === 221)) { return undefined; } } @@ -29554,7 +34463,7 @@ var ts; var nodes; switch (container.kind) { case 201: - case 220: + case 221: nodes = container.statements; break; case 133: @@ -29576,7 +34485,9 @@ var ts; } ts.forEach(nodes, function (node) { if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + ts.forEach(node.modifiers, function (child) { + return pushKeywordIf(keywords, child, modifier); + }); } }); return ts.map(keywords, getReferenceEntryFromNode); @@ -29630,9 +34541,7 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 64 && - !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && - !isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind !== 64 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); @@ -29642,7 +34551,9 @@ var ts; if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [ + getReferenceEntryFromNode(node) + ]; } else { return getLabelReferencesInNode(node.parent, node); @@ -29656,7 +34567,9 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return [ + getReferenceEntryFromNode(node) + ]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -29690,17 +34603,17 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && - (location.parent.kind === 207 || location.parent.kind === 211) && - location.parent.propertyName === location; + return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 207 || declaration.kind === 211; + return declaration.kind === 208 || declaration.kind === 212; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29714,7 +34627,9 @@ var ts; if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29733,7 +34648,9 @@ var ts; } function getSymbolScope(symbol) { if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { + return (d.flags & 32) ? d : undefined; + }); if (privateDeclaration) { return ts.getAncestor(privateDeclaration, 196); } @@ -29755,7 +34672,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 220 && !ts.isExternalModule(container)) { + if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -29777,8 +34694,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -29796,8 +34712,7 @@ var ts; if (!node || node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || - (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { result.push(getReferenceEntryFromNode(node)); } }); @@ -29809,8 +34724,7 @@ var ts; case 64: return node.getWidth() === searchSymbolName.length; case 8: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { return node.getWidth() === searchSymbolName.length + 2; } break; @@ -29833,8 +34747,7 @@ var ts; cancellationToken.throwIfCancellationRequested(); var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); if (!isValidReferencePosition(referenceLocation, searchText)) { - if ((findInStrings && isInString(position)) || - (findInComments && isInComment(position))) { + if ((findInStrings && isInString(position)) || (findInComments && isInComment(position))) { result.push({ fileName: sourceFile.fileName, textSpan: ts.createTextSpan(position, searchText.length), @@ -29932,7 +34845,7 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 220: + case 221: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } @@ -29943,7 +34856,7 @@ var ts; return undefined; } var result = []; - if (searchSpaceNode.kind === 220) { + if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -29981,8 +34894,8 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 220: - if (container.kind === 220 && !ts.isExternalModule(container)) { + case 221: + if (container.kind === 221 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -29991,7 +34904,9 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [symbol]; + var result = [ + symbol + ]; if (isImportOrExportSpecifierImportSymbol(symbol)) { result.push(typeInfoResolver.getAliasedSymbol(symbol)); } @@ -30044,13 +34959,14 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return true; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { + if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { return true; } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { + return searchSymbols.indexOf(s) >= 0; + }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { @@ -30060,7 +34976,9 @@ var ts; if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { var result = []; getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); - return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(result, function (s) { + return searchSymbols.indexOf(s) >= 0; + }); } return false; }); @@ -30074,7 +34992,9 @@ var ts; if (contextualType.flags & 16384) { var unionProperty = contextualType.getProperty(name); if (unionProperty) { - return [unionProperty]; + return [ + unionProperty + ]; } else { var result = []; @@ -30090,7 +35010,9 @@ var ts; else { var symbol = contextualType.getProperty(name); if (symbol) { - return [symbol]; + return [ + symbol + ]; } } } @@ -30146,7 +35068,9 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { + return diagnostic.category === 1; + }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -30172,9 +35096,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 133: @@ -30183,7 +35107,7 @@ var ts; case 195: case 160: case 161: - case 216: + case 217: return 1; case 127: case 197: @@ -30203,14 +35127,14 @@ var ts; else { return 4; } - case 206: case 207: - case 202: - case 203: case 208: + case 203: + case 204: case 209: + case 210: return 1 | 2 | 4; - case 220: + case 221: return 4 | 1; } return 1 | 2 | 4; @@ -30240,15 +35164,13 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && - node.parent.right === node && - node.parent.parent.kind === 202) { + if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 208) { + if (node.parent.kind === 209) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -30301,8 +35223,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && - nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 200 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { @@ -30349,8 +35270,7 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || - (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -30475,16 +35395,11 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (token.parent.kind === 193 || token.parent.kind === 130 || token.parent.kind === 128) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 167 || token.parent.kind === 165 || token.parent.kind === 166 || token.parent.kind === 168) { return ClassificationTypeNames.operator; } } @@ -30582,14 +35497,22 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 14: return 15; - case 16: return 17; - case 18: return 19; - case 24: return 25; - case 15: return 14; - case 17: return 16; - case 19: return 18; - case 25: return 24; + case 14: + return 15; + case 16: + return 17; + case 18: + return 19; + case 24: + return 25; + case 15: + return 14; + case 17: + return 16; + case 19: + return 18; + case 25: + return 24; } return undefined; } @@ -30670,7 +35593,9 @@ var ts; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { + return "(" + escapeRegExp(d.text) + ")"; + }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; @@ -30678,9 +35603,7 @@ var ts; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { - return (char >= 97 && char <= 122) || - (char >= 65 && char <= 90) || - (char >= 48 && char <= 57); + return (char >= 97 && char <= 122) || (char >= 65 && char <= 90) || (char >= 48 && char <= 57); } } function getRenameInfo(fileName, position) { @@ -30781,9 +35704,7 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || - node.parent.kind === 212 || - isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -30793,10 +35714,7 @@ var ts; } } function isArgumentOfElementAccessExpression(node) { - return node && - node.parent && - node.parent.kind === 154 && - node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 154 && node.parent.argumentExpression === node; } function createClassifier() { var scanner = ts.createScanner(2, false); @@ -30825,10 +35743,7 @@ var ts; } function canFollow(keyword1, keyword2) { if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (keyword2 === 115 || keyword2 === 119 || keyword2 === 113 || keyword2 === 109) { return true; } return false; @@ -30886,18 +35801,13 @@ var ts; else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { token = 64; } - else if (lastNonTriviaToken === 64 && - token === 24) { + else if (lastNonTriviaToken === 64 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 111 || token === 120 || token === 118 || token === 112 || token === 121) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 64; } @@ -30948,9 +35858,7 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 - ? 3 - : 2; + result.finalLexState = quoteChar === 34 ? 3 : 2; } } } @@ -30982,7 +35890,10 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ length: length, classification: classification }); + result.entries.push({ + length: length, + classification: classification + }); } } } @@ -31077,7 +35988,9 @@ var ts; return 5; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine + }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -31092,7 +36005,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 220 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -31101,9 +36014,15 @@ var ts; Node.prototype = proto; return Node; }, - getSymbolConstructor: function () { return SymbolObject; }, - getTypeConstructor: function () { return TypeObject; }, - getSignatureConstructor: function () { return SignatureObject; } + getSymbolConstructor: function () { + return SymbolObject; + }, + getTypeConstructor: function () { + return TypeObject; + }, + getSignatureConstructor: function () { + return SignatureObject; + } }; } initializeServices(); @@ -31183,7 +36102,7 @@ var ts; } case 201: return spanInBlock(node); - case 216: + case 217: return spanInBlock(node.block); case 177: return textSpan(node.expression); @@ -31209,20 +36128,20 @@ var ts; return textSpan(node, ts.findNextToken(node.expression, node)); case 188: return textSpan(node, ts.findNextToken(node.expression, node)); - case 213: case 214: + case 215: return spanInNode(node.statements[0]); case 191: return spanInBlock(node.tryBlock); case 190: return textSpan(node, node.expression); - case 208: + case 209: return textSpan(node, node.expression); - case 202: - return textSpan(node, node.moduleReference); case 203: + return textSpan(node, node.moduleReference); + case 204: return textSpan(node, node.moduleSpecifier); - case 209: + case 210: return textSpan(node, node.moduleSpecifier); case 200: if (ts.getModuleInstanceState(node) !== 1) { @@ -31230,7 +36149,7 @@ var ts; } case 196: case 199: - case 219: + case 220: case 155: case 156: return textSpan(node); @@ -31264,7 +36183,7 @@ var ts; case 80: return spanInNextNode(node); default: - if (node.parent.kind === 217 && node.parent.name === node) { + if (node.parent.kind === 218 && node.parent.name === node) { return spanInNode(node.parent.initializer); } if (node.parent.kind === 158 && node.parent.type === node) { @@ -31277,17 +36196,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 182 || variableDeclaration.parent.parent.kind === 183) { return spanInNode(variableDeclaration.parent.parent); } var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; + var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.parent.initializer.declarations : undefined; if (variableDeclaration.initializer || (variableDeclaration.flags & 1)) { if (declarations && declarations[0] === variableDeclaration) { if (isParentVariableStatement) { @@ -31308,8 +36222,7 @@ var ts; } } function canHaveSpanInParameterDeclaration(parameter) { - return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16) || !!(parameter.flags & 32); + return !!parameter.initializer || parameter.dotDotDotToken !== undefined || !!(parameter.flags & 16) || !!(parameter.flags & 32); } function spanInParameterDeclaration(parameter) { if (canHaveSpanInParameterDeclaration(parameter)) { @@ -31327,8 +36240,7 @@ var ts; } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + return !!(functionDeclaration.flags & 1) || (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -31389,8 +36301,8 @@ var ts; case 196: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 188: - return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + case 202: + return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } @@ -31407,12 +36319,12 @@ var ts; if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 216: + case 217: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 188: - var switchStatement = node.parent; - var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + case 202: + var caseBlock = node.parent; + var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { return spanInNode(lastClause.statements[lastClause.statements.length - 1]); } @@ -31447,7 +36359,7 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 217) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { return spanInPreviousNode(node); } return spanInNode(node.parent); @@ -31580,15 +36492,21 @@ var ts; function forwardJSONCall(logger, actionDescription, action) { try { var result = simpleForwardCall(logger, actionDescription, action); - return JSON.stringify({ result: result }); + return JSON.stringify({ + result: result + }); } catch (err) { if (err instanceof ts.OperationCanceledException) { - return JSON.stringify({ canceled: true }); + return JSON.stringify({ + canceled: true + }); } logInternalError(logger, err); err.description = actionDescription; - return JSON.stringify({ error: err }); + return JSON.stringify({ + error: err + }); } } var ShimBase = (function () { @@ -31638,7 +36556,9 @@ var ts; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { var _this = this; var newLine = this.getNewLine(); - return diagnostics.map(function (d) { return _this.realizeDiagnostic(d, newLine); }); + return diagnostics.map(function (d) { + return _this.realizeDiagnostic(d, newLine); + }); }; LanguageServiceShimObject.prototype.realizeDiagnostic = function (diagnostic, newLine) { return { diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index bffa14b58756a..c0800ecbd77bf 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -224,27 +224,28 @@ declare module ts { EnumDeclaration = 199, ModuleDeclaration = 200, ModuleBlock = 201, - ImportEqualsDeclaration = 202, - ImportDeclaration = 203, - ImportClause = 204, - NamespaceImport = 205, - NamedImports = 206, - ImportSpecifier = 207, - ExportAssignment = 208, - ExportDeclaration = 209, - NamedExports = 210, - ExportSpecifier = 211, - ExternalModuleReference = 212, - CaseClause = 213, - DefaultClause = 214, - HeritageClause = 215, - CatchClause = 216, - PropertyAssignment = 217, - ShorthandPropertyAssignment = 218, - EnumMember = 219, - SourceFile = 220, - SyntaxList = 221, - Count = 222, + CaseBlock = 202, + ImportEqualsDeclaration = 203, + ImportDeclaration = 204, + ImportClause = 205, + NamespaceImport = 206, + NamedImports = 207, + ImportSpecifier = 208, + ExportAssignment = 209, + ExportDeclaration = 210, + NamedExports = 211, + ExportSpecifier = 212, + ExternalModuleReference = 213, + CaseClause = 214, + DefaultClause = 215, + HeritageClause = 216, + CatchClause = 217, + PropertyAssignment = 218, + ShorthandPropertyAssignment = 219, + EnumMember = 220, + SourceFile = 221, + SyntaxList = 222, + Count = 223, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, @@ -619,6 +620,9 @@ declare module ts { } interface SwitchStatement extends Statement { expression: Expression; + caseBlock: CaseBlock; + } + interface CaseBlock extends Node { clauses: NodeArray; } interface CaseClause extends Node { @@ -1197,6 +1201,7 @@ declare module ts { version?: boolean; watch?: boolean; stripInternal?: boolean; + preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1437,12 +1442,15 @@ declare module ts { function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; } declare module ts { + /** The version of the TypeScript compiler release */ + var version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } declare module ts { + /** The version of the language service API */ var servicesVersion: string; interface Node { getSourceFile(): SourceFile; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index f3c487b20793e..0fb345eea1b46 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -218,27 +218,28 @@ var ts; SyntaxKind[SyntaxKind["EnumDeclaration"] = 199] = "EnumDeclaration"; SyntaxKind[SyntaxKind["ModuleDeclaration"] = 200] = "ModuleDeclaration"; SyntaxKind[SyntaxKind["ModuleBlock"] = 201] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 202] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 203] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 204] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 205] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 206] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 207] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 208] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 209] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 210] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 211] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 212] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["CaseClause"] = 213] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 214] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 215] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 216] = "CatchClause"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 217] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 218] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 219] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 220] = "SourceFile"; - SyntaxKind[SyntaxKind["SyntaxList"] = 221] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 222] = "Count"; + SyntaxKind[SyntaxKind["CaseBlock"] = 202] = "CaseBlock"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 203] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 204] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 205] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 206] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 207] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 208] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 209] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 210] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 211] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 212] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["CaseClause"] = 214] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 215] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 216] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 217] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 218] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 219] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 220] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 221] = "SourceFile"; + SyntaxKind[SyntaxKind["SyntaxList"] = 222] = "SyntaxList"; + SyntaxKind[SyntaxKind["Count"] = 223] = "Count"; SyntaxKind[SyntaxKind["FirstAssignment"] = 52] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 63] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 65] = "FirstReservedWord"; @@ -824,18 +825,21 @@ var ts; ts.arrayToMap = arrayToMap; function formatStringFromArgs(text, args, baseIndex) { baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); + return text.replace(/{(\d+)}/g, function (match, index) { + return args[+index + baseIndex]; + }); } ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] - ? ts.localizedDiagnosticMessages[message] - : message; + return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; } ts.getLocaleSpecificMessage = getLocaleSpecificMessage; function createFileDiagnostic(file, start, length, message) { + var end = start + length; Debug.assert(start >= 0, "start must be non-negative, is " + start); Debug.assert(length >= 0, "length must be non-negative, is " + length); + Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); + Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); var text = getLocaleSpecificMessage(message.key); if (arguments.length > 4) { text = formatStringFromArgs(text, arguments, 4); @@ -898,12 +902,7 @@ var ts; return diagnostic.file ? diagnostic.file.fileName : undefined; } function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || - compareValues(d1.start, d2.start) || - compareValues(d1.length, d2.length) || - compareValues(d1.code, d2.code) || - compareMessageText(d1.messageText, d2.messageText) || - 0; + return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || 0; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { @@ -930,7 +929,9 @@ var ts; if (diagnostics.length < 2) { return diagnostics; } - var newDiagnostics = [diagnostics[0]]; + var newDiagnostics = [ + diagnostics[0] + ]; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; @@ -1007,7 +1008,9 @@ var ts; ts.isRootedDiskPath = isRootedDiskPath; function normalizedPathComponents(path, rootLength) { var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); + return [ + path.substr(0, rootLength) + ].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { var path = normalizeSlashes(path); @@ -1041,7 +1044,9 @@ var ts; } } if (rootLength === urlLength) { - return [url]; + return [ + url + ]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -1049,7 +1054,9 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [url + ts.directorySeparator]; + return [ + url + ts.directorySeparator + ]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -1111,7 +1118,11 @@ var ts; return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; } ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; + var supportedExtensions = [ + ".d.ts", + ".ts", + ".js" + ]; function removeFileExtension(path) { for (var i = 0; i < supportedExtensions.length; i++) { var ext = supportedExtensions[i]; @@ -1165,9 +1176,15 @@ var ts; }; return Node; }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } + getSymbolConstructor: function () { + return Symbol; + }, + getTypeConstructor: function () { + return Type; + }, + getSignatureConstructor: function () { + return Signature; + } }; (function (AssertionLevel) { AssertionLevel[AssertionLevel["None"] = 0] = "None"; @@ -1392,9 +1409,14 @@ var ts; readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); + _fs.watchFile(fileName, { + persistent: true, + interval: 250 + }, fileChanged); return { - close: function () { _fs.unwatchFile(fileName, fileChanged); } + close: function () { + _fs.unwatchFile(fileName, fileChanged); + } }; function fileChanged(curr, prev) { if (+curr.mtime <= +prev.mtime) { @@ -1445,493 +1467,2436 @@ var ts; else { return undefined; } - })(); -})(ts || (ts = {})); -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: 1, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1, key: "Cannot compile external modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: 1, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: 1, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: 1, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: 1, key: "An object member cannot be declared optional." }, - yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: 1, key: "'yield' expression must be contained_within a generator declaration." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: 1, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: 1, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: 1, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: 1, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: 1, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: 1, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: 1, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: 1, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: 1, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: 1, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: 1, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: 1, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: 1, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: 1, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: 1, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: 1, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: 1, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: 1, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: 1, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: 1, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: 1, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: 1, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: 1, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: 1, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: 1, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: 1, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: 1, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: 1, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: 1, key: "An import declaration cannot have modifiers." }, - External_module_0_has_no_default_export_or_export_assignment: { code: 1192, category: 1, key: "External module '{0}' has no default export or export assignment." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: 1, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_an_internal_module: { code: 1194, category: 1, key: "Export declarations are not permitted in an internal module." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: 1, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: 1, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: 1, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: 1, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: 1, key: "Unterminated Unicode escape sequence." }, - Duplicate_identifier_0: { code: 2300, category: 1, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: 1, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: 1, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1, key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: 1, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: 1, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: 1, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: 1, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: 1, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: 1, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: 1, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: 1, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: 1, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: 1, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: 1, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: 1, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: 1, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { code: 2472, category: 1, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: 1, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: 1, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: 1, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: 1, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: 1, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: 1, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: 1, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: 1, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: 1, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 2482, category: 1, key: "'for...of' statements are only available when targeting ECMAScript 6 or higher." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: 1, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: 1, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: 1, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: 1, key: "Invalid left-hand side in 'for...of' statement." }, - The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: 1, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." }, - The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: 1, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: 1, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: 1, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: 1, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: 1, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: 1, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1, key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1, key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: 1, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: 1, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: 1, key: "Option 'project' cannot be mixed with source files on a command line." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2, key: "Do not emit outputs if any type checking errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: 2, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: 2, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: 2, key: "Syntax: {0}" }, - options: { code: 6024, category: 2, key: "options" }, - file: { code: 6025, category: 2, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2, key: "Options:" }, - Version_0: { code: 6029, category: 2, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: 2, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: 2, key: "KIND" }, - FILE: { code: 6035, category: 2, key: "FILE" }, - VERSION: { code: 6036, category: 2, key: "VERSION" }, - LOCATION: { code: 6037, category: 2, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: 2, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: 2, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1, key: "'{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." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - You_cannot_rename_this_element: { code: 8000, category: 1, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: 1, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - yield_expressions_are_not_currently_supported: { code: 9000, category: 1, key: "'yield' expressions are not currently supported." }, - Generators_are_not_currently_supported: { code: 9001, category: 1, key: "Generators are not currently supported." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 9002, category: 1, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." } + })(); +})(ts || (ts = {})); +var ts; +(function (ts) { + ts.Diagnostics = { + Unterminated_string_literal: { + code: 1002, + category: 1, + key: "Unterminated string literal." + }, + Identifier_expected: { + code: 1003, + category: 1, + key: "Identifier expected." + }, + _0_expected: { + code: 1005, + category: 1, + key: "'{0}' expected." + }, + A_file_cannot_have_a_reference_to_itself: { + code: 1006, + category: 1, + key: "A file cannot have a reference to itself." + }, + Trailing_comma_not_allowed: { + code: 1009, + category: 1, + key: "Trailing comma not allowed." + }, + Asterisk_Slash_expected: { + code: 1010, + category: 1, + key: "'*/' expected." + }, + Unexpected_token: { + code: 1012, + category: 1, + key: "Unexpected token." + }, + A_rest_parameter_must_be_last_in_a_parameter_list: { + code: 1014, + category: 1, + key: "A rest parameter must be last in a parameter list." + }, + Parameter_cannot_have_question_mark_and_initializer: { + code: 1015, + category: 1, + key: "Parameter cannot have question mark and initializer." + }, + A_required_parameter_cannot_follow_an_optional_parameter: { + code: 1016, + category: 1, + key: "A required parameter cannot follow an optional parameter." + }, + An_index_signature_cannot_have_a_rest_parameter: { + code: 1017, + category: 1, + key: "An index signature cannot have a rest parameter." + }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { + code: 1018, + category: 1, + key: "An index signature parameter cannot have an accessibility modifier." + }, + An_index_signature_parameter_cannot_have_a_question_mark: { + code: 1019, + category: 1, + key: "An index signature parameter cannot have a question mark." + }, + An_index_signature_parameter_cannot_have_an_initializer: { + code: 1020, + category: 1, + key: "An index signature parameter cannot have an initializer." + }, + An_index_signature_must_have_a_type_annotation: { + code: 1021, + category: 1, + key: "An index signature must have a type annotation." + }, + An_index_signature_parameter_must_have_a_type_annotation: { + code: 1022, + category: 1, + key: "An index signature parameter must have a type annotation." + }, + An_index_signature_parameter_type_must_be_string_or_number: { + code: 1023, + category: 1, + key: "An index signature parameter type must be 'string' or 'number'." + }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { + code: 1024, + category: 1, + key: "A class or interface declaration can only have one 'extends' clause." + }, + An_extends_clause_must_precede_an_implements_clause: { + code: 1025, + category: 1, + key: "An 'extends' clause must precede an 'implements' clause." + }, + A_class_can_only_extend_a_single_class: { + code: 1026, + category: 1, + key: "A class can only extend a single class." + }, + A_class_declaration_can_only_have_one_implements_clause: { + code: 1027, + category: 1, + key: "A class declaration can only have one 'implements' clause." + }, + Accessibility_modifier_already_seen: { + code: 1028, + category: 1, + key: "Accessibility modifier already seen." + }, + _0_modifier_must_precede_1_modifier: { + code: 1029, + category: 1, + key: "'{0}' modifier must precede '{1}' modifier." + }, + _0_modifier_already_seen: { + code: 1030, + category: 1, + key: "'{0}' modifier already seen." + }, + _0_modifier_cannot_appear_on_a_class_element: { + code: 1031, + category: 1, + key: "'{0}' modifier cannot appear on a class element." + }, + An_interface_declaration_cannot_have_an_implements_clause: { + code: 1032, + category: 1, + key: "An interface declaration cannot have an 'implements' clause." + }, + super_must_be_followed_by_an_argument_list_or_member_access: { + code: 1034, + category: 1, + key: "'super' must be followed by an argument list or member access." + }, + Only_ambient_modules_can_use_quoted_names: { + code: 1035, + category: 1, + key: "Only ambient modules can use quoted names." + }, + Statements_are_not_allowed_in_ambient_contexts: { + code: 1036, + category: 1, + key: "Statements are not allowed in ambient contexts." + }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { + code: 1038, + category: 1, + key: "A 'declare' modifier cannot be used in an already ambient context." + }, + Initializers_are_not_allowed_in_ambient_contexts: { + code: 1039, + category: 1, + key: "Initializers are not allowed in ambient contexts." + }, + _0_modifier_cannot_appear_on_a_module_element: { + code: 1044, + category: 1, + key: "'{0}' modifier cannot appear on a module element." + }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { + code: 1045, + category: 1, + key: "A 'declare' modifier cannot be used with an interface declaration." + }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { + code: 1046, + category: 1, + key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." + }, + A_rest_parameter_cannot_be_optional: { + code: 1047, + category: 1, + key: "A rest parameter cannot be optional." + }, + A_rest_parameter_cannot_have_an_initializer: { + code: 1048, + category: 1, + key: "A rest parameter cannot have an initializer." + }, + A_set_accessor_must_have_exactly_one_parameter: { + code: 1049, + category: 1, + key: "A 'set' accessor must have exactly one parameter." + }, + A_set_accessor_cannot_have_an_optional_parameter: { + code: 1051, + category: 1, + key: "A 'set' accessor cannot have an optional parameter." + }, + A_set_accessor_parameter_cannot_have_an_initializer: { + code: 1052, + category: 1, + key: "A 'set' accessor parameter cannot have an initializer." + }, + A_set_accessor_cannot_have_rest_parameter: { + code: 1053, + category: 1, + key: "A 'set' accessor cannot have rest parameter." + }, + A_get_accessor_cannot_have_parameters: { + code: 1054, + category: 1, + key: "A 'get' accessor cannot have parameters." + }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { + code: 1056, + category: 1, + key: "Accessors are only available when targeting ECMAScript 5 and higher." + }, + Enum_member_must_have_initializer: { + code: 1061, + category: 1, + key: "Enum member must have initializer." + }, + An_export_assignment_cannot_be_used_in_an_internal_module: { + code: 1063, + category: 1, + key: "An export assignment cannot be used in an internal module." + }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { + code: 1066, + category: 1, + key: "Ambient enum elements can only have integer literal initializers." + }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { + code: 1068, + category: 1, + key: "Unexpected token. A constructor, method, accessor, or property was expected." + }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { + code: 1079, + category: 1, + key: "A 'declare' modifier cannot be used with an import declaration." + }, + Invalid_reference_directive_syntax: { + code: 1084, + category: 1, + key: "Invalid 'reference' directive syntax." + }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { + code: 1085, + category: 1, + key: "Octal literals are not available when targeting ECMAScript 5 and higher." + }, + An_accessor_cannot_be_declared_in_an_ambient_context: { + code: 1086, + category: 1, + key: "An accessor cannot be declared in an ambient context." + }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { + code: 1089, + category: 1, + key: "'{0}' modifier cannot appear on a constructor declaration." + }, + _0_modifier_cannot_appear_on_a_parameter: { + code: 1090, + category: 1, + key: "'{0}' modifier cannot appear on a parameter." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { + code: 1091, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...in' statement." + }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { + code: 1092, + category: 1, + key: "Type parameters cannot appear on a constructor declaration." + }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { + code: 1093, + category: 1, + key: "Type annotation cannot appear on a constructor declaration." + }, + An_accessor_cannot_have_type_parameters: { + code: 1094, + category: 1, + key: "An accessor cannot have type parameters." + }, + A_set_accessor_cannot_have_a_return_type_annotation: { + code: 1095, + category: 1, + key: "A 'set' accessor cannot have a return type annotation." + }, + An_index_signature_must_have_exactly_one_parameter: { + code: 1096, + category: 1, + key: "An index signature must have exactly one parameter." + }, + _0_list_cannot_be_empty: { + code: 1097, + category: 1, + key: "'{0}' list cannot be empty." + }, + Type_parameter_list_cannot_be_empty: { + code: 1098, + category: 1, + key: "Type parameter list cannot be empty." + }, + Type_argument_list_cannot_be_empty: { + code: 1099, + category: 1, + key: "Type argument list cannot be empty." + }, + Invalid_use_of_0_in_strict_mode: { + code: 1100, + category: 1, + key: "Invalid use of '{0}' in strict mode." + }, + with_statements_are_not_allowed_in_strict_mode: { + code: 1101, + category: 1, + key: "'with' statements are not allowed in strict mode." + }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { + code: 1102, + category: 1, + key: "'delete' cannot be called on an identifier in strict mode." + }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { + code: 1104, + category: 1, + key: "A 'continue' statement can only be used within an enclosing iteration statement." + }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { + code: 1105, + category: 1, + key: "A 'break' statement can only be used within an enclosing iteration or switch statement." + }, + Jump_target_cannot_cross_function_boundary: { + code: 1107, + category: 1, + key: "Jump target cannot cross function boundary." + }, + A_return_statement_can_only_be_used_within_a_function_body: { + code: 1108, + category: 1, + key: "A 'return' statement can only be used within a function body." + }, + Expression_expected: { + code: 1109, + category: 1, + key: "Expression expected." + }, + Type_expected: { + code: 1110, + category: 1, + key: "Type expected." + }, + A_class_member_cannot_be_declared_optional: { + code: 1112, + category: 1, + key: "A class member cannot be declared optional." + }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { + code: 1113, + category: 1, + key: "A 'default' clause cannot appear more than once in a 'switch' statement." + }, + Duplicate_label_0: { + code: 1114, + category: 1, + key: "Duplicate label '{0}'" + }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { + code: 1115, + category: 1, + key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." + }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { + code: 1116, + category: 1, + key: "A 'break' statement can only jump to a label of an enclosing statement." + }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { + code: 1117, + category: 1, + key: "An object literal cannot have multiple properties with the same name in strict mode." + }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { + code: 1118, + category: 1, + key: "An object literal cannot have multiple get/set accessors with the same name." + }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { + code: 1119, + category: 1, + key: "An object literal cannot have property and accessor with the same name." + }, + An_export_assignment_cannot_have_modifiers: { + code: 1120, + category: 1, + key: "An export assignment cannot have modifiers." + }, + Octal_literals_are_not_allowed_in_strict_mode: { + code: 1121, + category: 1, + key: "Octal literals are not allowed in strict mode." + }, + A_tuple_type_element_list_cannot_be_empty: { + code: 1122, + category: 1, + key: "A tuple type element list cannot be empty." + }, + Variable_declaration_list_cannot_be_empty: { + code: 1123, + category: 1, + key: "Variable declaration list cannot be empty." + }, + Digit_expected: { + code: 1124, + category: 1, + key: "Digit expected." + }, + Hexadecimal_digit_expected: { + code: 1125, + category: 1, + key: "Hexadecimal digit expected." + }, + Unexpected_end_of_text: { + code: 1126, + category: 1, + key: "Unexpected end of text." + }, + Invalid_character: { + code: 1127, + category: 1, + key: "Invalid character." + }, + Declaration_or_statement_expected: { + code: 1128, + category: 1, + key: "Declaration or statement expected." + }, + Statement_expected: { + code: 1129, + category: 1, + key: "Statement expected." + }, + case_or_default_expected: { + code: 1130, + category: 1, + key: "'case' or 'default' expected." + }, + Property_or_signature_expected: { + code: 1131, + category: 1, + key: "Property or signature expected." + }, + Enum_member_expected: { + code: 1132, + category: 1, + key: "Enum member expected." + }, + Type_reference_expected: { + code: 1133, + category: 1, + key: "Type reference expected." + }, + Variable_declaration_expected: { + code: 1134, + category: 1, + key: "Variable declaration expected." + }, + Argument_expression_expected: { + code: 1135, + category: 1, + key: "Argument expression expected." + }, + Property_assignment_expected: { + code: 1136, + category: 1, + key: "Property assignment expected." + }, + Expression_or_comma_expected: { + code: 1137, + category: 1, + key: "Expression or comma expected." + }, + Parameter_declaration_expected: { + code: 1138, + category: 1, + key: "Parameter declaration expected." + }, + Type_parameter_declaration_expected: { + code: 1139, + category: 1, + key: "Type parameter declaration expected." + }, + Type_argument_expected: { + code: 1140, + category: 1, + key: "Type argument expected." + }, + String_literal_expected: { + code: 1141, + category: 1, + key: "String literal expected." + }, + Line_break_not_permitted_here: { + code: 1142, + category: 1, + key: "Line break not permitted here." + }, + or_expected: { + code: 1144, + category: 1, + key: "'{' or ';' expected." + }, + Modifiers_not_permitted_on_index_signature_members: { + code: 1145, + category: 1, + key: "Modifiers not permitted on index signature members." + }, + Declaration_expected: { + code: 1146, + category: 1, + key: "Declaration expected." + }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { + code: 1147, + category: 1, + key: "Import declarations in an internal module cannot reference an external module." + }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { + code: 1148, + category: 1, + key: "Cannot compile external modules unless the '--module' flag is provided." + }, + File_name_0_differs_from_already_included_file_name_1_only_in_casing: { + code: 1149, + category: 1, + key: "File name '{0}' differs from already included file name '{1}' only in casing" + }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { + code: 1150, + category: 1, + key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." + }, + var_let_or_const_expected: { + code: 1152, + category: 1, + key: "'var', 'let' or 'const' expected." + }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1153, + category: 1, + key: "'let' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1154, + category: 1, + key: "'const' declarations are only available when targeting ECMAScript 6 and higher." + }, + const_declarations_must_be_initialized: { + code: 1155, + category: 1, + key: "'const' declarations must be initialized" + }, + const_declarations_can_only_be_declared_inside_a_block: { + code: 1156, + category: 1, + key: "'const' declarations can only be declared inside a block." + }, + let_declarations_can_only_be_declared_inside_a_block: { + code: 1157, + category: 1, + key: "'let' declarations can only be declared inside a block." + }, + Unterminated_template_literal: { + code: 1160, + category: 1, + key: "Unterminated template literal." + }, + Unterminated_regular_expression_literal: { + code: 1161, + category: 1, + key: "Unterminated regular expression literal." + }, + An_object_member_cannot_be_declared_optional: { + code: 1162, + category: 1, + key: "An object member cannot be declared optional." + }, + yield_expression_must_be_contained_within_a_generator_declaration: { + code: 1163, + category: 1, + key: "'yield' expression must be contained_within a generator declaration." + }, + Computed_property_names_are_not_allowed_in_enums: { + code: 1164, + category: 1, + key: "Computed property names are not allowed in enums." + }, + A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { + code: 1165, + category: 1, + key: "A computed property name in an ambient context must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { + code: 1166, + category: 1, + key: "A computed property name in a class property declaration must directly refer to a built-in symbol." + }, + Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 1167, + category: 1, + key: "Computed property names are only available when targeting ECMAScript 6 and higher." + }, + A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { + code: 1168, + category: 1, + key: "A computed property name in a method overload must directly refer to a built-in symbol." + }, + A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { + code: 1169, + category: 1, + key: "A computed property name in an interface must directly refer to a built-in symbol." + }, + A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { + code: 1170, + category: 1, + key: "A computed property name in a type literal must directly refer to a built-in symbol." + }, + A_comma_expression_is_not_allowed_in_a_computed_property_name: { + code: 1171, + category: 1, + key: "A comma expression is not allowed in a computed property name." + }, + extends_clause_already_seen: { + code: 1172, + category: 1, + key: "'extends' clause already seen." + }, + extends_clause_must_precede_implements_clause: { + code: 1173, + category: 1, + key: "'extends' clause must precede 'implements' clause." + }, + Classes_can_only_extend_a_single_class: { + code: 1174, + category: 1, + key: "Classes can only extend a single class." + }, + implements_clause_already_seen: { + code: 1175, + category: 1, + key: "'implements' clause already seen." + }, + Interface_declaration_cannot_have_implements_clause: { + code: 1176, + category: 1, + key: "Interface declaration cannot have 'implements' clause." + }, + Binary_digit_expected: { + code: 1177, + category: 1, + key: "Binary digit expected." + }, + Octal_digit_expected: { + code: 1178, + category: 1, + key: "Octal digit expected." + }, + Unexpected_token_expected: { + code: 1179, + category: 1, + key: "Unexpected token. '{' expected." + }, + Property_destructuring_pattern_expected: { + code: 1180, + category: 1, + key: "Property destructuring pattern expected." + }, + Array_element_destructuring_pattern_expected: { + code: 1181, + category: 1, + key: "Array element destructuring pattern expected." + }, + A_destructuring_declaration_must_have_an_initializer: { + code: 1182, + category: 1, + key: "A destructuring declaration must have an initializer." + }, + Destructuring_declarations_are_not_allowed_in_ambient_contexts: { + code: 1183, + category: 1, + key: "Destructuring declarations are not allowed in ambient contexts." + }, + An_implementation_cannot_be_declared_in_ambient_contexts: { + code: 1184, + category: 1, + key: "An implementation cannot be declared in ambient contexts." + }, + Modifiers_cannot_appear_here: { + code: 1184, + category: 1, + key: "Modifiers cannot appear here." + }, + Merge_conflict_marker_encountered: { + code: 1185, + category: 1, + key: "Merge conflict marker encountered." + }, + A_rest_element_cannot_have_an_initializer: { + code: 1186, + category: 1, + key: "A rest element cannot have an initializer." + }, + A_parameter_property_may_not_be_a_binding_pattern: { + code: 1187, + category: 1, + key: "A parameter property may not be a binding pattern." + }, + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { + code: 1188, + category: 1, + key: "Only a single variable declaration is allowed in a 'for...of' statement." + }, + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { + code: 1189, + category: 1, + key: "The variable declaration of a 'for...in' statement cannot have an initializer." + }, + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { + code: 1190, + category: 1, + key: "The variable declaration of a 'for...of' statement cannot have an initializer." + }, + An_import_declaration_cannot_have_modifiers: { + code: 1191, + category: 1, + key: "An import declaration cannot have modifiers." + }, + External_module_0_has_no_default_export_or_export_assignment: { + code: 1192, + category: 1, + key: "External module '{0}' has no default export or export assignment." + }, + An_export_declaration_cannot_have_modifiers: { + code: 1193, + category: 1, + key: "An export declaration cannot have modifiers." + }, + Export_declarations_are_not_permitted_in_an_internal_module: { + code: 1194, + category: 1, + key: "Export declarations are not permitted in an internal module." + }, + Catch_clause_variable_name_must_be_an_identifier: { + code: 1195, + category: 1, + key: "Catch clause variable name must be an identifier." + }, + Catch_clause_variable_cannot_have_a_type_annotation: { + code: 1196, + category: 1, + key: "Catch clause variable cannot have a type annotation." + }, + Catch_clause_variable_cannot_have_an_initializer: { + code: 1197, + category: 1, + key: "Catch clause variable cannot have an initializer." + }, + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { + code: 1198, + category: 1, + key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." + }, + Unterminated_Unicode_escape_sequence: { + code: 1199, + category: 1, + key: "Unterminated Unicode escape sequence." + }, + Duplicate_identifier_0: { + code: 2300, + category: 1, + key: "Duplicate identifier '{0}'." + }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { + code: 2301, + category: 1, + key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." + }, + Static_members_cannot_reference_class_type_parameters: { + code: 2302, + category: 1, + key: "Static members cannot reference class type parameters." + }, + Circular_definition_of_import_alias_0: { + code: 2303, + category: 1, + key: "Circular definition of import alias '{0}'." + }, + Cannot_find_name_0: { + code: 2304, + category: 1, + key: "Cannot find name '{0}'." + }, + Module_0_has_no_exported_member_1: { + code: 2305, + category: 1, + key: "Module '{0}' has no exported member '{1}'." + }, + File_0_is_not_an_external_module: { + code: 2306, + category: 1, + key: "File '{0}' is not an external module." + }, + Cannot_find_external_module_0: { + code: 2307, + category: 1, + key: "Cannot find external module '{0}'." + }, + A_module_cannot_have_more_than_one_export_assignment: { + code: 2308, + category: 1, + key: "A module cannot have more than one export assignment." + }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { + code: 2309, + category: 1, + key: "An export assignment cannot be used in a module with other exported elements." + }, + Type_0_recursively_references_itself_as_a_base_type: { + code: 2310, + category: 1, + key: "Type '{0}' recursively references itself as a base type." + }, + A_class_may_only_extend_another_class: { + code: 2311, + category: 1, + key: "A class may only extend another class." + }, + An_interface_may_only_extend_a_class_or_another_interface: { + code: 2312, + category: 1, + key: "An interface may only extend a class or another interface." + }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { + code: 2313, + category: 1, + key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." + }, + Generic_type_0_requires_1_type_argument_s: { + code: 2314, + category: 1, + key: "Generic type '{0}' requires {1} type argument(s)." + }, + Type_0_is_not_generic: { + code: 2315, + category: 1, + key: "Type '{0}' is not generic." + }, + Global_type_0_must_be_a_class_or_interface_type: { + code: 2316, + category: 1, + key: "Global type '{0}' must be a class or interface type." + }, + Global_type_0_must_have_1_type_parameter_s: { + code: 2317, + category: 1, + key: "Global type '{0}' must have {1} type parameter(s)." + }, + Cannot_find_global_type_0: { + code: 2318, + category: 1, + key: "Cannot find global type '{0}'." + }, + Named_property_0_of_types_1_and_2_are_not_identical: { + code: 2319, + category: 1, + key: "Named property '{0}' of types '{1}' and '{2}' are not identical." + }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { + code: 2320, + category: 1, + key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." + }, + Excessive_stack_depth_comparing_types_0_and_1: { + code: 2321, + category: 1, + key: "Excessive stack depth comparing types '{0}' and '{1}'." + }, + Type_0_is_not_assignable_to_type_1: { + code: 2322, + category: 1, + key: "Type '{0}' is not assignable to type '{1}'." + }, + Property_0_is_missing_in_type_1: { + code: 2324, + category: 1, + key: "Property '{0}' is missing in type '{1}'." + }, + Property_0_is_private_in_type_1_but_not_in_type_2: { + code: 2325, + category: 1, + key: "Property '{0}' is private in type '{1}' but not in type '{2}'." + }, + Types_of_property_0_are_incompatible: { + code: 2326, + category: 1, + key: "Types of property '{0}' are incompatible." + }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { + code: 2327, + category: 1, + key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." + }, + Types_of_parameters_0_and_1_are_incompatible: { + code: 2328, + category: 1, + key: "Types of parameters '{0}' and '{1}' are incompatible." + }, + Index_signature_is_missing_in_type_0: { + code: 2329, + category: 1, + key: "Index signature is missing in type '{0}'." + }, + Index_signatures_are_incompatible: { + code: 2330, + category: 1, + key: "Index signatures are incompatible." + }, + this_cannot_be_referenced_in_a_module_body: { + code: 2331, + category: 1, + key: "'this' cannot be referenced in a module body." + }, + this_cannot_be_referenced_in_current_location: { + code: 2332, + category: 1, + key: "'this' cannot be referenced in current location." + }, + this_cannot_be_referenced_in_constructor_arguments: { + code: 2333, + category: 1, + key: "'this' cannot be referenced in constructor arguments." + }, + this_cannot_be_referenced_in_a_static_property_initializer: { + code: 2334, + category: 1, + key: "'this' cannot be referenced in a static property initializer." + }, + super_can_only_be_referenced_in_a_derived_class: { + code: 2335, + category: 1, + key: "'super' can only be referenced in a derived class." + }, + super_cannot_be_referenced_in_constructor_arguments: { + code: 2336, + category: 1, + key: "'super' cannot be referenced in constructor arguments." + }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { + code: 2337, + category: 1, + key: "Super calls are not permitted outside constructors or in nested functions inside constructors" + }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { + code: 2338, + category: 1, + key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" + }, + Property_0_does_not_exist_on_type_1: { + code: 2339, + category: 1, + key: "Property '{0}' does not exist on type '{1}'." + }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { + code: 2340, + category: 1, + key: "Only public and protected methods of the base class are accessible via the 'super' keyword" + }, + Property_0_is_private_and_only_accessible_within_class_1: { + code: 2341, + category: 1, + key: "Property '{0}' is private and only accessible within class '{1}'." + }, + An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { + code: 2342, + category: 1, + key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." + }, + Type_0_does_not_satisfy_the_constraint_1: { + code: 2344, + category: 1, + key: "Type '{0}' does not satisfy the constraint '{1}'." + }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { + code: 2345, + category: 1, + key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." + }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { + code: 2346, + category: 1, + key: "Supplied parameters do not match any signature of call target." + }, + Untyped_function_calls_may_not_accept_type_arguments: { + code: 2347, + category: 1, + key: "Untyped function calls may not accept type arguments." + }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { + code: 2348, + category: 1, + key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" + }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { + code: 2349, + category: 1, + key: "Cannot invoke an expression whose type lacks a call signature." + }, + Only_a_void_function_can_be_called_with_the_new_keyword: { + code: 2350, + category: 1, + key: "Only a void function can be called with the 'new' keyword." + }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { + code: 2351, + category: 1, + key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." + }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { + code: 2352, + category: 1, + key: "Neither type '{0}' nor type '{1}' is assignable to the other." + }, + No_best_common_type_exists_among_return_expressions: { + code: 2354, + category: 1, + key: "No best common type exists among return expressions." + }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2355, + category: 1, + key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." + }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { + code: 2356, + category: 1, + key: "An arithmetic operand must be of type 'any', 'number' or an enum type." + }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { + code: 2357, + category: 1, + key: "The operand of an increment or decrement operator must be a variable, property or indexer." + }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2358, + category: 1, + key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." + }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { + code: 2359, + category: 1, + key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." + }, + The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { + code: 2360, + category: 1, + key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." + }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2361, + category: 1, + key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" + }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2362, + category: 1, + key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { + code: 2363, + category: 1, + key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." + }, + Invalid_left_hand_side_of_assignment_expression: { + code: 2364, + category: 1, + key: "Invalid left-hand side of assignment expression." + }, + Operator_0_cannot_be_applied_to_types_1_and_2: { + code: 2365, + category: 1, + key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." + }, + Type_parameter_name_cannot_be_0: { + code: 2368, + category: 1, + key: "Type parameter name cannot be '{0}'" + }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { + code: 2369, + category: 1, + key: "A parameter property is only allowed in a constructor implementation." + }, + A_rest_parameter_must_be_of_an_array_type: { + code: 2370, + category: 1, + key: "A rest parameter must be of an array type." + }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { + code: 2371, + category: 1, + key: "A parameter initializer is only allowed in a function or constructor implementation." + }, + Parameter_0_cannot_be_referenced_in_its_initializer: { + code: 2372, + category: 1, + key: "Parameter '{0}' cannot be referenced in its initializer." + }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { + code: 2373, + category: 1, + key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." + }, + Duplicate_string_index_signature: { + code: 2374, + category: 1, + key: "Duplicate string index signature." + }, + Duplicate_number_index_signature: { + code: 2375, + category: 1, + key: "Duplicate number index signature." + }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { + code: 2376, + category: 1, + key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." + }, + Constructors_for_derived_classes_must_contain_a_super_call: { + code: 2377, + category: 1, + key: "Constructors for derived classes must contain a 'super' call." + }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { + code: 2378, + category: 1, + key: "A 'get' accessor must return a value or consist of a single 'throw' statement." + }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { + code: 2379, + category: 1, + key: "Getter and setter accessors do not agree in visibility." + }, + get_and_set_accessor_must_have_the_same_type: { + code: 2380, + category: 1, + key: "'get' and 'set' accessor must have the same type." + }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { + code: 2381, + category: 1, + key: "A signature with an implementation cannot use a string literal type." + }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { + code: 2382, + category: 1, + key: "Specialized overload signature is not assignable to any non-specialized signature." + }, + Overload_signatures_must_all_be_exported_or_not_exported: { + code: 2383, + category: 1, + key: "Overload signatures must all be exported or not exported." + }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { + code: 2384, + category: 1, + key: "Overload signatures must all be ambient or non-ambient." + }, + Overload_signatures_must_all_be_public_private_or_protected: { + code: 2385, + category: 1, + key: "Overload signatures must all be public, private or protected." + }, + Overload_signatures_must_all_be_optional_or_required: { + code: 2386, + category: 1, + key: "Overload signatures must all be optional or required." + }, + Function_overload_must_be_static: { + code: 2387, + category: 1, + key: "Function overload must be static." + }, + Function_overload_must_not_be_static: { + code: 2388, + category: 1, + key: "Function overload must not be static." + }, + Function_implementation_name_must_be_0: { + code: 2389, + category: 1, + key: "Function implementation name must be '{0}'." + }, + Constructor_implementation_is_missing: { + code: 2390, + category: 1, + key: "Constructor implementation is missing." + }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { + code: 2391, + category: 1, + key: "Function implementation is missing or not immediately following the declaration." + }, + Multiple_constructor_implementations_are_not_allowed: { + code: 2392, + category: 1, + key: "Multiple constructor implementations are not allowed." + }, + Duplicate_function_implementation: { + code: 2393, + category: 1, + key: "Duplicate function implementation." + }, + Overload_signature_is_not_compatible_with_function_implementation: { + code: 2394, + category: 1, + key: "Overload signature is not compatible with function implementation." + }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { + code: 2395, + category: 1, + key: "Individual declarations in merged declaration {0} must be all exported or all local." + }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { + code: 2396, + category: 1, + key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." + }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { + code: 2399, + category: 1, + key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." + }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { + code: 2400, + category: 1, + key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." + }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { + code: 2401, + category: 1, + key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." + }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { + code: 2402, + category: 1, + key: "Expression resolves to '_super' that compiler uses to capture base class reference." + }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { + code: 2403, + category: 1, + key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." + }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { + code: 2404, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot use a type annotation." + }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { + code: 2405, + category: 1, + key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." + }, + Invalid_left_hand_side_in_for_in_statement: { + code: 2406, + category: 1, + key: "Invalid left-hand side in 'for...in' statement." + }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { + code: 2407, + category: 1, + key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." + }, + Setters_cannot_return_a_value: { + code: 2408, + category: 1, + key: "Setters cannot return a value." + }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { + code: 2409, + category: 1, + key: "Return type of constructor signature must be assignable to the instance type of the class" + }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { + code: 2410, + category: 1, + key: "All symbols within a 'with' block will be resolved to 'any'." + }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { + code: 2411, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." + }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { + code: 2412, + category: 1, + key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." + }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { + code: 2413, + category: 1, + key: "Numeric index type '{0}' is not assignable to string index type '{1}'." + }, + Class_name_cannot_be_0: { + code: 2414, + category: 1, + key: "Class name cannot be '{0}'" + }, + Class_0_incorrectly_extends_base_class_1: { + code: 2415, + category: 1, + key: "Class '{0}' incorrectly extends base class '{1}'." + }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { + code: 2417, + category: 1, + key: "Class static side '{0}' incorrectly extends base class static side '{1}'." + }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { + code: 2419, + category: 1, + key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." + }, + Class_0_incorrectly_implements_interface_1: { + code: 2420, + category: 1, + key: "Class '{0}' incorrectly implements interface '{1}'." + }, + A_class_may_only_implement_another_class_or_interface: { + code: 2422, + category: 1, + key: "A class may only implement another class or interface." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { + code: 2423, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." + }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { + code: 2424, + category: 1, + key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." + }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2425, + category: 1, + key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." + }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { + code: 2426, + category: 1, + key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." + }, + Interface_name_cannot_be_0: { + code: 2427, + category: 1, + key: "Interface name cannot be '{0}'" + }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { + code: 2428, + category: 1, + key: "All declarations of an interface must have identical type parameters." + }, + Interface_0_incorrectly_extends_interface_1: { + code: 2430, + category: 1, + key: "Interface '{0}' incorrectly extends interface '{1}'." + }, + Enum_name_cannot_be_0: { + code: 2431, + category: 1, + key: "Enum name cannot be '{0}'" + }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { + code: 2432, + category: 1, + key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." + }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { + code: 2433, + category: 1, + key: "A module declaration cannot be in a different file from a class or function with which it is merged" + }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { + code: 2434, + category: 1, + key: "A module declaration cannot be located prior to a class or function with which it is merged" + }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { + code: 2435, + category: 1, + key: "Ambient external modules cannot be nested in other modules." + }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { + code: 2436, + category: 1, + key: "Ambient external module declaration cannot specify relative module name." + }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { + code: 2437, + category: 1, + key: "Module '{0}' is hidden by a local declaration with the same name" + }, + Import_name_cannot_be_0: { + code: 2438, + category: 1, + key: "Import name cannot be '{0}'" + }, + Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { + code: 2439, + category: 1, + key: "Import or export declaration in an ambient external module declaration cannot reference external module through relative external module name." + }, + Import_declaration_conflicts_with_local_declaration_of_0: { + code: 2440, + category: 1, + key: "Import declaration conflicts with local declaration of '{0}'" + }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { + code: 2441, + category: 1, + key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." + }, + Types_have_separate_declarations_of_a_private_property_0: { + code: 2442, + category: 1, + key: "Types have separate declarations of a private property '{0}'." + }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { + code: 2443, + category: 1, + key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." + }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { + code: 2444, + category: 1, + key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." + }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { + code: 2445, + category: 1, + key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." + }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { + code: 2446, + category: 1, + key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." + }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { + code: 2447, + category: 1, + key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." + }, + Block_scoped_variable_0_used_before_its_declaration: { + code: 2448, + category: 1, + key: "Block-scoped variable '{0}' used before its declaration." + }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { + code: 2449, + category: 1, + key: "The operand of an increment or decrement operator cannot be a constant." + }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { + code: 2450, + category: 1, + key: "Left-hand side of assignment expression cannot be a constant." + }, + Cannot_redeclare_block_scoped_variable_0: { + code: 2451, + category: 1, + key: "Cannot redeclare block-scoped variable '{0}'." + }, + An_enum_member_cannot_have_a_numeric_name: { + code: 2452, + category: 1, + key: "An enum member cannot have a numeric name." + }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { + code: 2453, + category: 1, + key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." + }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { + code: 2455, + category: 1, + key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." + }, + Type_alias_0_circularly_references_itself: { + code: 2456, + category: 1, + key: "Type alias '{0}' circularly references itself." + }, + Type_alias_name_cannot_be_0: { + code: 2457, + category: 1, + key: "Type alias name cannot be '{0}'" + }, + An_AMD_module_cannot_have_multiple_name_assignments: { + code: 2458, + category: 1, + key: "An AMD module cannot have multiple name assignments." + }, + Type_0_has_no_property_1_and_no_string_index_signature: { + code: 2459, + category: 1, + key: "Type '{0}' has no property '{1}' and no string index signature." + }, + Type_0_has_no_property_1: { + code: 2460, + category: 1, + key: "Type '{0}' has no property '{1}'." + }, + Type_0_is_not_an_array_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type." + }, + A_rest_element_must_be_last_in_an_array_destructuring_pattern: { + code: 2462, + category: 1, + key: "A rest element must be last in an array destructuring pattern" + }, + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { + code: 2463, + category: 1, + key: "A binding pattern parameter cannot be optional in an implementation signature." + }, + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { + code: 2464, + category: 1, + key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." + }, + this_cannot_be_referenced_in_a_computed_property_name: { + code: 2465, + category: 1, + key: "'this' cannot be referenced in a computed property name." + }, + super_cannot_be_referenced_in_a_computed_property_name: { + code: 2466, + category: 1, + key: "'super' cannot be referenced in a computed property name." + }, + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { + code: 2467, + category: 1, + key: "A computed property name cannot reference a type parameter from its containing type." + }, + Cannot_find_global_value_0: { + code: 2468, + category: 1, + key: "Cannot find global value '{0}'." + }, + The_0_operator_cannot_be_applied_to_type_symbol: { + code: 2469, + category: 1, + key: "The '{0}' operator cannot be applied to type 'symbol'." + }, + Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { + code: 2470, + category: 1, + key: "'Symbol' reference does not refer to the global Symbol constructor object." + }, + A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { + code: 2471, + category: 1, + key: "A computed property name of the form '{0}' must be of type 'symbol'." + }, + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher: { + code: 2472, + category: 1, + key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher." + }, + Enum_declarations_must_all_be_const_or_non_const: { + code: 2473, + category: 1, + key: "Enum declarations must all be const or non-const." + }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { + code: 2474, + category: 1, + key: "In 'const' enum declarations member initializer must be constant expression." + }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { + code: 2475, + category: 1, + key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." + }, + A_const_enum_member_can_only_be_accessed_using_a_string_literal: { + code: 2476, + category: 1, + key: "A const enum member can only be accessed using a string literal." + }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { + code: 2477, + category: 1, + key: "'const' enum member initializer was evaluated to a non-finite value." + }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { + code: 2478, + category: 1, + key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." + }, + Property_0_does_not_exist_on_const_enum_1: { + code: 2479, + category: 1, + key: "Property '{0}' does not exist on 'const' enum '{1}'." + }, + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { + code: 2480, + category: 1, + key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." + }, + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { + code: 2481, + category: 1, + key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." + }, + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { + code: 2483, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot use a type annotation." + }, + Export_declaration_conflicts_with_exported_declaration_of_0: { + code: 2484, + category: 1, + key: "Export declaration conflicts with exported declaration of '{0}'" + }, + The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { + code: 2485, + category: 1, + key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { + code: 2486, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." + }, + Invalid_left_hand_side_in_for_of_statement: { + code: 2487, + category: 1, + key: "Invalid left-hand side in 'for...of' statement." + }, + The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { + code: 2488, + category: 1, + key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." + }, + The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { + code: 2489, + category: 1, + key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." + }, + The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { + code: 2490, + category: 1, + key: "The type returned by the 'next()' method of an iterator must have a 'value' property." + }, + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { + code: 2491, + category: 1, + key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." + }, + Cannot_redeclare_identifier_0_in_catch_clause: { + code: 2492, + category: 1, + key: "Cannot redeclare identifier '{0}' in catch clause" + }, + Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { + code: 2493, + category: 1, + key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." + }, + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { + code: 2494, + category: 1, + key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." + }, + Type_0_is_not_an_array_type_or_a_string_type: { + code: 2461, + category: 1, + key: "Type '{0}' is not an array type or a string type." + }, + Import_declaration_0_is_using_private_name_1: { + code: 4000, + category: 1, + key: "Import declaration '{0}' is using private name '{1}'." + }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4002, + category: 1, + key: "Type parameter '{0}' of exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4004, + category: 1, + key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4006, + category: 1, + key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4008, + category: 1, + key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4010, + category: 1, + key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4012, + category: 1, + key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4014, + category: 1, + key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4016, + category: 1, + key: "Type parameter '{0}' of exported function has or is using private name '{1}'." + }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4019, + category: 1, + key: "Implements clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { + code: 4020, + category: 1, + key: "Extends clause of exported class '{0}' has or is using private name '{1}'." + }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { + code: 4022, + category: 1, + key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." + }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4023, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." + }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { + code: 4024, + category: 1, + key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." + }, + Exported_variable_0_has_or_is_using_private_name_1: { + code: 4025, + category: 1, + key: "Exported variable '{0}' has or is using private name '{1}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4026, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4027, + category: 1, + key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4028, + category: 1, + key: "Public static property '{0}' of exported class has or is using private name '{1}'." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4029, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4030, + category: 1, + key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." + }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { + code: 4031, + category: 1, + key: "Public property '{0}' of exported class has or is using private name '{1}'." + }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4032, + category: 1, + key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." + }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { + code: 4033, + category: 1, + key: "Property '{0}' of exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4034, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4035, + category: 1, + key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4036, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { + code: 4037, + category: 1, + key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4038, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4039, + category: 1, + key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4040, + category: 1, + key: "Return type of public static property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4041, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4042, + category: 1, + key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { + code: 4043, + category: 1, + key: "Return type of public property getter from exported class has or is using private name '{0}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4044, + category: 1, + key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4045, + category: 1, + key: "Return type of constructor signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4046, + category: 1, + key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4047, + category: 1, + key: "Return type of call signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4048, + category: 1, + key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { + code: 4049, + category: 1, + key: "Return type of index signature from exported interface has or is using private name '{0}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4050, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4051, + category: 1, + key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4052, + category: 1, + key: "Return type of public static method from exported class has or is using private name '{0}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4053, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { + code: 4054, + category: 1, + key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { + code: 4055, + category: 1, + key: "Return type of public method from exported class has or is using private name '{0}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { + code: 4056, + category: 1, + key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { + code: 4057, + category: 1, + key: "Return type of method from exported interface has or is using private name '{0}'." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { + code: 4058, + category: 1, + key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." + }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { + code: 4059, + category: 1, + key: "Return type of exported function has or is using name '{0}' from private module '{1}'." + }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { + code: 4060, + category: 1, + key: "Return type of exported function has or is using private name '{0}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4061, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4062, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { + code: 4063, + category: 1, + key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4064, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4065, + category: 1, + key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4066, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { + code: 4067, + category: 1, + key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4068, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4069, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4070, + category: 1, + key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4071, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { + code: 4072, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { + code: 4073, + category: 1, + key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { + code: 4074, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { + code: 4075, + category: 1, + key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { + code: 4076, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." + }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { + code: 4077, + category: 1, + key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." + }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { + code: 4078, + category: 1, + key: "Parameter '{0}' of exported function has or is using private name '{1}'." + }, + Exported_type_alias_0_has_or_is_using_private_name_1: { + code: 4081, + category: 1, + key: "Exported type alias '{0}' has or is using private name '{1}'." + }, + Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { + code: 4091, + category: 1, + key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." + }, + The_current_host_does_not_support_the_0_option: { + code: 5001, + category: 1, + key: "The current host does not support the '{0}' option." + }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { + code: 5009, + category: 1, + key: "Cannot find the common subdirectory path for the input files." + }, + Cannot_read_file_0_Colon_1: { + code: 5012, + category: 1, + key: "Cannot read file '{0}': {1}" + }, + Unsupported_file_encoding: { + code: 5013, + category: 1, + key: "Unsupported file encoding." + }, + Unknown_compiler_option_0: { + code: 5023, + category: 1, + key: "Unknown compiler option '{0}'." + }, + Compiler_option_0_requires_a_value_of_type_1: { + code: 5024, + category: 1, + key: "Compiler option '{0}' requires a value of type {1}." + }, + Could_not_write_file_0_Colon_1: { + code: 5033, + category: 1, + key: "Could not write file '{0}': {1}" + }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5038, + category: 1, + key: "Option 'mapRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { + code: 5039, + category: 1, + key: "Option 'sourceRoot' cannot be specified without specifying 'sourcemap' option." + }, + Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { + code: 5040, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." + }, + Option_noEmit_cannot_be_specified_with_option_declaration: { + code: 5041, + category: 1, + key: "Option 'noEmit' cannot be specified with option 'declaration'." + }, + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { + code: 5042, + category: 1, + key: "Option 'project' cannot be mixed with source files on a command line." + }, + Concatenate_and_emit_output_to_single_file: { + code: 6001, + category: 2, + key: "Concatenate and emit output to single file." + }, + Generates_corresponding_d_ts_file: { + code: 6002, + category: 2, + key: "Generates corresponding '.d.ts' file." + }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { + code: 6003, + category: 2, + key: "Specifies the location where debugger should locate map files instead of generated locations." + }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { + code: 6004, + category: 2, + key: "Specifies the location where debugger should locate TypeScript files instead of source locations." + }, + Watch_input_files: { + code: 6005, + category: 2, + key: "Watch input files." + }, + Redirect_output_structure_to_the_directory: { + code: 6006, + category: 2, + key: "Redirect output structure to the directory." + }, + Do_not_erase_const_enum_declarations_in_generated_code: { + code: 6007, + category: 2, + key: "Do not erase const enum declarations in generated code." + }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { + code: 6008, + category: 2, + key: "Do not emit outputs if any type checking errors were reported." + }, + Do_not_emit_comments_to_output: { + code: 6009, + category: 2, + key: "Do not emit comments to output." + }, + Do_not_emit_outputs: { + code: 6010, + category: 2, + key: "Do not emit outputs." + }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { + code: 6015, + category: 2, + key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" + }, + Specify_module_code_generation_Colon_commonjs_or_amd: { + code: 6016, + category: 2, + key: "Specify module code generation: 'commonjs' or 'amd'" + }, + Print_this_message: { + code: 6017, + category: 2, + key: "Print this message." + }, + Print_the_compiler_s_version: { + code: 6019, + category: 2, + key: "Print the compiler's version." + }, + Compile_the_project_in_the_given_directory: { + code: 6020, + category: 2, + key: "Compile the project in the given directory." + }, + Syntax_Colon_0: { + code: 6023, + category: 2, + key: "Syntax: {0}" + }, + options: { + code: 6024, + category: 2, + key: "options" + }, + file: { + code: 6025, + category: 2, + key: "file" + }, + Examples_Colon_0: { + code: 6026, + category: 2, + key: "Examples: {0}" + }, + Options_Colon: { + code: 6027, + category: 2, + key: "Options:" + }, + Version_0: { + code: 6029, + category: 2, + key: "Version {0}" + }, + Insert_command_line_options_and_files_from_a_file: { + code: 6030, + category: 2, + key: "Insert command line options and files from a file." + }, + File_change_detected_Starting_incremental_compilation: { + code: 6032, + category: 2, + key: "File change detected. Starting incremental compilation..." + }, + KIND: { + code: 6034, + category: 2, + key: "KIND" + }, + FILE: { + code: 6035, + category: 2, + key: "FILE" + }, + VERSION: { + code: 6036, + category: 2, + key: "VERSION" + }, + LOCATION: { + code: 6037, + category: 2, + key: "LOCATION" + }, + DIRECTORY: { + code: 6038, + category: 2, + key: "DIRECTORY" + }, + Compilation_complete_Watching_for_file_changes: { + code: 6042, + category: 2, + key: "Compilation complete. Watching for file changes." + }, + Generates_corresponding_map_file: { + code: 6043, + category: 2, + key: "Generates corresponding '.map' file." + }, + Compiler_option_0_expects_an_argument: { + code: 6044, + category: 1, + key: "Compiler option '{0}' expects an argument." + }, + Unterminated_quoted_string_in_response_file_0: { + code: 6045, + category: 1, + key: "Unterminated quoted string in response file '{0}'." + }, + Argument_for_module_option_must_be_commonjs_or_amd: { + code: 6046, + category: 1, + key: "Argument for '--module' option must be 'commonjs' or 'amd'." + }, + Argument_for_target_option_must_be_es3_es5_or_es6: { + code: 6047, + category: 1, + key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." + }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { + code: 6048, + category: 1, + key: "Locale must be of the form or -. For example '{0}' or '{1}'." + }, + Unsupported_locale_0: { + code: 6049, + category: 1, + key: "Unsupported locale '{0}'." + }, + Unable_to_open_file_0: { + code: 6050, + category: 1, + key: "Unable to open file '{0}'." + }, + Corrupted_locale_file_0: { + code: 6051, + category: 1, + key: "Corrupted locale file {0}." + }, + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { + code: 6052, + category: 2, + key: "Raise error on expressions and declarations with an implied 'any' type." + }, + File_0_not_found: { + code: 6053, + category: 1, + key: "File '{0}' not found." + }, + File_0_must_have_extension_ts_or_d_ts: { + code: 6054, + category: 1, + key: "File '{0}' must have extension '.ts' or '.d.ts'." + }, + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { + code: 6055, + category: 2, + key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." + }, + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { + code: 6056, + category: 2, + key: "Do not emit declarations for code that has an '@internal' annotation." + }, + Preserve_new_lines_when_emitting_code: { + code: 6057, + category: 2, + key: "Preserve new-lines when emitting code." + }, + Variable_0_implicitly_has_an_1_type: { + code: 7005, + category: 1, + key: "Variable '{0}' implicitly has an '{1}' type." + }, + Parameter_0_implicitly_has_an_1_type: { + code: 7006, + category: 1, + key: "Parameter '{0}' implicitly has an '{1}' type." + }, + Member_0_implicitly_has_an_1_type: { + code: 7008, + category: 1, + key: "Member '{0}' implicitly has an '{1}' type." + }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { + code: 7009, + category: 1, + key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." + }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { + code: 7010, + category: 1, + key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." + }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { + code: 7011, + category: 1, + key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." + }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7013, + category: 1, + key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { + code: 7016, + category: 1, + key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." + }, + Index_signature_of_object_type_implicitly_has_an_any_type: { + code: 7017, + category: 1, + key: "Index signature of object type implicitly has an 'any' type." + }, + Object_literal_s_property_0_implicitly_has_an_1_type: { + code: 7018, + category: 1, + key: "Object literal's property '{0}' implicitly has an '{1}' type." + }, + Rest_parameter_0_implicitly_has_an_any_type: { + code: 7019, + category: 1, + key: "Rest parameter '{0}' implicitly has an 'any[]' type." + }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { + code: 7020, + category: 1, + key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." + }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { + code: 7021, + category: 1, + key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." + }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { + code: 7022, + category: 1, + key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." + }, + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7023, + category: 1, + key: "'{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." + }, + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { + code: 7024, + category: 1, + key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." + }, + You_cannot_rename_this_element: { + code: 8000, + category: 1, + key: "You cannot rename this element." + }, + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { + code: 8001, + category: 1, + key: "You cannot rename elements that are defined in the standard TypeScript library." + }, + yield_expressions_are_not_currently_supported: { + code: 9000, + category: 1, + key: "'yield' expressions are not currently supported." + }, + Generators_are_not_currently_supported: { + code: 9001, + category: 1, + key: "Generators are not currently supported." + }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { + code: 9002, + category: 1, + key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." + } }; })(ts || (ts = {})); var ts; @@ -2048,10 +4013,2806 @@ var ts; "|=": 62, "^=": 63 }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1610, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1786, + 1788, + 1808, + 1808, + 1810, + 1836, + 1920, + 1957, + 2309, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2784, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3294, + 3294, + 3296, + 3297, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3424, + 3425, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3805, + 3840, + 3840, + 3904, + 3911, + 3913, + 3946, + 3976, + 3979, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4176, + 4181, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6067, + 6176, + 6263, + 6272, + 6312, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8319, + 8319, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12445, + 12446, + 12449, + 12538, + 12540, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES3IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 543, + 546, + 563, + 592, + 685, + 688, + 696, + 699, + 705, + 720, + 721, + 736, + 740, + 750, + 750, + 768, + 846, + 864, + 866, + 890, + 890, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 974, + 976, + 983, + 986, + 1011, + 1024, + 1153, + 1155, + 1158, + 1164, + 1220, + 1223, + 1224, + 1227, + 1228, + 1232, + 1269, + 1272, + 1273, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1441, + 1443, + 1465, + 1467, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1476, + 1488, + 1514, + 1520, + 1522, + 1569, + 1594, + 1600, + 1621, + 1632, + 1641, + 1648, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1773, + 1776, + 1788, + 1808, + 1836, + 1840, + 1866, + 1920, + 1968, + 2305, + 2307, + 2309, + 2361, + 2364, + 2381, + 2384, + 2388, + 2392, + 2403, + 2406, + 2415, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2492, + 2494, + 2500, + 2503, + 2504, + 2507, + 2509, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2562, + 2562, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2649, + 2652, + 2654, + 2654, + 2662, + 2676, + 2689, + 2691, + 2693, + 2699, + 2701, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2784, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2870, + 2873, + 2876, + 2883, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2913, + 2918, + 2927, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 2997, + 2999, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3031, + 3031, + 3047, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3134, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3168, + 3169, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3262, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3297, + 3302, + 3311, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3368, + 3370, + 3385, + 3390, + 3395, + 3398, + 3400, + 3402, + 3405, + 3415, + 3415, + 3424, + 3425, + 3430, + 3439, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3805, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3946, + 3953, + 3972, + 3974, + 3979, + 3984, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4129, + 4131, + 4135, + 4137, + 4138, + 4140, + 4146, + 4150, + 4153, + 4160, + 4169, + 4176, + 4185, + 4256, + 4293, + 4304, + 4342, + 4352, + 4441, + 4447, + 4514, + 4520, + 4601, + 4608, + 4614, + 4616, + 4678, + 4680, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4742, + 4744, + 4744, + 4746, + 4749, + 4752, + 4782, + 4784, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4814, + 4816, + 4822, + 4824, + 4846, + 4848, + 4878, + 4880, + 4880, + 4882, + 4885, + 4888, + 4894, + 4896, + 4934, + 4936, + 4954, + 4969, + 4977, + 5024, + 5108, + 5121, + 5740, + 5743, + 5750, + 5761, + 5786, + 5792, + 5866, + 6016, + 6099, + 6112, + 6121, + 6160, + 6169, + 6176, + 6263, + 6272, + 6313, + 7680, + 7835, + 7840, + 7929, + 7936, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8255, + 8256, + 8319, + 8319, + 8400, + 8412, + 8417, + 8417, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8497, + 8499, + 8505, + 8544, + 8579, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12346, + 12353, + 12436, + 12441, + 12442, + 12445, + 12446, + 12449, + 12542, + 12549, + 12588, + 12593, + 12686, + 12704, + 12727, + 13312, + 19893, + 19968, + 40869, + 40960, + 42124, + 44032, + 55203, + 63744, + 64045, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65056, + 65059, + 65075, + 65076, + 65101, + 65103, + 65136, + 65138, + 65140, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65381, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierStart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 880, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1488, + 1514, + 1520, + 1522, + 1568, + 1610, + 1646, + 1647, + 1649, + 1747, + 1749, + 1749, + 1765, + 1766, + 1774, + 1775, + 1786, + 1788, + 1791, + 1791, + 1808, + 1808, + 1810, + 1839, + 1869, + 1957, + 1969, + 1969, + 1994, + 2026, + 2036, + 2037, + 2042, + 2042, + 2048, + 2069, + 2074, + 2074, + 2084, + 2084, + 2088, + 2088, + 2112, + 2136, + 2208, + 2208, + 2210, + 2220, + 2308, + 2361, + 2365, + 2365, + 2384, + 2384, + 2392, + 2401, + 2417, + 2423, + 2425, + 2431, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2493, + 2493, + 2510, + 2510, + 2524, + 2525, + 2527, + 2529, + 2544, + 2545, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2649, + 2652, + 2654, + 2654, + 2674, + 2676, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2749, + 2749, + 2768, + 2768, + 2784, + 2785, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2877, + 2877, + 2908, + 2909, + 2911, + 2913, + 2929, + 2929, + 2947, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3024, + 3024, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3133, + 3160, + 3161, + 3168, + 3169, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3261, + 3261, + 3294, + 3294, + 3296, + 3297, + 3313, + 3314, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3389, + 3406, + 3406, + 3424, + 3425, + 3450, + 3455, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3585, + 3632, + 3634, + 3635, + 3648, + 3654, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3760, + 3762, + 3763, + 3773, + 3773, + 3776, + 3780, + 3782, + 3782, + 3804, + 3807, + 3840, + 3840, + 3904, + 3911, + 3913, + 3948, + 3976, + 3980, + 4096, + 4138, + 4159, + 4159, + 4176, + 4181, + 4186, + 4189, + 4193, + 4193, + 4197, + 4198, + 4206, + 4208, + 4213, + 4225, + 4238, + 4238, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5905, + 5920, + 5937, + 5952, + 5969, + 5984, + 5996, + 5998, + 6000, + 6016, + 6067, + 6103, + 6103, + 6108, + 6108, + 6176, + 6263, + 6272, + 6312, + 6314, + 6314, + 6320, + 6389, + 6400, + 6428, + 6480, + 6509, + 6512, + 6516, + 6528, + 6571, + 6593, + 6599, + 6656, + 6678, + 6688, + 6740, + 6823, + 6823, + 6917, + 6963, + 6981, + 6987, + 7043, + 7072, + 7086, + 7087, + 7098, + 7141, + 7168, + 7203, + 7245, + 7247, + 7258, + 7293, + 7401, + 7404, + 7406, + 7409, + 7413, + 7414, + 7424, + 7615, + 7680, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11502, + 11506, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11648, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11823, + 11823, + 12293, + 12295, + 12321, + 12329, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42527, + 42538, + 42539, + 42560, + 42606, + 42623, + 42647, + 42656, + 42735, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43009, + 43011, + 43013, + 43015, + 43018, + 43020, + 43042, + 43072, + 43123, + 43138, + 43187, + 43250, + 43255, + 43259, + 43259, + 43274, + 43301, + 43312, + 43334, + 43360, + 43388, + 43396, + 43442, + 43471, + 43471, + 43520, + 43560, + 43584, + 43586, + 43588, + 43595, + 43616, + 43638, + 43642, + 43642, + 43648, + 43695, + 43697, + 43697, + 43701, + 43702, + 43705, + 43709, + 43712, + 43712, + 43714, + 43714, + 43739, + 43741, + 43744, + 43754, + 43762, + 43764, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44002, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64285, + 64287, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65136, + 65140, + 65142, + 65276, + 65313, + 65338, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; + var unicodeES5IdentifierPart = [ + 170, + 170, + 181, + 181, + 186, + 186, + 192, + 214, + 216, + 246, + 248, + 705, + 710, + 721, + 736, + 740, + 748, + 748, + 750, + 750, + 768, + 884, + 886, + 887, + 890, + 893, + 902, + 902, + 904, + 906, + 908, + 908, + 910, + 929, + 931, + 1013, + 1015, + 1153, + 1155, + 1159, + 1162, + 1319, + 1329, + 1366, + 1369, + 1369, + 1377, + 1415, + 1425, + 1469, + 1471, + 1471, + 1473, + 1474, + 1476, + 1477, + 1479, + 1479, + 1488, + 1514, + 1520, + 1522, + 1552, + 1562, + 1568, + 1641, + 1646, + 1747, + 1749, + 1756, + 1759, + 1768, + 1770, + 1788, + 1791, + 1791, + 1808, + 1866, + 1869, + 1969, + 1984, + 2037, + 2042, + 2042, + 2048, + 2093, + 2112, + 2139, + 2208, + 2208, + 2210, + 2220, + 2276, + 2302, + 2304, + 2403, + 2406, + 2415, + 2417, + 2423, + 2425, + 2431, + 2433, + 2435, + 2437, + 2444, + 2447, + 2448, + 2451, + 2472, + 2474, + 2480, + 2482, + 2482, + 2486, + 2489, + 2492, + 2500, + 2503, + 2504, + 2507, + 2510, + 2519, + 2519, + 2524, + 2525, + 2527, + 2531, + 2534, + 2545, + 2561, + 2563, + 2565, + 2570, + 2575, + 2576, + 2579, + 2600, + 2602, + 2608, + 2610, + 2611, + 2613, + 2614, + 2616, + 2617, + 2620, + 2620, + 2622, + 2626, + 2631, + 2632, + 2635, + 2637, + 2641, + 2641, + 2649, + 2652, + 2654, + 2654, + 2662, + 2677, + 2689, + 2691, + 2693, + 2701, + 2703, + 2705, + 2707, + 2728, + 2730, + 2736, + 2738, + 2739, + 2741, + 2745, + 2748, + 2757, + 2759, + 2761, + 2763, + 2765, + 2768, + 2768, + 2784, + 2787, + 2790, + 2799, + 2817, + 2819, + 2821, + 2828, + 2831, + 2832, + 2835, + 2856, + 2858, + 2864, + 2866, + 2867, + 2869, + 2873, + 2876, + 2884, + 2887, + 2888, + 2891, + 2893, + 2902, + 2903, + 2908, + 2909, + 2911, + 2915, + 2918, + 2927, + 2929, + 2929, + 2946, + 2947, + 2949, + 2954, + 2958, + 2960, + 2962, + 2965, + 2969, + 2970, + 2972, + 2972, + 2974, + 2975, + 2979, + 2980, + 2984, + 2986, + 2990, + 3001, + 3006, + 3010, + 3014, + 3016, + 3018, + 3021, + 3024, + 3024, + 3031, + 3031, + 3046, + 3055, + 3073, + 3075, + 3077, + 3084, + 3086, + 3088, + 3090, + 3112, + 3114, + 3123, + 3125, + 3129, + 3133, + 3140, + 3142, + 3144, + 3146, + 3149, + 3157, + 3158, + 3160, + 3161, + 3168, + 3171, + 3174, + 3183, + 3202, + 3203, + 3205, + 3212, + 3214, + 3216, + 3218, + 3240, + 3242, + 3251, + 3253, + 3257, + 3260, + 3268, + 3270, + 3272, + 3274, + 3277, + 3285, + 3286, + 3294, + 3294, + 3296, + 3299, + 3302, + 3311, + 3313, + 3314, + 3330, + 3331, + 3333, + 3340, + 3342, + 3344, + 3346, + 3386, + 3389, + 3396, + 3398, + 3400, + 3402, + 3406, + 3415, + 3415, + 3424, + 3427, + 3430, + 3439, + 3450, + 3455, + 3458, + 3459, + 3461, + 3478, + 3482, + 3505, + 3507, + 3515, + 3517, + 3517, + 3520, + 3526, + 3530, + 3530, + 3535, + 3540, + 3542, + 3542, + 3544, + 3551, + 3570, + 3571, + 3585, + 3642, + 3648, + 3662, + 3664, + 3673, + 3713, + 3714, + 3716, + 3716, + 3719, + 3720, + 3722, + 3722, + 3725, + 3725, + 3732, + 3735, + 3737, + 3743, + 3745, + 3747, + 3749, + 3749, + 3751, + 3751, + 3754, + 3755, + 3757, + 3769, + 3771, + 3773, + 3776, + 3780, + 3782, + 3782, + 3784, + 3789, + 3792, + 3801, + 3804, + 3807, + 3840, + 3840, + 3864, + 3865, + 3872, + 3881, + 3893, + 3893, + 3895, + 3895, + 3897, + 3897, + 3902, + 3911, + 3913, + 3948, + 3953, + 3972, + 3974, + 3991, + 3993, + 4028, + 4038, + 4038, + 4096, + 4169, + 4176, + 4253, + 4256, + 4293, + 4295, + 4295, + 4301, + 4301, + 4304, + 4346, + 4348, + 4680, + 4682, + 4685, + 4688, + 4694, + 4696, + 4696, + 4698, + 4701, + 4704, + 4744, + 4746, + 4749, + 4752, + 4784, + 4786, + 4789, + 4792, + 4798, + 4800, + 4800, + 4802, + 4805, + 4808, + 4822, + 4824, + 4880, + 4882, + 4885, + 4888, + 4954, + 4957, + 4959, + 4992, + 5007, + 5024, + 5108, + 5121, + 5740, + 5743, + 5759, + 5761, + 5786, + 5792, + 5866, + 5870, + 5872, + 5888, + 5900, + 5902, + 5908, + 5920, + 5940, + 5952, + 5971, + 5984, + 5996, + 5998, + 6000, + 6002, + 6003, + 6016, + 6099, + 6103, + 6103, + 6108, + 6109, + 6112, + 6121, + 6155, + 6157, + 6160, + 6169, + 6176, + 6263, + 6272, + 6314, + 6320, + 6389, + 6400, + 6428, + 6432, + 6443, + 6448, + 6459, + 6470, + 6509, + 6512, + 6516, + 6528, + 6571, + 6576, + 6601, + 6608, + 6617, + 6656, + 6683, + 6688, + 6750, + 6752, + 6780, + 6783, + 6793, + 6800, + 6809, + 6823, + 6823, + 6912, + 6987, + 6992, + 7001, + 7019, + 7027, + 7040, + 7155, + 7168, + 7223, + 7232, + 7241, + 7245, + 7293, + 7376, + 7378, + 7380, + 7414, + 7424, + 7654, + 7676, + 7957, + 7960, + 7965, + 7968, + 8005, + 8008, + 8013, + 8016, + 8023, + 8025, + 8025, + 8027, + 8027, + 8029, + 8029, + 8031, + 8061, + 8064, + 8116, + 8118, + 8124, + 8126, + 8126, + 8130, + 8132, + 8134, + 8140, + 8144, + 8147, + 8150, + 8155, + 8160, + 8172, + 8178, + 8180, + 8182, + 8188, + 8204, + 8205, + 8255, + 8256, + 8276, + 8276, + 8305, + 8305, + 8319, + 8319, + 8336, + 8348, + 8400, + 8412, + 8417, + 8417, + 8421, + 8432, + 8450, + 8450, + 8455, + 8455, + 8458, + 8467, + 8469, + 8469, + 8473, + 8477, + 8484, + 8484, + 8486, + 8486, + 8488, + 8488, + 8490, + 8493, + 8495, + 8505, + 8508, + 8511, + 8517, + 8521, + 8526, + 8526, + 8544, + 8584, + 11264, + 11310, + 11312, + 11358, + 11360, + 11492, + 11499, + 11507, + 11520, + 11557, + 11559, + 11559, + 11565, + 11565, + 11568, + 11623, + 11631, + 11631, + 11647, + 11670, + 11680, + 11686, + 11688, + 11694, + 11696, + 11702, + 11704, + 11710, + 11712, + 11718, + 11720, + 11726, + 11728, + 11734, + 11736, + 11742, + 11744, + 11775, + 11823, + 11823, + 12293, + 12295, + 12321, + 12335, + 12337, + 12341, + 12344, + 12348, + 12353, + 12438, + 12441, + 12442, + 12445, + 12447, + 12449, + 12538, + 12540, + 12543, + 12549, + 12589, + 12593, + 12686, + 12704, + 12730, + 12784, + 12799, + 13312, + 19893, + 19968, + 40908, + 40960, + 42124, + 42192, + 42237, + 42240, + 42508, + 42512, + 42539, + 42560, + 42607, + 42612, + 42621, + 42623, + 42647, + 42655, + 42737, + 42775, + 42783, + 42786, + 42888, + 42891, + 42894, + 42896, + 42899, + 42912, + 42922, + 43000, + 43047, + 43072, + 43123, + 43136, + 43204, + 43216, + 43225, + 43232, + 43255, + 43259, + 43259, + 43264, + 43309, + 43312, + 43347, + 43360, + 43388, + 43392, + 43456, + 43471, + 43481, + 43520, + 43574, + 43584, + 43597, + 43600, + 43609, + 43616, + 43638, + 43642, + 43643, + 43648, + 43714, + 43739, + 43741, + 43744, + 43759, + 43762, + 43766, + 43777, + 43782, + 43785, + 43790, + 43793, + 43798, + 43808, + 43814, + 43816, + 43822, + 43968, + 44010, + 44012, + 44013, + 44016, + 44025, + 44032, + 55203, + 55216, + 55238, + 55243, + 55291, + 63744, + 64109, + 64112, + 64217, + 64256, + 64262, + 64275, + 64279, + 64285, + 64296, + 64298, + 64310, + 64312, + 64316, + 64318, + 64318, + 64320, + 64321, + 64323, + 64324, + 64326, + 64433, + 64467, + 64829, + 64848, + 64911, + 64914, + 64967, + 65008, + 65019, + 65024, + 65039, + 65056, + 65062, + 65075, + 65076, + 65101, + 65103, + 65136, + 65140, + 65142, + 65276, + 65296, + 65305, + 65313, + 65338, + 65343, + 65343, + 65345, + 65370, + 65382, + 65470, + 65474, + 65479, + 65482, + 65487, + 65490, + 65495, + 65498, + 65500, + ]; function lookupInUnicodeMap(code, map) { if (code < map[0]) { return false; @@ -2075,15 +6836,11 @@ var ts; return false; } function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierStart) : - lookupInUnicodeMap(code, unicodeES3IdentifierStart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? - lookupInUnicodeMap(code, unicodeES5IdentifierPart) : - lookupInUnicodeMap(code, unicodeES3IdentifierPart); + return languageVersion >= 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } function makeReverseMap(source) { var result = []; @@ -2156,9 +6913,7 @@ var ts; ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; var hasOwnProperty = Object.prototype.hasOwnProperty; function isWhiteSpace(ch) { - return ch === 32 || ch === 9 || ch === 11 || ch === 12 || - ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || - ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { @@ -2245,8 +7000,7 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -2326,7 +7080,11 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ + pos: startPos, + end: pos, + hasTrailingNewLine: hasTrailingNewLine + }); } continue; } @@ -2353,15 +7111,11 @@ var ts; } ts.getTrailingCommentRanges = getTrailingCommentRanges; function isIdentifierStart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } ts.isIdentifierStart = isIdentifierStart; function isIdentifierPart(ch, languageVersion) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; function createScanner(languageVersion, skipTrivia, text, onError) { @@ -2380,14 +7134,10 @@ var ts; } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); } function isIdentifierPart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; @@ -3110,17 +7860,39 @@ var ts; } setText(text); return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 64 || token > 100; }, - isReservedWord: function () { return token >= 65 && token <= 100; }, - isUnterminated: function () { return tokenIsUnterminated; }, + getStartPos: function () { + return startPos; + }, + getTextPos: function () { + return pos; + }, + getToken: function () { + return token; + }, + getTokenPos: function () { + return tokenPos; + }, + getTokenText: function () { + return text.substring(tokenPos, pos); + }, + getTokenValue: function () { + return tokenValue; + }, + hasExtendedUnicodeEscape: function () { + return hasExtendedUnicodeEscape; + }, + hasPrecedingLineBreak: function () { + return precedingLineBreak; + }, + isIdentifier: function () { + return token === 64 || token > 100; + }, + isReservedWord: function () { + return token >= 65 && token <= 100; + }, + isUnterminated: function () { + return tokenIsUnterminated; + }, reScanGreaterToken: reScanGreaterToken, reScanSlashToken: reScanSlashToken, reScanTemplateToken: reScanTemplateToken, @@ -3150,9 +7922,13 @@ var ts; function getSingleLineStringWriter() { if (stringWriters.length == 0) { var str = ""; - var writeText = function (text) { return str += text; }; + var writeText = function (text) { + return str += text; + }; return { - string: function () { return str; }, + string: function () { + return str; + }, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, @@ -3160,11 +7936,18 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, - writeLine: function () { return str += " "; }, - increaseIndent: function () { }, - decreaseIndent: function () { }, - clear: function () { return str = ""; }, - trackSymbol: function () { } + writeLine: function () { + return str += " "; + }, + increaseIndent: function () { + }, + decreaseIndent: function () { + }, + clear: function () { + return str = ""; + }, + trackSymbol: function () { + } }; } return stringWriters.pop(); @@ -3186,8 +7969,7 @@ var ts; ts.containsParseError = containsParseError; function aggregateChildData(node) { if (!(node.parserContextFlags & 64)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || - ts.forEachChild(node, containsParseError); + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 16) !== 0) || ts.forEachChild(node, containsParseError); if (thisNodeOrAnySubNodesHasError) { node.parserContextFlags |= 32; } @@ -3195,7 +7977,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 220) { + while (node && node.kind !== 221) { node = node.parent; } return node; @@ -3266,15 +8048,35 @@ var ts; } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || - isCatchClauseVariableDeclaration(declaration); + return (getCombinedNodeFlags(declaration) & 12288) !== 0 || isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + function getEnclosingBlockScopeContainer(node) { + var current = node; + while (current) { + if (isFunctionLike(current)) { + return current; + } + switch (current.kind) { + case 221: + case 202: + case 217: + case 200: + case 181: + case 182: + case 183: + return current; + case 174: + if (!isFunctionLike(current.parent)) { + return current; + } + } + current = current.parent; + } + } + ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && - declaration.kind === 193 && - declaration.parent && - declaration.parent.kind === 216; + return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -3317,7 +8119,7 @@ var ts; case 197: case 200: case 199: - case 219: + case 220: case 195: case 160: errorNode = node.name; @@ -3326,9 +8128,7 @@ var ts; if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); + var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); return createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -3391,9 +8191,7 @@ var ts; function getJsDocComments(node, sourceFileOfNode) { return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), isJsDocComment); function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47; } } ts.getJsDocComments = getJsDocComments; @@ -3404,6 +8202,7 @@ var ts; switch (node.kind) { case 186: return visitor(node); + case 202: case 174: case 178: case 179: @@ -3413,11 +8212,11 @@ var ts; case 183: case 187: case 188: - case 213: case 214: + case 215: case 189: case 191: - case 216: + case 217: return ts.forEachChild(node, traverse); } } @@ -3427,12 +8226,12 @@ var ts; if (node) { switch (node.kind) { case 150: - case 219: + case 220: case 128: - case 217: + case 218: case 130: case 129: - case 218: + case 219: case 193: return true; } @@ -3510,7 +8309,7 @@ var ts; case 134: case 135: case 199: - case 220: + case 221: return node; } } @@ -3601,8 +8400,8 @@ var ts; case 128: case 130: case 129: - case 219: - case 217: + case 220: + case 218: case 150: return parent.initializer === node; case 177: @@ -3612,20 +8411,17 @@ var ts; case 186: case 187: case 188: - case 213: + case 214: case 190: case 188: return parent.expression === node; case 181: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || - forStatement.condition === node || - forStatement.iterator === node; + return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; case 182: case 183: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || - forInStatement.expression === node; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || forInStatement.expression === node; case 158: return node === parent.expression; case 173: @@ -3643,12 +8439,11 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 || (preserveConstEnums && moduleState === 2); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind === 212; + return node.kind === 203 && node.moduleReference.kind === 213; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -3657,20 +8452,20 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 202 && node.moduleReference.kind !== 212; + return node.kind === 203 && node.moduleReference.kind !== 213; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 203) { + if (node.kind === 204) { return node.moduleSpecifier; } - if (node.kind === 202) { + if (node.kind === 203) { var reference = node.moduleReference; - if (reference.kind === 212) { + if (reference.kind === 213) { return reference.expression; } } - if (node.kind === 209) { + if (node.kind === 210) { return node.moduleSpecifier; } } @@ -3687,8 +8482,8 @@ var ts; case 132: case 131: return node.questionToken !== undefined; + case 219: case 218: - case 217: case 130: case 129: return node.questionToken !== undefined; @@ -3734,25 +8529,25 @@ var ts; case 196: case 133: case 199: - case 219: - case 211: + case 220: + case 212: case 195: case 160: case 134: - case 204: - case 202: - case 207: + case 205: + case 203: + case 208: case 197: case 132: case 131: case 200: - case 205: + case 206: case 128: - case 217: + case 218: case 130: case 129: case 135: - case 218: + case 219: case 198: case 127: case 193: @@ -3781,7 +8576,7 @@ var ts; case 175: case 180: case 187: - case 208: + case 209: return true; default: return false; @@ -3793,7 +8588,7 @@ var ts; return false; } var parent = name.parent; - if (parent.kind === 207 || parent.kind === 211) { + if (parent.kind === 208 || parent.kind === 212) { if (parent.propertyName) { return true; } @@ -3891,9 +8686,7 @@ var ts; } ts.isTrivia = isTrivia; function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 126 && - !isWellKnownSymbolSyntactically(declaration.name.expression); + return declaration.name && declaration.name.kind === 126 && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; function isWellKnownSymbolSyntactically(node) { @@ -3997,7 +8790,10 @@ var ts; if (length < 0) { throw new Error("length < 0"); } - return { start: start, length: length }; + return { + start: start, + length: length + }; } ts.createTextSpan = createTextSpan; function createTextSpanFromBounds(start, end) { @@ -4016,7 +8812,10 @@ var ts; if (newLength < 0) { throw new Error("newLength < 0"); } - return { span: span, newLength: newLength }; + return { + span: span, + newLength: newLength + }; } ts.createTextChangeRange = createTextChangeRange; ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); @@ -4047,11 +8846,11 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 200 || n.kind === 220; + return isFunctionLike(n) || n.kind === 200 || n.kind === 221; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { - return node.pos === -1 && node.end === -1; + return node.pos === -1; } ts.nodeIsSynthesized = nodeIsSynthesized; function createSynthesizedNode(kind, startsOnNewLine) { @@ -4177,15 +8976,15 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; + return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { + return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); + }) : s; } ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(222); + var nodeConstructors = new Array(223); ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); @@ -4223,35 +9022,23 @@ var ts; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { case 125: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); case 127: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.constraint) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); case 128: case 130: case 129: - case 217: case 218: + case 219: case 193: case 150: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.dotDotDotToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); case 140: case 141: case 136: case 137: case 138: - return visitNodes(cbNodes, node.modifiers) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type); case 132: case 131: case 133: @@ -4260,17 +9047,9 @@ var ts; case 160: case 195: case 161: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); case 139: - return visitNode(cbNode, node.typeName) || - visitNodes(cbNodes, node.typeArguments); + return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); case 142: return visitNode(cbNode, node.exprName); case 143: @@ -4291,23 +9070,16 @@ var ts; case 152: return visitNodes(cbNodes, node.properties); case 153: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.dotToken) || - visitNode(cbNode, node.name); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); case 154: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); case 155: case 156: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments) || - visitNodes(cbNodes, node.arguments); + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); case 157: - return visitNode(cbNode, node.tag) || - visitNode(cbNode, node.template); + return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); case 158: - return visitNode(cbNode, node.type) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); case 159: return visitNode(cbNode, node.expression); case 162: @@ -4319,149 +9091,100 @@ var ts; case 165: return visitNode(cbNode, node.operand); case 170: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); case 166: return visitNode(cbNode, node.operand); case 167: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.operatorToken) || - visitNode(cbNode, node.right); + return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); case 168: - return visitNode(cbNode, node.condition) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.whenTrue) || - visitNode(cbNode, node.colonToken) || - visitNode(cbNode, node.whenFalse); + return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); case 171: return visitNode(cbNode, node.expression); case 174: case 201: return visitNodes(cbNodes, node.statements); - case 220: - return visitNodes(cbNodes, node.statements) || - visitNode(cbNode, node.endOfFileToken); + case 221: + return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); case 175: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.declarationList); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); case 194: return visitNodes(cbNodes, node.declarations); case 177: return visitNode(cbNode, node.expression); case 178: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.thenStatement) || - visitNode(cbNode, node.elseStatement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); case 179: - return visitNode(cbNode, node.statement) || - visitNode(cbNode, node.expression); + return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); case 180: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 181: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.iterator) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); case 182: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 183: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 184: case 185: return visitNode(cbNode, node.label); case 186: return visitNode(cbNode, node.expression); case 187: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); case 188: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.clauses); - case 213: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); + case 202: + return visitNodes(cbNodes, node.clauses); case 214: + return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); + case 215: return visitNodes(cbNodes, node.statements); case 189: - return visitNode(cbNode, node.label) || - visitNode(cbNode, node.statement); + return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); case 190: return visitNode(cbNode, node.expression); case 191: - return visitNode(cbNode, node.tryBlock) || - visitNode(cbNode, node.catchClause) || - visitNode(cbNode, node.finallyBlock); - case 216: - return visitNode(cbNode, node.variableDeclaration) || - visitNode(cbNode, node.block); + return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); + case 217: + return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); case 196: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 197: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); case 198: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); case 199: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 219: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); + case 220: + return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.body); - case 202: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.moduleReference); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); case 203: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.importClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); case 204: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.namedBindings); + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name); + return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); case 206: - case 210: - return visitNodes(cbNodes, node.elements); - case 209: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.exportClause) || - visitNode(cbNode, node.moduleSpecifier); + return visitNode(cbNode, node.name); case 207: case 211: - return visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.name); + return visitNodes(cbNodes, node.elements); + case 210: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); case 208: - return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); + case 212: + return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + case 209: + return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); case 126: return visitNode(cbNode, node.expression); - case 215: + case 216: return visitNodes(cbNodes, node.types); - case 212: + case 213: return visitNode(cbNode, node.expression); } } @@ -4499,40 +9222,69 @@ var ts; })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0: return ts.Diagnostics.Declaration_or_statement_expected; - case 1: return ts.Diagnostics.Declaration_or_statement_expected; - case 2: return ts.Diagnostics.Statement_expected; - case 3: return ts.Diagnostics.case_or_default_expected; - case 4: return ts.Diagnostics.Statement_expected; - case 5: return ts.Diagnostics.Property_or_signature_expected; - case 6: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7: return ts.Diagnostics.Enum_member_expected; - case 8: return ts.Diagnostics.Type_reference_expected; - case 9: return ts.Diagnostics.Variable_declaration_expected; - case 10: return ts.Diagnostics.Property_destructuring_pattern_expected; - case 11: return ts.Diagnostics.Array_element_destructuring_pattern_expected; - case 12: return ts.Diagnostics.Argument_expression_expected; - case 13: return ts.Diagnostics.Property_assignment_expected; - case 14: return ts.Diagnostics.Expression_or_comma_expected; - case 15: return ts.Diagnostics.Parameter_declaration_expected; - case 16: return ts.Diagnostics.Type_parameter_declaration_expected; - case 17: return ts.Diagnostics.Type_argument_expected; - case 18: return ts.Diagnostics.Type_expected; - case 19: return ts.Diagnostics.Unexpected_token_expected; - case 20: return ts.Diagnostics.Identifier_expected; + case 0: + return ts.Diagnostics.Declaration_or_statement_expected; + case 1: + return ts.Diagnostics.Declaration_or_statement_expected; + case 2: + return ts.Diagnostics.Statement_expected; + case 3: + return ts.Diagnostics.case_or_default_expected; + case 4: + return ts.Diagnostics.Statement_expected; + case 5: + return ts.Diagnostics.Property_or_signature_expected; + case 6: + return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7: + return ts.Diagnostics.Enum_member_expected; + case 8: + return ts.Diagnostics.Type_reference_expected; + case 9: + return ts.Diagnostics.Variable_declaration_expected; + case 10: + return ts.Diagnostics.Property_destructuring_pattern_expected; + case 11: + return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 12: + return ts.Diagnostics.Argument_expression_expected; + case 13: + return ts.Diagnostics.Property_assignment_expected; + case 14: + return ts.Diagnostics.Expression_or_comma_expected; + case 15: + return ts.Diagnostics.Parameter_declaration_expected; + case 16: + return ts.Diagnostics.Type_parameter_declaration_expected; + case 17: + return ts.Diagnostics.Type_argument_expected; + case 18: + return ts.Diagnostics.Type_expected; + case 19: + return ts.Diagnostics.Unexpected_token_expected; + case 20: + return ts.Diagnostics.Identifier_expected; } } ; function modifierToFlag(token) { switch (token) { - case 109: return 128; - case 108: return 16; - case 107: return 64; - case 106: return 32; - case 77: return 1; - case 114: return 2; - case 69: return 8192; - case 72: return 256; + case 109: + return 128; + case 108: + return 16; + case 107: + return 64; + case 106: + return 32; + case 77: + return 1; + case 114: + return 2; + case 69: + return 8192; + case 72: + return 256; } return 0; } @@ -4763,8 +9515,7 @@ var ts; } ts.updateSourceFile = updateSourceFile; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 64 && - (node.text === "eval" || node.text === "arguments"); + return node.kind === 64 && (node.text === "eval" || node.text === "arguments"); } ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; function isUseStrictPrologueDirective(sourceFile, node) { @@ -4850,7 +9601,7 @@ var ts; var identifierCount = 0; var nodeCount = 0; var token; - var sourceFile = createNode(220, 0); + var sourceFile = createNode(221, 0); sourceFile.pos = 0; sourceFile.end = sourceText.length; sourceFile.text = sourceText; @@ -4986,9 +9737,7 @@ var ts; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; var saveContextFlags = contextFlags; - var result = isLookAhead - ? scanner.lookAhead(callback) - : scanner.tryScan(callback); + var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); if (!result || isLookAhead) { token = saveToken; @@ -5039,8 +9788,7 @@ var ts; return undefined; } function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { - return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + return parseOptionalToken(t) || createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); } function parseTokenNode() { var node = createNode(token); @@ -5117,9 +9865,7 @@ var ts; return createIdentifier(isIdentifierOrKeyword()); } function isLiteralPropertyName() { - return isIdentifierOrKeyword() || - token === 8 || - token === 7; + return isIdentifierOrKeyword() || token === 8 || token === 7; } function parsePropertyName() { if (token === 8 || token === 7) { @@ -5172,10 +9918,7 @@ var ts; return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 - || isLiteralPropertyName(); + return token === 18 || token === 14 || token === 35 || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); @@ -5233,8 +9976,7 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || - token === 78) { + if (token === 102 || token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -5400,10 +10142,10 @@ var ts; function isReusableModuleElement(node) { if (node) { switch (node.kind) { + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 196: case 197: case 200: @@ -5431,8 +10173,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 213: case 214: + case 215: return true; } } @@ -5467,7 +10209,7 @@ var ts; return false; } function isReusableEnumMember(node) { - return node.kind === 219; + return node.kind === 220; } function isReusableTypeMember(node) { if (node) { @@ -5615,9 +10357,7 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { + if (node.kind === 7 && sourceText.charCodeAt(tokenPos) === 48 && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { node.flags |= 16384; } return node; @@ -5656,9 +10396,7 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 - ? parseLiteralNode(true) - : parseType(); + return token === 8 ? parseLiteralNode(true) : parseType(); } return undefined; } @@ -5816,11 +10554,7 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || - canParseSemicolon(); + return token === 16 || token === 24 || token === 50 || token === 51 || canParseSemicolon(); } function parseTypeMember() { switch (token) { @@ -5828,9 +10562,7 @@ var ts; case 24: return parseSignatureMember(136); case 18: - return isIndexSignature() - ? parseIndexSignatureDeclaration(undefined) - : parsePropertyOrMethodSignature(); + return isIndexSignature() ? parseIndexSignatureDeclaration(undefined) : parsePropertyOrMethodSignature(); case 87: if (lookAhead(isStartOfConstructSignature)) { return parseSignatureMember(137); @@ -5852,9 +10584,7 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() - ? parseIndexSignatureDeclaration(modifiers) - : undefined; + return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -5960,7 +10690,9 @@ var ts; function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); if (token === 44) { - var types = [type]; + var types = [ + type + ]; types.pos = type.pos; while (parseOptional(44)) { types.push(parseArrayTypeOrHigher()); @@ -5985,9 +10717,7 @@ var ts; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 52 || - isIdentifier() || ts.isModifier(token)) { + if (token === 51 || token === 23 || token === 50 || token === 52 || isIdentifier() || ts.isModifier(token)) { return true; } if (token === 17) { @@ -6115,8 +10845,7 @@ var ts; function parseYieldExpression() { var node = createNode(170); nextToken(); - if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { + if (!scanner.hasPrecedingLineBreak() && (token === 35 || isStartOfExpression())) { node.asteriskToken = parseOptionalToken(35); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); @@ -6131,7 +10860,9 @@ var ts; var parameter = createNode(128, identifier.pos); parameter.name = identifier; finishNode(parameter); - node.parameters = [parameter]; + node.parameters = [ + parameter + ]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; parseExpected(32); @@ -6143,9 +10874,7 @@ var ts; if (triState === 0) { return undefined; } - var arrowFunction = triState === 1 - ? parseParenthesizedArrowFunctionExpressionHead(true) - : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); + var arrowFunction = triState === 1 ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { return undefined; } @@ -6367,9 +11096,7 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 - ? parseSuperExpression() - : parseMemberExpressionOrHigher(); + var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -6423,9 +11150,7 @@ var ts; if (token === 10 || token === 11) { var tagExpression = createNode(157, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 - ? parseLiteralNode() - : parseTemplateExpression(); + tagExpression.template = token === 10 ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); continue; } @@ -6471,9 +11196,7 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() - ? typeArguments - : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -6548,9 +11271,7 @@ var ts; return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(172) : - parseAssignmentExpressionOrHigher(); + return token === 21 ? parseSpreadElement() : token === 23 ? createNode(172) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return allowInAnd(parseArgumentOrArrayLiteralElement); @@ -6589,13 +11310,13 @@ var ts; return parseMethodDeclaration(fullStart, modifiers, asteriskToken, propertyName, questionToken); } if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(218, fullStart); + var shorthandDeclaration = createNode(219, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(217, fullStart); + var propertyAssignment = createNode(218, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; parseExpected(51); @@ -6761,7 +11482,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(213); + var node = createNode(214); parseExpected(66); node.expression = allowInAnd(parseExpression); parseExpected(51); @@ -6769,7 +11490,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(214); + var node = createNode(215); parseExpected(72); parseExpected(51); node.statements = parseList(4, false, parseStatement); @@ -6784,9 +11505,11 @@ var ts; parseExpected(16); node.expression = allowInAnd(parseExpression); parseExpected(17); + var caseBlock = createNode(202, scanner.getStartPos()); parseExpected(14); - node.clauses = parseList(3, false, parseCaseOrDefaultClause); + caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); parseExpected(15); + node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { @@ -6808,7 +11531,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(216); + var result = createNode(217); parseExpected(67); if (parseExpected(16)) { result.variableDeclaration = parseVariableDeclaration(); @@ -7198,11 +11921,7 @@ var ts; if (isIndexSignature()) { return parseIndexSignatureDeclaration(modifiers); } - if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { + if (isIdentifierOrKeyword() || token === 8 || token === 7 || token === 35 || token === 18) { return parsePropertyOrMethodDeclaration(fullStart, modifiers); } ts.Debug.fail("Should not have attempted to parse class member declaration."); @@ -7215,9 +11934,7 @@ var ts; node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { - node.members = inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseClassMembers) - : parseClassMembers(); + node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); parseExpected(15); } else { @@ -7227,9 +11944,7 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseHeritageClausesWorker) - : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); } return undefined; } @@ -7238,7 +11953,7 @@ var ts; } function parseHeritageClause() { if (token === 78 || token === 102) { - var node = createNode(215); + var node = createNode(216); node.token = token; nextToken(); node.types = parseDelimitedList(8, parseTypeReference); @@ -7273,7 +11988,7 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNode(219, scanner.getStartPos()); + var node = createNode(220, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); @@ -7308,9 +12023,7 @@ var ts; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, 1) - : parseModuleBlock(); + node.body = parseOptional(20) ? parseInternalModuleTail(getNodePos(), undefined, 1) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, modifiers) { @@ -7322,21 +12035,17 @@ var ts; } function parseModuleDeclaration(fullStart, modifiers) { parseExpected(116); - return token === 8 - ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) - : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); + return token === 8 ? parseAmbientExternalModuleDeclaration(fullStart, modifiers) : parseInternalModuleTail(fullStart, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 117 && - lookAhead(nextTokenIsOpenParen); + return token === 117 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { return nextToken() === 16; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 123; + return token === 23 || token === 123; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, modifiers) { parseExpected(84); @@ -7345,7 +12054,7 @@ var ts; if (isIdentifier()) { identifier = parseIdentifier(); if (token !== 23 && token !== 123) { - var importEqualsDeclaration = createNode(202, fullStart); + var importEqualsDeclaration = createNode(203, fullStart); setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; parseExpected(52); @@ -7354,11 +12063,9 @@ var ts; return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(203, fullStart); + var importDeclaration = createNode(204, fullStart); setModifiers(importDeclaration, modifiers); - if (identifier || - token === 35 || - token === 14) { + if (identifier || token === 35 || token === 14) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(123); } @@ -7367,23 +12074,20 @@ var ts; return finishNode(importDeclaration); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(204, fullStart); + var importClause = createNode(205, fullStart); if (identifier) { importClause.name = identifier; } - if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(206); + if (!importClause.name || parseOptional(23)) { + importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(207); } return finishNode(importClause); } function parseModuleReference() { - return isExternalModuleReference() - ? parseExternalModuleReference() - : parseEntityName(false); + return isExternalModuleReference() ? parseExternalModuleReference() : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(212); + var node = createNode(213); parseExpected(117); parseExpected(16); node.expression = parseModuleSpecifier(); @@ -7398,7 +12102,7 @@ var ts; return result; } function parseNamespaceImport() { - var namespaceImport = createNode(205); + var namespaceImport = createNode(206); parseExpected(35); parseExpected(101); namespaceImport.name = parseIdentifier(); @@ -7406,14 +12110,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 206 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + node.elements = parseBracketedList(20, kind === 207 ? parseImportSpecifier : parseExportSpecifier, 14, 15); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(211); + return parseImportOrExportSpecifier(212); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(207); + return parseImportOrExportSpecifier(208); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -7439,14 +12143,14 @@ var ts; return finishNode(node); } function parseExportDeclaration(fullStart, modifiers) { - var node = createNode(209, fullStart); + var node = createNode(210, fullStart); setModifiers(node, modifiers); if (parseOptional(35)) { parseExpected(123); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(210); + node.exportClause = parseNamedImportsOrExports(211); if (parseOptional(123)) { node.moduleSpecifier = parseModuleSpecifier(); } @@ -7455,7 +12159,7 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, modifiers) { - var node = createNode(208, fullStart); + var node = createNode(209, fullStart); setModifiers(node, modifiers); if (parseOptional(52)) { node.isExportEquals = true; @@ -7510,13 +12214,11 @@ var ts; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 || token === 35 || token === 14; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 52 || token === 35 || - token === 14 || token === 72 || isDeclarationStart(); + return token === 52 || token === 35 || token === 14 || token === 72 || isDeclarationStart(); } function nextTokenIsDeclarationStart() { nextToken(); @@ -7570,9 +12272,7 @@ var ts; return parseSourceElementOrModuleElement(); } function parseSourceElementOrModuleElement() { - return isDeclarationStart() - ? parseDeclaration() - : parseStatement(); + return isDeclarationStart() ? parseDeclaration() : parseStatement(); } function processReferenceComments(sourceFile) { var triviaScanner = ts.createScanner(sourceFile.languageVersion, false, sourceText); @@ -7587,7 +12287,10 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos() + }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -7618,7 +12321,10 @@ var ts; var pathMatchResult = pathRegex.exec(comment); var nameMatchResult = nameRegex.exec(comment); if (pathMatchResult) { - var amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; + var amdDependency = { + path: pathMatchResult[2], + name: nameMatchResult ? nameMatchResult[2] : undefined + }; amdDependencies.push(amdDependency); } } @@ -7630,13 +12336,7 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 202 && node.moduleReference.kind === 212 - || node.kind === 203 - || node.kind === 208 - || node.kind === 209 - ? node - : undefined; + return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; }); } } @@ -7690,7 +12390,7 @@ var ts; else if (ts.isConstEnumDeclaration(node)) { return 2; } - else if ((node.kind === 203 || node.kind === 202) && !(node.flags & 1)) { + else if ((node.kind === 204 || node.kind === 203) && !(node.flags & 1)) { return 0; } else if (node.kind === 201) { @@ -7783,9 +12483,9 @@ var ts; return "__new"; case 138: return "__index"; - case 209: + case 210: return "__export"; - case 208: + case 209: return "default"; case 195: case 196: @@ -7804,9 +12504,7 @@ var ts; if (node.name) { node.name.parent = node; } - var message = symbol.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; + var message = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); }); @@ -7843,7 +12541,7 @@ var ts; function declareModuleMember(node, symbolKind, symbolExcludes) { var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; if (symbolKind & 8388608) { - if (node.kind === 211 || (node.kind === 202 && hasExportModifier)) { + if (node.kind === 212 || (node.kind === 203 && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -7852,9 +12550,7 @@ var ts; } else { if (hasExportModifier || isAmbientContext(container)) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); + var exportKind = (symbolKind & 107455 ? 1048576 : 0) | (symbolKind & 793056 ? 2097152 : 0) | (symbolKind & 1536 ? 4194304 : 0); var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); node.localSymbol = local; @@ -7880,7 +12576,7 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 220); + setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 221); } ts.forEachChild(node, bind); container = saveContainer; @@ -7892,7 +12588,7 @@ var ts; case 200: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; @@ -7970,7 +12666,7 @@ var ts; case 200: declareModuleMember(node, 2, 107455); break; - case 220: + case 221: if (ts.isExternalModule(container)) { declareModuleMember(node, 2, 107455); break; @@ -8011,11 +12707,11 @@ var ts; case 129: bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); break; - case 217: case 218: + case 219: bindPropertyOrMethodOrAccessor(node, 4, 107455, false); break; - case 219: + case 220: bindPropertyOrMethodOrAccessor(node, 8, 107455, false); break; case 136: @@ -8053,7 +12749,7 @@ var ts; case 161: bindAnonymousDeclaration(node, 16, "__function", true); break; - case 216: + case 217: bindCatchVariableDeclaration(node); break; case 196: @@ -8076,13 +12772,13 @@ var ts; case 200: bindModuleDeclaration(node); break; - case 202: - case 205: - case 207: - case 211: + case 203: + case 206: + case 208: + case 212: bindDeclaration(node, 8388608, 8388608, false); break; - case 204: + case 205: if (node.name) { bindDeclaration(node, 8388608, 8388608, false); } @@ -8090,13 +12786,13 @@ var ts; bindChildren(node, 0, false); } break; - case 209: + case 210: if (!node.exportClause) { declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); } bindChildren(node, 0, false); break; - case 208: + case 209: if (node.expression.kind === 64) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 8388608); } @@ -8105,7 +12801,7 @@ var ts; } bindChildren(node, 0, false); break; - case 220: + case 221: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; @@ -8113,11 +12809,11 @@ var ts; case 174: bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 216: + case 217: case 181: case 182: case 183: - case 188: + case 202: bindChildren(node, 0, true); break; default: @@ -8134,9 +12830,7 @@ var ts; else { bindDeclaration(node, 1, 107455, false); } - if (node.flags & 112 && - node.parent.kind === 133 && - node.parent.parent.kind === 196) { + if (node.flags & 112 && node.parent.kind === 133 && node.parent.parent.kind === 196) { var classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); } @@ -8168,12 +12862,24 @@ var ts; var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); var checker = { - getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getNodeCount: function () { + return ts.sum(host.getSourceFiles(), "nodeCount"); + }, + getIdentifierCount: function () { + return ts.sum(host.getSourceFiles(), "identifierCount"); + }, + getSymbolCount: function () { + return ts.sum(host.getSourceFiles(), "symbolCount"); + }, + getTypeCount: function () { + return typeCount; + }, + isUndefinedSymbol: function (symbol) { + return symbol === undefinedSymbol; + }, + isArgumentsSymbol: function (symbol) { + return symbol === argumentsSymbol; + }, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, @@ -8269,9 +12975,7 @@ var ts; return emitResolver; } function error(location, message, arg0, arg1, arg2) { - var diagnostic = location - ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) - : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); + var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); diagnostics.add(diagnostic); } function createSymbol(flags, name) { @@ -8357,8 +13061,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message = target.flags & 2 || source.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); }); @@ -8405,10 +13108,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 220); + return ts.getAncestor(node, 221); } function isGlobalSourceFile(node) { - return node.kind === 220 && !ts.isExternalModule(node); + return node.kind === 221 && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -8449,12 +13152,12 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 211)) { + if (!(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 212)) { break loop; } result = undefined; @@ -8538,28 +13241,54 @@ var ts; return undefined; } if (result.flags & 2) { - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); - } + checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } + function checkResolvedBlockScopedVariable(result, errorLocation) { + ts.Debug.assert((result.flags & 2) !== 0); + var declaration = ts.forEach(result.declarations, function (d) { + return ts.isBlockOrCatchScoped(d) ? d : undefined; + }); + ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); + if (!isUsedBeforeDeclaration) { + var variableDeclaration = ts.getAncestor(declaration, 193); + var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); + if (variableDeclaration.parent.parent.kind === 175 || variableDeclaration.parent.parent.kind === 181) { + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); + } + else if (variableDeclaration.parent.parent.kind === 183 || variableDeclaration.parent.parent.kind === 182) { + var expression = variableDeclaration.parent.parent.expression; + isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); + } + } + if (isUsedBeforeDeclaration) { + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); + } + } + function isSameScopeDescendentOf(initial, parent, stopAt) { + if (!parent) { + return false; + } + for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { + if (current === parent) { + return true; + } + } + return false; + } function isAliasSymbolDeclaration(node) { - return node.kind === 202 || - node.kind === 204 && !!node.name || - node.kind === 205 || - node.kind === 207 || - node.kind === 211 || - node.kind === 208; + return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; } function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return isAliasSymbolDeclaration(d) ? d : undefined; }); + return ts.forEach(symbol.declarations, function (d) { + return isAliasSymbolDeclaration(d) ? d : undefined; + }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 212) { + if (node.moduleReference.kind === 213) { var moduleSymbol = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var exportAssignmentSymbol = moduleSymbol && getResolvedExportAssignmentSymbol(moduleSymbol); return exportAssignmentSymbol || moduleSymbol; @@ -8597,26 +13326,24 @@ var ts; return getExternalModuleMember(node.parent.parent.parent, node); } function getTargetOfExportSpecifier(node) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { return resolveEntityName(node.expression, 107455 | 793056 | 1536); } function getTargetOfImportDeclaration(node) { switch (node.kind) { - case 202: + case 203: return getTargetOfImportEqualsDeclaration(node); - case 204: - return getTargetOfImportClause(node); case 205: + return getTargetOfImportClause(node); + case 206: return getTargetOfNamespaceImport(node); - case 207: + case 208: return getTargetOfImportSpecifier(node); - case 211: + case 212: return getTargetOfExportSpecifier(node); - case 208: + case 209: return getTargetOfExportAssignment(node); } } @@ -8651,10 +13378,10 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 208) { + if (node.kind === 209) { checkExpressionCached(node.expression); } - else if (node.kind === 211) { + else if (node.kind === 212) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -8664,7 +13391,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 202); + importDeclaration = ts.getAncestor(entityName, 203); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 64 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -8674,7 +13401,7 @@ var ts; return resolveEntityName(entityName, 1536); } else { - ts.Debug.assert(entityName.parent.kind === 202); + ts.Debug.assert(entityName.parent.kind === 203); return resolveEntityName(entityName, 107455 | 793056 | 1536); } } @@ -8814,9 +13541,7 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 - ? getMergedSymbol(symbol.exportSymbol) - : symbol; + return symbol && (symbol.flags & 1048576) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { if (symbol.flags & 16777216) { @@ -8855,10 +13580,7 @@ var ts; return type; } function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 && - name.charCodeAt(1) === 95 && - name.charCodeAt(2) !== 95 && - name.charCodeAt(2) !== 64; + return name.charCodeAt(0) === 95 && name.charCodeAt(1) === 95 && name.charCodeAt(2) !== 95 && name.charCodeAt(2) !== 64; } function getNamedMembers(members) { var result; @@ -8899,7 +13621,7 @@ var ts; } } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) { break; } @@ -8932,24 +13654,28 @@ var ts; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; + return [ + symbol + ]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 8388608) { - if (!useOnlyExternalAliasing || - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; + return [ + symbolFromSymbolTable + ]; } var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + return [ + symbolFromSymbolTable + ].concat(accessibleSymbolsFromExports); } } } @@ -9014,7 +13740,9 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { + accessibility: 0 + }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -9024,20 +13752,22 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || - (declaration.kind === 220 && ts.isExternalModule(declaration)); + return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { + if (ts.forEach(symbol.declarations, function (declaration) { + return !getIsDeclarationVisible(declaration); + })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { + accessibility: 0, + aliasesToMakeVisible: aliasesToMakeVisible + }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 202 && - !(declaration.flags & 1) && - isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 203 && !(declaration.flags & 1) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9045,7 +13775,9 @@ var ts; } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [ + declaration + ]; } return true; } @@ -9059,8 +13791,7 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || - entityName.parent.kind === 202) { + else if (entityName.kind === 125 || entityName.parent.kind === 203) { meaning = 1536; } else { @@ -9146,8 +13877,7 @@ var ts; function walkSymbol(symbol, meaning) { if (symbol) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { @@ -9179,8 +13909,7 @@ var ts; return writeType(type, globalFlags); function writeType(type, flags) { if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + writer.writeKeyword(!(globalFlags & 16) && (type.flags & 1) ? "any" : type.intrinsicName); } else if (type.flags & 4096) { writeTypeReference(type, flags); @@ -9273,16 +14002,14 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && - ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && - (type.symbol.parent || - ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 220 || declaration.parent.kind === 201; - })); + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 && ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.flags & 128; + })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { + return declaration.parent.kind === 221 || declaration.parent.kind === 201; + })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + return !!(flags & 2) || (typeStack && ts.contains(typeStack, type)); } } } @@ -9512,7 +14239,7 @@ var ts; return node; } } - else if (node.kind === 220) { + else if (node.kind === 221) { return ts.isExternalModule(node) ? node : undefined; } } @@ -9562,10 +14289,9 @@ var ts; case 198: case 195: case 199: - case 202: + case 203: var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 202 && parent.kind !== 220 && ts.isInAmbientContext(parent))) { + if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -9594,7 +14320,7 @@ var ts; case 147: return isDeclarationVisible(node.parent); case 127: - case 220: + case 221: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -9620,7 +14346,9 @@ var ts; } function getTypeOfPrototypeProperty(prototype) { var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; + return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { + return anyType; + })) : classType; } function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); @@ -9640,9 +14368,7 @@ var ts; } if (pattern.kind === 148) { var name = declaration.propertyName || declaration.name; - var type = getTypeOfPropertyOfType(parentType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + var type = getTypeOfPropertyOfType(parentType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); if (!type) { error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name)); return unknownType; @@ -9657,7 +14383,12 @@ var ts; var propName = "" + ts.indexOf(pattern.elements, declaration); var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + if (isTupleType(parentType)) { + error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); + } + else { + error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); + } return unknownType; } } @@ -9672,7 +14403,7 @@ var ts; return anyType; } if (declaration.parent.parent.kind === 183) { - return getTypeForVariableDeclarationInForOfStatement(declaration.parent.parent); + return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); @@ -9696,7 +14427,7 @@ var ts; if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 218) { + if (declaration.kind === 219) { return checkIdentifier(declaration.name); } return undefined; @@ -9733,9 +14464,7 @@ var ts; return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { - return pattern.kind === 148 - ? getTypeFromObjectBindingPattern(pattern) - : getTypeFromArrayBindingPattern(pattern); + return pattern.kind === 148 ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); @@ -9743,7 +14472,7 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 217 ? getWidenedType(type) : type; + return declaration.kind !== 218 ? getWidenedType(type) : type; } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); @@ -9764,10 +14493,10 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 216) { + if (declaration.parent.kind === 217) { return links.type = anyType; } - if (declaration.kind === 208) { + if (declaration.kind === 209) { return links.type = checkExpression(declaration.expression); } links.type = resolvingType; @@ -9779,9 +14508,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : - ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; + var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); } } @@ -9915,7 +14642,9 @@ var ts; ts.forEach(declaration.typeParameters, function (node) { var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); if (!result) { - result = [tp]; + result = [ + tp + ]; } else if (!ts.contains(result, tp)) { result.push(tp); @@ -10161,14 +14890,15 @@ var ts; var baseType = classType.baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? - getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); + var signature = baseType.flags & 4096 ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; return signature; }); } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; + return [ + createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false) + ]; } function createTupleTypeMemberSymbols(memberTypes) { var members = {}; @@ -10197,7 +14927,9 @@ var ts; return true; } function getUnionSignatures(types, kind) { - var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); + var signatureLists = ts.map(types, function (t) { + return getSignaturesOfType(t, kind); + }); var signatures = signatureLists[0]; for (var i = 0; i < signatures.length; i++) { if (signatures[i].typeParameters) { @@ -10213,7 +14945,9 @@ var ts; for (var i = 0; i < result.length; i++) { var s = result[i]; s.resolvedReturnType = undefined; - s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); + s.unionSignatures = ts.map(signatureLists, function (signatures) { + return signatures[i]; + }); } return result; } @@ -10357,7 +15091,9 @@ var ts; return undefined; } if (!props) { - props = [prop]; + props = [ + prop + ]; } else { props.push(prop); @@ -10457,8 +15193,7 @@ var ts; var links = getNodeLinks(declaration); if (!links.resolvedSignature) { var classType = declaration.kind === 133 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; + var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; var minArgumentCount = -1; @@ -10589,8 +15324,12 @@ var ts; var type = createObjectType(32768 | 65536); type.members = emptySymbols; type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; + type.callSignatures = !isConstructor ? [ + signature + ] : emptyArray; + type.constructSignatures = isConstructor ? [ + signature + ] : emptyArray; signature.isolatedSignatureType = type; } return signature.isolatedSignatureType; @@ -10617,9 +15356,7 @@ var ts; } function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType - : undefined; + return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { if (!type.constraint) { @@ -10673,7 +15410,9 @@ var ts; return links.isIllegalTypeReferenceInConstraint; } var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { + while (!ts.forEach(typeParameterSymbol.declarations, function (d) { + return d.parent === currentNode.parent; + })) { currentNode = currentNode.parent; } links.isIllegalTypeReferenceInConstraint = currentNode.kind === 127; @@ -10687,7 +15426,9 @@ var ts; if (links.isIllegalTypeReferenceInConstraint === undefined) { var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); if (symbol && (symbol.flags & 262144)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); + links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { + return d.parent == typeParameter.parent; + }); } } if (links.isIllegalTypeReferenceInConstraint) { @@ -10786,7 +15527,9 @@ var ts; } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; + return arrayType !== emptyObjectType ? createTypeReference(arrayType, [ + elementType + ]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); @@ -10972,15 +15715,21 @@ var ts; return items; } function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; + return function (t) { + return t === source ? target : t; + }; } function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; + return function (t) { + return t === source1 ? target1 : t === source2 ? target2 : t; + }; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: return createUnaryTypeMapper(sources[0], targets[0]); - case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: + return createUnaryTypeMapper(sources[0], targets[0]); + case 2: + return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -10991,15 +15740,21 @@ var ts; }; } function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; + return function (t) { + return t === source ? anyType : t; + }; } function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; + return function (t) { + return t === source1 || t === source2 ? anyType : t; + }; } function createTypeEraser(sources) { switch (sources.length) { - case 1: return createUnaryTypeEraser(sources[0]); - case 2: return createBinaryTypeEraser(sources[0], sources[1]); + case 1: + return createUnaryTypeEraser(sources[0]); + case 2: + return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11023,7 +15778,9 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { + return mapper2(mapper1(t)); + }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -11083,8 +15840,7 @@ var ts; return mapper(type); } if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? - instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11109,12 +15865,10 @@ var ts; case 151: return ts.forEach(node.elements, isContextSensitive); case 168: - return isContextSensitive(node.whenTrue) || - isContextSensitive(node.whenFalse); + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); case 167: - return node.operatorToken.kind === 49 && - (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 217: + return node.operatorToken.kind === 49 && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 218: return isContextSensitive(node.initializer); case 132: case 131: @@ -11125,7 +15879,9 @@ var ts; return false; } function isContextSensitiveFunctionLikeDeclaration(node) { - return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); + return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { + return p.type; + }); } function getTypeWithoutConstructors(type) { if (type.flags & 48128) { @@ -11264,8 +16020,7 @@ var ts; } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && - (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { + if (sourceOrApparentType.flags & 48128 && target.flags & 48128 && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { errorInfo = saveErrorInfo; return result; } @@ -11722,9 +16477,7 @@ var ts; if (source === target) { return -1; } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { + if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { return 0; } var result = -1; @@ -11767,7 +16520,9 @@ var ts; return true; } function getCommonSupertype(types) { - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); + return ts.forEach(types, function (t) { + return isSupertypeOfEach(t, types) ? t : undefined; + }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { var bestSupertype; @@ -11804,6 +16559,9 @@ var ts; function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + function isTupleType(type) { + return (type.flags & 8192) && !!type.elementTypes; + } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); var members = {}; @@ -11883,9 +16641,7 @@ var ts; var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; case 128: - var diagnostic = declaration.dotDotDotToken ? - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; + var diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; case 195: case 132: @@ -11941,7 +16697,10 @@ var ts; function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ primary: undefined, secondary: undefined }); + inferences.push({ + primary: undefined, + secondary: undefined + }); } return { typeParameters: typeParameters, @@ -11986,9 +16745,7 @@ var ts; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); if (!ts.contains(candidates, source)) candidates.push(source); break; @@ -12028,8 +16785,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & 48128 && (target.flags & (4096 | 8192) || - (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { + else if (source.flags & 48128 && (target.flags & (4096 | 8192) || (target.flags & 32768) && target.symbol && target.symbol.flags & (8192 | 2048))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12136,16 +16892,23 @@ var ts; } ts.Debug.fail("should not get here"); } - function removeTypesFromUnionType(type, typeKind, isOfTypeKind) { + function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { if (type.flags & 16384) { var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (narrowedType !== emptyObjectType) { + if (ts.forEach(types, function (t) { + return !!(t.flags & typeKind) === isOfTypeKind; + })) { + var narrowedType = getUnionType(ts.filter(types, function (t) { + return !(t.flags & typeKind) === isOfTypeKind; + })); + if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; } } } + else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + return getUnionType(emptyArray); + } return type; } function hasInitializer(node) { @@ -12217,12 +16980,12 @@ var ts; case 186: case 187: case 188: - case 213: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12231,12 +16994,13 @@ var ts; function resolveLocation(node) { var containerNodes = []; for (var parent = node.parent; parent; parent = parent.parent) { - if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(parent)) { + if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && isContextSensitive(parent)) { containerNodes.unshift(parent); } } - ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); + ts.forEach(containerNodes, function (node) { + getTypeOfNode(node); + }); } function getSymbolAtLocation(node) { resolveLocation(node); @@ -12278,7 +17042,7 @@ var ts; } } break; - case 220: + case 221: case 200: case 195: case 132: @@ -12312,16 +17076,16 @@ var ts; } if (assumeTrue) { if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true); + return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); } if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } - return removeTypesFromUnionType(type, typeInfo.flags, false); + return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true); + return removeTypesFromUnionType(type, typeInfo.flags, true, false); } return type; } @@ -12365,7 +17129,9 @@ var ts; return targetType; } if (type.flags & 16384) { - return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); + return getUnionType(ts.filter(type.types, function (t) { + return isTypeSubtypeOf(t, targetType); + })); } return type; } @@ -12421,9 +17187,7 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 216) { + if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -12530,21 +17294,10 @@ var ts; } if (container && container.parent && container.parent.kind === 196) { if (container.flags & 128) { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135; } else { - canUseSuperExpression = - container.kind === 132 || - container.kind === 131 || - container.kind === 134 || - container.kind === 135 || - container.kind === 130 || - container.kind === 129 || - container.kind === 133; + canUseSuperExpression = container.kind === 132 || container.kind === 131 || container.kind === 134 || container.kind === 135 || container.kind === 130 || container.kind === 129 || container.kind === 133; } } } @@ -12591,8 +17344,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } - if (indexOfParameter === (func.parameters.length - 1) && - funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { + if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); } } @@ -12677,7 +17429,10 @@ var ts; mappedType = t; } else if (!mappedTypes) { - mappedTypes = [mappedType, t]; + mappedTypes = [ + mappedType, + t + ]; } else { mappedTypes.push(t); @@ -12693,13 +17448,17 @@ var ts; }); } function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); + return applyToContextualType(type, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } function contextualTypeHasIndexSignature(type, kind) { - return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); + return !!(type.flags & 16384 ? ts.forEach(type.types, function (t) { + return getIndexTypeOfObjectOrUnionType(t, kind); + }) : getIndexTypeOfObjectOrUnionType(type, kind)); } function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); @@ -12719,8 +17478,7 @@ var ts; return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || getIndexTypeOfContextualType(type, 0); } return undefined; } @@ -12729,9 +17487,7 @@ var ts; var type = getContextualType(arrayLiteral); if (type) { var index = ts.indexOf(arrayLiteral.elements, node); - return getTypeOfPropertyOfContextualType(type, "" + index) - || getIndexTypeOfContextualType(type, 1) - || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); + return getTypeOfPropertyOfContextualType(type, "" + index) || getIndexTypeOfContextualType(type, 1) || (languageVersion >= 2 ? checkIteratedType(type, undefined) : undefined); } return undefined; } @@ -12764,7 +17520,7 @@ var ts; return getTypeFromTypeNode(parent.type); case 167: return getContextualTypeForBinaryOperand(node); - case 217: + case 218: return getContextualTypeForObjectLiteralElement(parent); case 151: return getContextualTypeForElementExpression(node); @@ -12795,9 +17551,7 @@ var ts; } function getContextualSignature(node) { ts.Debug.assert(node.kind !== 132 || ts.isObjectLiteralMethod(node)); - var type = ts.isObjectLiteralMethod(node) - ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); + var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } @@ -12807,14 +17561,15 @@ var ts; var signatureList; var types = type.types; for (var i = 0; i < types.length; i++) { - if (signatureList && - getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { return undefined; } var signature = getNonGenericSignature(types[i]); if (signature) { if (!signatureList) { - signatureList = [signature]; + signatureList = [ + signature + ]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -12840,7 +17595,7 @@ var ts; if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { return true; } - if (parent.kind === 217) { + if (parent.kind === 218) { return isAssignmentTarget(parent.parent); } if (parent.kind === 151) { @@ -12912,20 +17667,16 @@ var ts; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = memberDecl.symbol; - if (memberDecl.kind === 217 || - memberDecl.kind === 218 || - ts.isObjectLiteralMethod(memberDecl)) { - if (memberDecl.kind === 217) { + if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218) { var type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { var type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 218); - var type = memberDecl.name.kind === 126 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 219); + var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -13041,9 +17792,7 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 153 - ? node.expression - : node.left; + var left = node.kind === 153 ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); @@ -13080,8 +17829,7 @@ var ts; return unknownType; } var isConstEnum = isConstEnumObjectType(objectType); - if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + if (isConstEnum && (!node.argumentExpression || node.argumentExpression.kind !== 8)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } @@ -13248,8 +17996,7 @@ var ts; callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } - var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } @@ -13266,8 +18013,7 @@ var ts; function getSingleCallSignature(type) { if (type.flags & 48128) { var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { + if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; } } @@ -13337,9 +18083,7 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : - arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + var argType = i === 0 && node.kind === 157 ? globalTemplateStringsArrayType : arg.kind === 8 && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -13351,7 +18095,9 @@ var ts; var args; if (node.kind === 157) { var template = node.template; - args = [template]; + args = [ + template + ]; if (template.kind === 169) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); @@ -13603,10 +18349,7 @@ var ts; } if (node.kind === 156) { var declaration = signature.declaration; - if (declaration && - declaration.kind !== 133 && - declaration.kind !== 137 && - declaration.kind !== 141) { + if (declaration && declaration.kind !== 133 && declaration.kind !== 137 && declaration.kind !== 141) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13631,13 +18374,9 @@ var ts; } function getTypeAtPosition(signature, pos) { if (pos >= 0) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; + return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } - return signature.hasRestParameter ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + return signature.hasRestParameter ? getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : anyArrayType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -13937,12 +18676,9 @@ var ts; var properties = node.properties; for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var name = p.name; - var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + var type = sourceType.flags & 1 ? sourceType : getTypeOfPropertyOfType(sourceType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { checkDestructuringAssignment(p.initializer || name, type); } @@ -13967,14 +18703,17 @@ var ts; if (e.kind !== 172) { if (e.kind !== 171) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 ? sourceType : isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : getIndexTypeOfType(sourceType, 1); if (type) { checkDestructuringAssignment(e, type, contextualMapper); } else { - error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + if (isTupleType(sourceType)) { + error(e, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), sourceType.elementTypes.length, elements.length); + } + else { + error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); + } } } else { @@ -14045,9 +18784,7 @@ var ts; if (rightType.flags & (32 | 64)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && - (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { + if ((leftType.flags & 8) && (rightType.flags & 8) && (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operatorToken.kind), ts.tokenToString(suggestedOperator)); } else { @@ -14109,7 +18846,10 @@ var ts; case 48: return rightType; case 49: - return getUnionType([leftType, rightType]); + return getUnionType([ + leftType, + rightType + ]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -14117,9 +18857,7 @@ var ts; return rightType; } function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : - undefined; + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : someConstituentTypeHasKind(rightType, 1048576) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); return false; @@ -14165,7 +18903,10 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, contextualMapper); var type2 = checkExpression(node.whenFalse, contextualMapper); - return getUnionType([type1, type2]); + return getUnionType([ + type1, + type2 + ]); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -14229,9 +18970,7 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 153 && node.parent.expression === node) || - (node.parent.kind === 154 && node.parent.expression === node) || - ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 153 && node.parent.expression === node) || (node.parent.kind === 154 && node.parent.expression === node) || ((node.kind === 64 || node.kind === 125) && isInRightSideOfImportOrExportAssignment(node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); } @@ -14341,9 +19080,7 @@ var ts; if (node.kind === 138) { checkGrammarIndexSignature(node); } - else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || - node.kind === 136 || node.kind === 133 || - node.kind === 137) { + else if (node.kind === 140 || node.kind === 195 || node.kind === 141 || node.kind === 136 || node.kind === 133 || node.kind === 137) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -14436,8 +19173,10 @@ var ts; case 160: case 195: case 161: - case 152: return false; - default: return ts.forEachChild(n, containsSuperCall); + case 152: + return false; + default: + return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { @@ -14449,14 +19188,13 @@ var ts; } } function isInstancePropertyWithInitializer(n) { - return n.kind === 130 && - !(n.flags & 128) && - !!n.initializer; + return n.kind === 130 && !(n.flags & 128) && !!n.initializer; } if (ts.getClassBaseTypeNode(node.parent)) { if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { + return p.flags & (16 | 32 | 64); + }); if (superCallShouldBeFirst) { var statements = node.body.statements; if (!statements.length || statements[0].kind !== 177 || !isSuperCallExpression(statements[0].expression)) { @@ -14778,16 +19516,16 @@ var ts; case 197: return 2097152; case 200: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; + return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 ? 4194304 | 1048576 : 4194304; case 196: case 199: return 2097152 | 1048576; - case 202: + case 203: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); + ts.forEach(target.declarations, function (d) { + result |= getDeclarationSpaces(d); + }); return result; default: return 1048576; @@ -14796,10 +19534,7 @@ var ts; } function checkFunctionDeclaration(node) { if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || - checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionName(node.name) || - checkGrammarForGenerator(node); + checkFunctionLikeDeclaration(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -14854,12 +19589,7 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 130 || - node.kind === 129 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135) { + if (node.kind === 130 || node.kind === 129 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135) { return false; } if (ts.isInAmbientContext(node)) { @@ -14918,7 +19648,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 220 && ts.isExternalModule(parent)) { + if (parent.kind === 221 && ts.isExternalModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -14927,17 +19657,11 @@ var ts; var symbol = getSymbolOfNode(node); if (symbol.flags & 1) { var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2) { + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288) { var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 194); - var container = varDeclList.parent.kind === 175 && - varDeclList.parent.parent; - var namesShareScope = container && - (container.kind === 174 && ts.isFunctionLike(container.parent) || - (container.kind === 201 && container.kind === 200) || - container.kind === 220); + var container = varDeclList.parent.kind === 175 && varDeclList.parent.parent; + var namesShareScope = container && (container.kind === 174 && ts.isFunctionLike(container.parent) || (container.kind === 201 && container.kind === 200) || container.kind === 221); 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); @@ -15096,18 +19820,13 @@ var ts; checkSourceElement(node.statement); } function checkForOfStatement(node) { - if (languageVersion < 2) { - grammarErrorOnFirstToken(node, ts.Diagnostics.for_of_statements_are_only_available_when_targeting_ECMAScript_6_or_higher); - return; - } checkGrammarForInOrForOfStatement(node); if (node.initializer.kind === 194) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; - var rightType = checkExpression(node.expression); - var iteratedType = checkIteratedType(rightType, node.expression); + var iteratedType = checkRightHandSideOfForOf(node.expression); if (varExpr.kind === 151 || varExpr.kind === 152) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } @@ -15156,20 +19875,17 @@ var ts; checkVariableDeclaration(decl); } } - function getTypeForVariableDeclarationInForOfStatement(forOfStatement) { - if (languageVersion < 2) { - return anyType; - } - var expressionType = getTypeOfExpression(forOfStatement.expression); - return checkIteratedType(expressionType, forOfStatement.expression) || anyType; + function checkRightHandSideOfForOf(rhsExpression) { + var expressionType = getTypeOfExpression(rhsExpression); + return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, rhsExpression); } function checkIteratedType(iterable, expressionForError) { ts.Debug.assert(languageVersion >= 2); var iteratedType = getIteratedType(iterable, expressionForError); if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; + var completeIterableType = globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [ + iteratedType + ]) : emptyObjectType; checkTypeAssignableTo(iterable, completeIterableType, expressionForError); } return iteratedType; @@ -15217,6 +19933,39 @@ var ts; return iteratorNextValue; } } + function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + ts.Debug.assert(languageVersion < 2); + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + var hasStringConstituent = arrayOrStringType !== arrayType; + var reportedError = false; + if (hasStringConstituent) { + if (languageVersion < 1) { + error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + if (arrayType === emptyObjectType) { + return stringType; + } + } + if (!isArrayLikeType(arrayType)) { + if (!reportedError) { + var diagnostic = hasStringConstituent ? ts.Diagnostics.Type_0_is_not_an_array_type : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; + error(expressionForError, diagnostic, typeToString(arrayType)); + } + return hasStringConstituent ? stringType : unknownType; + } + var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + if (hasStringConstituent) { + if (arrayElementType.flags & 258) { + return stringType; + } + return getUnionType([ + arrayElementType, + stringType + ]); + } + return arrayElementType; + } function checkBreakOrContinueStatement(node) { checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); } @@ -15265,8 +20014,8 @@ var ts; var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (clause.kind === 214 && !hasDuplicateDefaultClause) { + ts.forEach(node.caseBlock.clauses, function (clause) { + if (clause.kind === 215 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -15278,7 +20027,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 213) { + if (produceDiagnostics && clause.kind === 214) { var caseClause = clause; var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { @@ -15375,7 +20124,9 @@ var ts; if (stringIndexType && numberIndexType) { errorNode = declaredNumberIndexer || declaredStringIndexer; if (!errorNode && (type.flags & 2048)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); + var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { + return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); + }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -15397,13 +20148,13 @@ var ts; errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { + return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); + }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 - ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 - : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; + var errorMessage = indexKind === 0 ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } @@ -15567,7 +20318,12 @@ var ts; return true; } var seen = {}; - ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { + prop: p, + containingType: type + }; + }); var ok = true; for (var i = 0, len = type.baseTypes.length; i < len; ++i) { var base = type.baseTypes[i]; @@ -15575,7 +20331,10 @@ var ts; for (var j = 0, proplen = properties.length; j < proplen; ++j) { var prop = properties[j]; if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; + seen[prop.name] = { + prop: prop, + containingType: base + }; } else { var existing = seen[prop.name]; @@ -15678,9 +20437,12 @@ var ts; return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return enumIsConst ? ~value : undefined; + case 33: + return value; + case 34: + return -value; + case 47: + return enumIsConst ? ~value : undefined; } return undefined; case 167: @@ -15696,17 +20458,28 @@ var ts; return undefined; } switch (e.operatorToken.kind) { - case 44: return left | right; - case 43: return left & right; - case 41: return left >> right; - case 42: return left >>> right; - case 40: return left << right; - case 45: return left ^ right; - case 35: return left * right; - case 36: return left / right; - case 33: return left + right; - case 34: return left - right; - case 37: return left % right; + case 44: + return left | right; + case 43: + return left & right; + case 41: + return left >> right; + case 42: + return left >>> right; + case 40: + return left << right; + case 45: + return left ^ right; + case 35: + return left * right; + case 36: + return left / right; + case 33: + return left + right; + case 34: + return left - right; + case 37: + return left % right; } return undefined; case 7: @@ -15729,8 +20502,7 @@ var ts; } else { if (e.kind === 154) { - if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + if (e.argumentExpression === undefined || e.argumentExpression.kind !== 8) { return undefined; } var enumType = getTypeOfNode(e.expression); @@ -15826,10 +20598,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 - && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { + if (symbol.flags & 512 && symbol.declarations.length > 1 && !ts.isInAmbientContext(node) && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15864,10 +20633,8 @@ var ts; return false; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 220 && !inAmbientExternalModule) { - error(moduleName, node.kind === 209 ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : - ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + if (node.parent.kind !== 221 && !inAmbientExternalModule) { + error(moduleName, node.kind === 210 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { @@ -15880,13 +20647,9 @@ var ts; var symbol = getSymbolOfNode(node); var target = resolveAlias(symbol); if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | - (symbol.flags & 793056 ? 793056 : 0) | - (symbol.flags & 1536 ? 1536 : 0); + var excludedMeanings = (symbol.flags & 107455 ? 107455 : 0) | (symbol.flags & 793056 ? 793056 : 0) | (symbol.flags & 1536 ? 1536 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 211 ? - ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : - ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + var message = node.kind === 212 ? 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)); } } @@ -15907,7 +20670,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { checkImportBinding(importClause.namedBindings); } else { @@ -15957,7 +20720,7 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 220 ? node.parent : node.parent.parent; + var container = node.parent.kind === 221 ? node.parent : node.parent.parent; if (container.kind === 200 && container.name.kind === 64) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; @@ -15974,7 +20737,7 @@ var ts; checkExternalModuleExports(container); } function getModuleStatements(node) { - if (node.kind === 220) { + if (node.kind === 221) { return node.statements; } if (node.kind === 200 && node.body.kind === 201) { @@ -15988,7 +20751,7 @@ var ts; var statements = getModuleStatements(declarations[i]); for (var j = 0; j < statements.length; j++) { var node = statements[j]; - if (node.kind === 209) { + if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; @@ -16001,7 +20764,7 @@ var ts; } } } - else if (node.kind !== 208 && node.flags & 1 && !(node.flags & 256)) { + else if (node.kind !== 209 && node.flags & 1 && !(node.flags & 256)) { return true; } } @@ -16111,13 +20874,13 @@ var ts; return checkEnumDeclaration(node); case 200: return checkModuleDeclaration(node); - case 203: + case 204: return checkImportDeclaration(node); - case 202: + case 203: return checkImportEqualsDeclaration(node); - case 209: + case 210: return checkExportDeclaration(node); - case 208: + case 209: return checkExportAssignment(node); case 176: checkGrammarStatementInAmbientContext(node); @@ -16158,7 +20921,7 @@ var ts; case 150: case 151: case 152: - case 217: + case 218: case 153: case 154: case 155: @@ -16190,19 +20953,20 @@ var ts; case 185: case 186: case 188: - case 213: + case 202: case 214: + case 215: case 189: case 190: case 191: - case 216: + case 217: case 193: case 194: case 196: case 199: - case 219: - case 208: case 220: + case 209: + case 221: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -16290,7 +21054,7 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 220: + case 221: if (!ts.isExternalModule(location)) break; case 200: @@ -16318,9 +21082,7 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 64 && - isTypeDeclaration(name.parent) && - name.parent.name === name; + return name.kind == 64 && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { @@ -16402,10 +21164,10 @@ var ts; while (nodeOnRightSide.parent.kind === 125) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 202) { + if (nodeOnRightSide.parent.kind === 203) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 209) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -16414,14 +21176,13 @@ var ts; return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 125 && node.parent.right === node) || - (node.parent.kind === 153 && node.parent.name === node); + return (node.parent.kind === 125 && node.parent.right === node) || (node.parent.kind === 153 && node.parent.name === node); } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 208) { + if (entityName.parent.kind === 209) { return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); } if (entityName.kind !== 153) { @@ -16470,9 +21231,7 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 208 - ? getSymbolOfEntityNameOrPropertyAccessExpression(node) - : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -16491,10 +21250,7 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && - ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 203 || node.parent.kind === 209) && - node.parent.moduleSpecifier === node)) { + if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } case 7: @@ -16512,7 +21268,7 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 218) { + if (location && location.kind === 219) { return resolveEntityName(location.name, 107455); } return undefined; @@ -16580,13 +21336,17 @@ var ts; else if (symbol.flags & 67108864) { var target = getSymbolLinks(symbol).target; if (target) { - return [target]; + return [ + target + ]; } } - return [symbol]; + return [ + symbol + ]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 220; + return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 221; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -16627,16 +21387,16 @@ var ts; case 199: generateNameForModuleOrEnum(node); break; - case 203: + case 204: generateNameForImportDeclaration(node); break; - case 209: + case 210: generateNameForExportDeclaration(node); break; - case 208: + case 209: generateNameForExportAssignment(node); break; - case 220: + case 221: case 201: ts.forEach(node.statements, generateNames); break; @@ -16665,12 +21425,11 @@ var ts; } function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; + var baseName = expr.kind === 8 ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; assignGeneratedName(node, makeUniqueName(baseName)); } function generateNameForImportDeclaration(node) { - if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 206) { + if (node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 207) { generateNameForImportOrExportDeclaration(node); } } @@ -16700,7 +21459,7 @@ var ts; } function getAliasNameSubstitution(symbol) { var declaration = getDeclarationOfAliasSymbol(symbol); - if (declaration && declaration.kind === 207) { + if (declaration && declaration.kind === 208) { var moduleName = getGeneratedNameForNode(declaration.parent.parent.parent); var propertyName = declaration.propertyName || declaration.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -16739,7 +21498,7 @@ var ts; return symbol && symbol !== unknownSymbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol); } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 220 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 221 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } return isAliasResolvedToValue(getSymbolOfNode(node)); @@ -16764,8 +21523,7 @@ var ts; if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || - (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); + return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; } @@ -16777,14 +21535,14 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 219) { + if (node.kind === 220) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & 8)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 219) { + if (declaration.kind === 220) { return getEnumMemberValue(declaration); } } @@ -16792,9 +21550,7 @@ var ts; } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) - ? getTypeOfSymbol(symbol) - : unknownType; + var type = symbol && !(symbol.flags & (2048 | 131072)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -16802,29 +21558,20 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } function isUnknownIdentifier(location, name) { - return !resolveName(location, name, 107455, undefined, undefined) && - !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); + ts.Debug.assert(!ts.nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location"); + return !resolveName(location, name, 107455, undefined, undefined) && !ts.hasProperty(getGeneratedNamesForSourceFile(getSourceFile(location)), name); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - if (n.parent.kind === 153 && - n.parent.name === n) { + if (n.parent.kind === 153 && n.parent.name === n) { return undefined; } - if (n.parent.kind === 150 && - n.parent.propertyName === n) { + if (n.parent.kind === 150 && n.parent.propertyName === n) { return undefined; } - var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || - n.parent.kind === 150 - ? getSymbolOfNode(n.parent) - : undefined; - var symbol = declarationSymbol || - getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 2 | 8388608, undefined, undefined); - var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 216; + var declarationSymbol = (n.parent.kind === 193 && n.parent.name === n) || n.parent.kind === 150 ? getSymbolOfNode(n.parent) : undefined; + var symbol = declarationSymbol || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, 2 | 8388608, undefined, undefined); + var isLetOrConst = symbol && (symbol.flags & 2) && symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -16901,10 +21648,10 @@ var ts; case 175: case 195: case 198: + case 204: case 203: - case 202: + case 210: case 209: - case 208: case 128: break; default: @@ -16939,7 +21686,7 @@ var ts; else if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); @@ -16948,7 +21695,7 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 201 || node.parent.kind === 220) { + else if (node.parent.kind === 201 || node.parent.kind === 221) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } else if (node.kind === 128) { @@ -17001,7 +21748,7 @@ var ts; return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 203 || node.kind === 202) && flags & 2) { + else if ((node.kind === 204 || node.kind === 203) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } else if (node.kind === 197 && flags & 2) { @@ -17114,8 +21861,7 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || - checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { @@ -17129,8 +21875,7 @@ var ts; } } function checkGrammarArguments(node, arguments) { - return checkGrammarForDisallowedTrailingComma(arguments) || - checkGrammarForOmittedArgument(node, arguments); + return checkGrammarForDisallowedTrailingComma(arguments) || checkGrammarForOmittedArgument(node, arguments); } function checkGrammarHeritageClause(node) { var types = node.types; @@ -17226,13 +21971,12 @@ var ts; for (var i = 0, n = node.properties.length; i < n; i++) { var prop = node.properties[i]; var name = prop.name; - if (prop.kind === 172 || - name.kind === 126) { + if (prop.kind === 172 || name.kind === 126) { checkGrammarComputedPropertyName(name); continue; } var currentKind; - if (prop.kind === 217 || prop.kind === 218) { + if (prop.kind === 218 || prop.kind === 219) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 7) { checkGrammarNumbericLiteral(name); @@ -17283,22 +22027,16 @@ var ts; var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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 === 182 - ? 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; + var diagnostic = forInOrOfStatement.kind === 182 ? 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); } } @@ -17352,9 +22090,7 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarFunctionLikeDeclaration(node) || checkGrammarForGenerator(node)) { return true; } if (node.parent.kind === 152) { @@ -17405,8 +22141,7 @@ var ts; switch (current.kind) { case 189: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 184 - && !isIterationStatement(current.statement, true); + var isMisplacedContinueLabel = node.kind === 184 && !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); } @@ -17427,15 +22162,11 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 185 - ? 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; + var message = node.kind === 185 ? 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 === 185 - ? 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; + var message = node.kind === 185 ? 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); } } @@ -17472,8 +22203,7 @@ var ts; } } var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); - return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || - checkGrammarEvalOrArgumentsInStrictMode(node, node.name); + return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { if (name.kind === 64) { @@ -17605,8 +22335,7 @@ var ts; } function checkGrammarProperty(node) { if (node.parent.kind === 196) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || - checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { + if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } @@ -17625,12 +22354,7 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || - node.kind === 203 || - node.kind === 202 || - node.kind === 209 || - node.kind === 208 || - (node.flags & 2)) { + if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (node.flags & 2)) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -17657,7 +22381,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 220) { + if (node.parent.kind === 174 || node.parent.kind === 201 || node.parent.kind === 221) { var links = getNodeLinks(node.parent); if (!links.hasReportedStatementInAmbientContext) { return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -17692,7 +22416,10 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var indentStrings = ["", " "]; + var indentStrings = [ + "", + " " + ]; function getIndentString(level) { if (indentStrings[level] === undefined) { indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; @@ -17767,21 +22494,34 @@ var ts; writeTextOfNode: writeTextOfNode, writeLiteral: writeLiteral, writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } + increaseIndent: function () { + return indent++; + }, + decreaseIndent: function () { + return indent--; + }, + getIndent: function () { + return indent; + }, + getTextPos: function () { + return output.length; + }, + getLine: function () { + return lineCount + 1; + }, + getColumn: function () { + return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; + }, + getText: function () { + return output; + } }; } function getLineOfLocalPosition(currentSourceFile, pos) { return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; } function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { writer.writeLine(); } } @@ -17810,9 +22550,7 @@ var ts; var lineCount = ts.getLineStarts(currentSourceFile).length; var firstCommentLineIndent; for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); + var nextLineStart = (currentLine + 1) === lineCount ? currentSourceFile.text.length + 1 : ts.getStartPositionOfLine(currentLine + 1, currentSourceFile); if (pos !== comment.pos) { if (firstCommentLineIndent === undefined) { firstCommentLineIndent = calculateIndent(ts.getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); @@ -17890,8 +22628,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 134 || member.kind === 135) - && (member.flags & 128) === (accessor.flags & 128)) { + if ((member.kind === 134 || member.kind === 135) && (member.flags & 128) === (accessor.flags & 128)) { var memberName = ts.getPropertyNameForPropertyNameNode(member.name); var accessorName = ts.getPropertyNameForPropertyNameNode(accessor.name); if (memberName === accessorName) { @@ -17947,7 +22684,8 @@ var ts; var enclosingDeclaration; var currentSourceFile; var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; + var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { + } : writeJsDocComments; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; var aliasDeclarationEmitInfo = []; var referencePathsOutput = ""; @@ -17956,9 +22694,7 @@ var ts; var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || - shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { + if (referencedFile && ((referencedFile.flags & 2048) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); if (!isExternalModuleOrDeclarationFile(referencedFile)) { addedGlobalFileReference = true; @@ -17975,8 +22711,7 @@ var ts; if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); emittedReferencedFiles.push(referencedFile); } @@ -18030,7 +22765,9 @@ var ts; function writeAsychronousImportEqualsDeclarations(importEqualsDeclarations) { var oldWriter = writer; ts.forEach(importEqualsDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); + var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { + return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; + }); if (aliasEmitInfo) { createAndSetNewTextWriterWithSymbolWriter(); for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { @@ -18148,7 +22885,7 @@ var ts; ts.Debug.fail("Unknown type annotation: " + type.kind); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 202 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 203 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { @@ -18355,15 +23092,8 @@ var ts; writeTextOfNode(currentSourceFile, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - (node.parent.parent && node.parent.parent.kind === 143)) { - ts.Debug.assert(node.parent.kind === 132 || - node.parent.kind === 131 || - node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.kind === 136 || - node.parent.kind === 137); + if (node.parent.kind === 140 || node.parent.kind === 141 || (node.parent.parent && node.parent.parent.kind === 143)) { + ts.Debug.assert(node.parent.kind === 132 || node.parent.kind === 131 || node.parent.kind === 140 || node.parent.kind === 141 || node.parent.kind === 136 || node.parent.kind === 137); emitType(node.constraint); } else { @@ -18426,9 +23156,7 @@ var ts; function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.parent.parent.kind === 196) { - diagnosticMessage = isImplementsList ? - ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; @@ -18461,7 +23189,9 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); + emitHeritageClause([ + baseTypeNode + ], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -18521,31 +23251,17 @@ var ts; function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (node.kind === 193) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 === 130 || node.kind === 129) { if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; } } return diagnosticMessage !== undefined ? { @@ -18562,7 +23278,9 @@ var ts; } } function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); + var hasDeclarationWithEmit = ts.forEach(node.declarationList.declarations, function (varDeclaration) { + return resolver.isDeclarationVisible(varDeclaration); + }); if (hasDeclarationWithEmit) { emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -18607,25 +23325,17 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 134 - ? accessor.type - : accessor.parameters.length > 0 - ? accessor.parameters[0].type - : undefined; + return accessor.kind === 134 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; if (accessorWithTypeAnnotation.kind === 135) { if (accessorWithTypeAnnotation.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { diagnosticMessage: diagnosticMessage, @@ -18635,18 +23345,10 @@ var ts; } else { if (accessorWithTypeAnnotation.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { diagnosticMessage: diagnosticMessage, @@ -18660,8 +23362,7 @@ var ts; if (ts.hasDynamicName(node)) { return; } - if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 195 || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); if (node.kind === 195) { emitModuleElementDeclarationFlags(node); @@ -18728,48 +23429,28 @@ var ts; var diagnosticMessage; switch (node.kind) { case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 138: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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 132: case 131: if (node.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: ts.Debug.fail("This is unknown kind for signature: " + node.kind); @@ -18796,9 +23477,7 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 140 || - node.parent.kind === 141 || - node.parent.parent.kind === 143) { + if (node.parent.kind === 140 || node.parent.kind === 141 || node.parent.parent.kind === 143) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!(node.parent.flags & 32)) { @@ -18808,50 +23487,28 @@ var ts; var diagnosticMessage; switch (node.parent.kind) { case 133: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; case 137: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 136: - diagnosticMessage = symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.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; break; case 132: case 131: if (node.parent.flags & 128) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 196) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - 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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; } break; case 195: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.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; + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.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; break; default: ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); @@ -18888,26 +23545,22 @@ var ts; return emitClassDeclaration(node); case 198: return emitTypeAliasDeclaration(node); - case 219: + case 220: return emitEnumMemberDeclaration(node); case 199: return emitEnumDeclaration(node); case 200: return emitModuleDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 208: + case 209: return emitExportAssignment(node); - case 220: + case 221: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") - : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var declFileName = referencedFile.flags & 2048 ? referencedFile.fileName : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false); referencePathsOutput += "/// " + newLine; } @@ -18958,6 +23611,7 @@ var ts; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var preserveNewLines = compilerOptions.preserveNewLines || false; var currentSourceFile; var lastFrame; var currentScopeNames; @@ -18970,41 +23624,57 @@ var ts; var exportSpecifiers; var exportDefault; var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { } : emitLeadingCommentsOfLocalPosition; + var emitLeadingComments = compilerOptions.removeComments ? function (node) { + } : emitLeadingDeclarationComments; + var emitTrailingComments = compilerOptions.removeComments ? function (node) { + } : emitTrailingDeclarationComments; + var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { + } : emitLeadingCommentsOfLocalPosition; var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { } : emitPinnedOrTripleSlashCommentsOfNode; + var emitDetachedComments = compilerOptions.removeComments ? function (node) { + } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; - var emit = emitNode; - var emitStart = function (node) { }; - var emitEnd = function (node) { }; + var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; + var emit = emitNodeWithoutSourceMap; + var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; + var emitStart = function (node) { + }; + var emitEnd = function (node) { + }; var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - var scopeEmitEnd = function () { }; + var scopeEmitStart = function (scopeDeclaration, scopeName) { + }; + var scopeEmitEnd = function () { + }; var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); } if (root) { - emit(root); + emitSourceFile(root); } else { ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); + emitSourceFile(sourceFile); } }); } writeLine(); writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); return; + function emitSourceFile(sourceFile) { + currentSourceFile = sourceFile; + emit(sourceFile); + } function enterNameScope() { var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { names: names, previous: lastFrame }; + lastFrame = { + names: names, + previous: lastFrame + }; return true; } return false; @@ -19024,8 +23694,13 @@ var ts; name = baseName; } else { - name = ts.generateUniqueName(baseName, function (n) { return isExistingName(location, n); }); + name = ts.generateUniqueName(baseName, function (n) { + return isExistingName(location, n); + }); } + return recordNameInCurrentScope(name); + } + function recordNameInCurrentScope(name) { if (!currentScopeNames) { currentScopeNames = {}; } @@ -19121,12 +23796,7 @@ var ts; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { encodeLastRecordedSourceMapSpan(); lastRecordedSourceMapSpan = { emittedLine: emittedLine, @@ -19189,20 +23859,10 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 195 || - node.kind === 160 || - node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 135 || - node.kind === 200 || - node.kind === 196 || - node.kind === 199) { + else if (node.kind === 195 || node.kind === 160 || node.kind === 132 || node.kind === 131 || node.kind === 134 || node.kind === 135 || node.kind === 200 || node.kind === 196 || node.kind === 199) { if (node.name) { var name = node.name; - scopeName = name.kind === 126 - ? ts.getTextOfNode(name) - : node.name.text; + scopeName = name.kind === 126 ? ts.getTextOfNode(name) : node.name.text; } recordScopeNameStart(scopeName); } @@ -19280,21 +23940,32 @@ var ts; else { sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); } - function emitNodeWithMap(node) { + function emitNodeWithSourceMap(node) { if (node) { - if (node.kind != 220) { + if (ts.nodeIsSynthesized(node)) { + return emitNodeWithoutSourceMap(node); + } + if (node.kind != 221) { recordEmitNodeStartSpan(node); - emitNode(node); + emitNodeWithoutSourceMap(node); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNode(node); + emitNodeWithoutSourceMap(node); } } } + function emitNodeWithSourceMapWithoutComments(node) { + if (node) { + recordEmitNodeStartSpan(node); + emitNodeWithoutSourceMapWithoutComments(node); + recordEmitNodeEndSpan(node); + } + } writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; + emit = emitNodeWithSourceMap; + emitWithoutComments = emitNodeWithSourceMapWithoutComments; emitStart = recordEmitNodeStartSpan; emitEnd = recordEmitNodeEndSpan; emitToken = writeTextWithSpanRecord; @@ -19314,6 +23985,7 @@ var ts; name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); tempCount++; } + recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); result.text = name; return result; @@ -19375,7 +24047,7 @@ var ts; function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { ts.Debug.assert(nodes.length > 0); increaseIndent(); - if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { + if (preserveNewLines && nodeStartPositionsAreOnSameLine(parent, nodes[0])) { if (spacesBetweenBraces) { write(" "); } @@ -19385,7 +24057,7 @@ var ts; } for (var i = 0, n = nodes.length; i < n; i++) { if (i) { - if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { + if (preserveNewLines && nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { write(", "); } else { @@ -19395,12 +24067,11 @@ var ts; } emit(nodes[i]); } - var closeTokenIsOnSameLineAsLastElement = nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes)); if (nodes.hasTrailingComma && allowTrailingComma) { write(","); } decreaseIndent(); - if (closeTokenIsOnSameLineAsLastElement) { + if (preserveNewLines && nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { if (spacesBetweenBraces) { write(" "); } @@ -19534,8 +24205,7 @@ var ts; if (node.template.kind === 169) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 167 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 167 && templateSpan.expression.operatorToken.kind === 23; emitParenthesizedIf(templateSpan.expression, needsParens); }); } @@ -19546,8 +24216,7 @@ var ts; ts.forEachChild(node, emit); return; } - var emitOuterParens = ts.isExpression(node.parent) - && templateNeedsParens(node, node.parent); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); if (emitOuterParens) { write("("); } @@ -19558,8 +24227,7 @@ var ts; } for (var i = 0; i < node.templateSpans.length; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 159 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + var needsParens = templateSpan.expression.kind !== 159 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; if (i > 0 || headEmitted) { write(" + "); } @@ -19640,9 +24308,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 195: @@ -19653,11 +24321,11 @@ var ts; case 197: case 199: case 200: - case 202: + case 203: return parent.name === node; case 185: case 184: - case 208: + case 209: return false; case 189: return node.parent.label === node; @@ -19845,9 +24513,9 @@ var ts; } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { switch (property.kind) { - case 217: - return property.initializer; case 218: + return property.initializer; + case 219: return createIdentifier(resolver.getExpressionNameSubstitution(property.name)); case 132: return createFunctionExpression(property.parameters, property.body); @@ -19901,6 +24569,11 @@ var ts; result.right = right; return result; } + function createExpressionStatement(expression) { + var result = ts.createSynthesizedNode(177); + result.expression = expression; + return result; + } function createMemberAccessForPropertyName(expression, memberName) { if (memberName.kind === 64) { return createPropertyAccessExpression(expression, memberName); @@ -19916,7 +24589,7 @@ var ts; } } function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(217); + var result = ts.createSynthesizedNode(218); result.name = name; result.initializer = initializer; return result; @@ -20011,29 +24684,31 @@ var ts; } return false; } - function indentIfOnDifferentLines(parent, node1, node2) { - var isSynthesized = ts.nodeIsSynthesized(parent); - var realNodesAreOnDifferentLines = !isSynthesized && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { + var realNodesAreOnDifferentLines = preserveNewLines && !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); writeLine(); return true; } - return false; + else { + if (valueToWriteWhenNotIndenting) { + write(valueToWriteWhenNotIndenting); + } + return false; + } } function emitPropertyAccess(node) { if (tryEmitConstantValue(node)) { return; } emit(node.expression); - var indented = indentIfOnDifferentLines(node, node.expression, node.dotToken); + var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); - indented = indented || indentIfOnDifferentLines(node, node.dotToken, node.name); + var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); emit(node.name); - if (indented) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } function emitQualifiedName(node) { emit(node.left); @@ -20050,7 +24725,9 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 171; }); + return ts.forEach(elements, function (e) { + return e.kind === 171; + }); } function skipParentheses(node) { while (node.kind === 159 || node.kind === 158) { @@ -20163,14 +24840,7 @@ var ts; while (operand.kind == 158) { operand = operand.expression; } - if (operand.kind !== 165 && - operand.kind !== 164 && - operand.kind !== 163 && - operand.kind !== 162 && - operand.kind !== 166 && - operand.kind !== 156 && - !(operand.kind === 155 && node.parent.kind === 156) && - !(operand.kind === 160 && node.parent.kind === 155)) { + if (operand.kind !== 165 && operand.kind !== 164 && operand.kind !== 163 && operand.kind !== 162 && operand.kind !== 166 && operand.kind !== 156 && !(operand.kind === 155 && node.parent.kind === 156) && !(operand.kind === 160 && node.parent.kind === 155)) { emit(operand); return; } @@ -20213,27 +24883,16 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 52 && - (node.left.kind === 152 || node.left.kind === 151)) { - emitDestructuring(node); + if (languageVersion < 2 && node.operatorToken.kind === 52 && (node.left.kind === 152 || node.left.kind === 151)) { + emitDestructuring(node, node.parent.kind === 177); } else { emit(node.left); - var indented1 = indentIfOnDifferentLines(node, node.left, node.operatorToken); - if (!indented1 && node.operatorToken.kind !== 23) { - write(" "); - } + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); - if (!indented1) { - var indented2 = indentIfOnDifferentLines(node, node.operatorToken, node.right); - } - if (!indented2) { - write(" "); - } + var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); - if (indented1 || indented2) { - decreaseIndent(); - } + decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); } } function synthesizedNodeStartsOnNewLine(node) { @@ -20241,34 +24900,22 @@ var ts; } function emitConditionalExpression(node) { emit(node.condition); - var indent1 = indentIfOnDifferentLines(node, node.condition, node.questionToken); - if (!indent1) { - write(" "); - } + var indentedBeforeQuestion = indentIfOnDifferentLines(node, node.condition, node.questionToken, " "); write("?"); - if (!indent1) { - var indent2 = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue); - } - if (!indent2) { - write(" "); - } + var indentedAfterQuestion = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue, " "); emit(node.whenTrue); - if (indent1 || indent2) { - decreaseIndent(); - } - var indent3 = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken); - if (!indent3) { - write(" "); - } + decreaseIndentIf(indentedBeforeQuestion, indentedAfterQuestion); + var indentedBeforeColon = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken, " "); write(":"); - if (!indent3) { - var indent4 = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse); - } - if (!indent4) { - write(" "); - } + var indentedAfterColon = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse, " "); emit(node.whenFalse); - if (indent3 || indent4) { + decreaseIndentIf(indentedBeforeColon, indentedAfterColon); + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { decreaseIndent(); } } @@ -20279,7 +24926,7 @@ var ts; } } function emitBlock(node) { - if (isSingleLineEmptyBlock(node)) { + if (preserveNewLines && isSingleLineEmptyBlock(node)) { emitToken(14, node.pos); write(" "); emitToken(15, node.statements.end); @@ -20401,6 +25048,9 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { + if (languageVersion < 2 && node.kind === 183) { + return emitDownLevelForOfStatement(node); + } var endPos = emitToken(81, node.pos); write(" "); endPos = emitToken(16, endPos); @@ -20426,6 +25076,86 @@ var ts; emitToken(17, node.expression.end); emitEmbeddedStatement(node.statement); } + function emitDownLevelForOfStatement(node) { + var endPos = emitToken(81, node.pos); + write(" "); + endPos = emitToken(16, endPos); + var rhsIsIdentifier = node.expression.kind === 64; + var counter = createTempVariable(node, true); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + emitStart(node.expression); + write("var "); + emitNodeWithoutSourceMap(counter); + write(" = 0"); + emitEnd(node.expression); + if (!rhsIsIdentifier) { + write(", "); + emitStart(node.expression); + emitNodeWithoutSourceMap(rhsReference); + write(" = "); + emitNodeWithoutSourceMap(node.expression); + emitEnd(node.expression); + } + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write(" < "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + emitEnd(node.initializer); + write("; "); + emitStart(node.initializer); + emitNodeWithoutSourceMap(counter); + write("++"); + emitEnd(node.initializer); + emitToken(17, node.expression.end); + write(" {"); + writeLine(); + increaseIndent(); + var rhsIterationValue = createElementAccessExpression(rhsReference, counter); + emitStart(node.initializer); + if (node.initializer.kind === 194) { + write("var "); + var variableDeclarationList = node.initializer; + if (variableDeclarationList.declarations.length > 0) { + var declaration = variableDeclarationList.declarations[0]; + if (ts.isBindingPattern(declaration.name)) { + emitDestructuring(declaration, false, rhsIterationValue); + } + else { + emitNodeWithoutSourceMap(declaration); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + emitNodeWithoutSourceMap(createTempVariable(node, false)); + write(" = "); + emitNodeWithoutSourceMap(rhsIterationValue); + } + } + else { + var assignmentExpression = createBinaryExpression(node.initializer, 52, rhsIterationValue, false); + if (node.initializer.kind === 151 || node.initializer.kind === 152) { + emitDestructuring(assignmentExpression, true, undefined, node); + } + else { + emitNodeWithoutSourceMap(assignmentExpression); + } + } + emitEnd(node.initializer); + write(";"); + if (node.statement.kind === 174) { + emitLines(node.statement.statements); + } + else { + writeLine(); + emit(node.statement); + } + writeLine(); + decreaseIndent(); + write("}"); + } function emitBreakOrContinueStatement(node) { emitToken(node.kind === 185 ? 65 : 70, node.pos); emitOptional(" ", node.label); @@ -20449,7 +25179,10 @@ var ts; emit(node.expression); endPos = emitToken(17, node.expression.end); write(" "); - emitToken(14, endPos); + emitCaseBlock(node.caseBlock, endPos); + } + function emitCaseBlock(node, startPos) { + emitToken(14, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); @@ -20457,19 +25190,16 @@ var ts; emitToken(15, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function nodeEndPositionsAreOnSameLine(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, node2.end); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, node2.end); } function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return getLineOfLocalPosition(currentSourceFile, node1.end) === - getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, node1.end) === getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 213) { + if (node.kind === 214) { write("case "); emit(node.expression); write(":"); @@ -20477,7 +25207,7 @@ var ts; else { write("default:"); } - if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { + if (preserveNewLines && node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); } @@ -20537,7 +25267,7 @@ var ts; emitContainingModuleName(node); write("."); } - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); emitEnd(node.name); } function createVoidZero() { @@ -20554,21 +25284,22 @@ var ts; emitStart(specifier.name); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); emitEnd(specifier.name); write(" = "); - emitNode(name); + emitNodeWithoutSourceMap(name); write(";"); }); } } - function emitDestructuring(root, value) { + function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } else { + ts.Debug.assert(!isAssignmentExpressionStatement); emitBindingElement(root, value); } function emitAssignment(name, value) { @@ -20587,7 +25318,7 @@ var ts; } function ensureIdentifier(expr) { if (expr.kind !== 64) { - var identifier = createTempVariable(root); + var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -20645,7 +25376,7 @@ var ts; } for (var i = 0; i < properties.length; i++) { var p = properties[i]; - if (p.kind === 217 || p.kind === 218) { + if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); } @@ -20690,7 +25421,7 @@ var ts; function emitAssignmentExpression(root) { var target = root.left; var value = root.right; - if (root.parent.kind === 177) { + if (isAssignmentExpressionStatement) { emitDestructuringAssignment(target, value); } else { @@ -20747,7 +25478,7 @@ var ts; function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { if (languageVersion < 2) { - emitDestructuring(node); + emitDestructuring(node, false); } else { emit(node.name); @@ -20755,15 +25486,12 @@ var ts; } } else { - var isLet = renameNonTopLevelLetAndConst(node.name); + renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; if (!initializer && languageVersion < 2) { - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && - (getCombinedFlagsForIdentifier(node.name) & 4096); - if (isUninitializedLet && - node.parent.parent.kind !== 182 && - node.parent.parent.kind !== 183) { + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && (getCombinedFlagsForIdentifier(node.name) & 4096); + if (isUninitializedLet && node.parent.parent.kind !== 182 && node.parent.parent.kind !== 183) { initializer = createVoidZero(); } } @@ -20779,29 +25507,6 @@ var ts; ts.forEach(name.elements, emitExportVariableAssignments); } } - function getEnclosingBlockScopeContainer(node) { - var current = node; - while (current) { - if (ts.isFunctionLike(current)) { - return current; - } - switch (current.kind) { - case 220: - case 91: - case 216: - case 200: - case 181: - case 182: - case 183: - return current; - case 174: - if (!ts.isFunctionLike(current.parent)) { - return current; - } - } - current = current.parent; - } - } function getCombinedFlagsForIdentifier(node) { if (!node.parent || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return 0; @@ -20809,10 +25514,7 @@ var ts; return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || - ts.nodeIsSynthesized(node) || - node.kind !== 64 || - (node.parent.kind !== 193 && node.parent.kind !== 150)) { + if (languageVersion >= 2 || ts.nodeIsSynthesized(node) || node.kind !== 64 || (node.parent.kind !== 193 && node.parent.kind !== 150)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); @@ -20820,13 +25522,11 @@ var ts; return; } var list = ts.getAncestor(node, 194); - if (list.parent.kind === 175 && list.parent.parent.kind === 220) { + if (list.parent.kind === 175 && list.parent.parent.kind === 221) { return; } - var blockScopeContainer = getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 220 - ? blockScopeContainer - : blockScopeContainer.parent; + var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); + var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; var generatedName = generateUniqueNameForLocation(parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { @@ -20873,7 +25573,7 @@ var ts; if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); - emitDestructuring(p, tempParameters[tempIndex]); + emitDestructuring(p, false, tempParameters[tempIndex]); write(";"); tempIndex++; } @@ -20881,14 +25581,14 @@ var ts; writeLine(); emitStart(p); write("if ("); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" === void 0)"); emitEnd(p); write(" { "); emitStart(p); - emitNode(p.name); + emitNodeWithoutSourceMap(p.name); write(" = "); - emitNode(p.initializer); + emitNodeWithoutSourceMap(p.initializer); emitEnd(p); write("; }"); } @@ -20904,7 +25604,7 @@ var ts; emitLeadingComments(restParam); emitStart(restParam); write("var "); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write(" = [];"); emitEnd(restParam); emitTrailingComments(restParam); @@ -20925,7 +25625,7 @@ var ts; increaseIndent(); writeLine(); emitStart(restParam); - emitNode(restParam.name); + emitNodeWithoutSourceMap(restParam.name); write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); emitEnd(restParam); decreaseIndent(); @@ -20943,7 +25643,7 @@ var ts; } function emitDeclarationName(node) { if (node.name) { - emitNode(node.name); + emitNodeWithoutSourceMap(node.name); } else { write(resolver.getGeneratedNameForNode(node)); @@ -21060,11 +25760,11 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); - if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { + if (preserveNewLines && !preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); write("return "); - emitNode(body, true); + emitWithoutComments(body); emitEnd(body); write(";"); emitTempDeclarations(false); @@ -21075,7 +25775,7 @@ var ts; writeLine(); emitLeadingComments(node.body); write("return "); - emit(node.body, true); + emitWithoutComments(node.body); write(";"); emitTrailingComments(node.body); emitTempDeclarations(true); @@ -21097,7 +25797,7 @@ var ts; emitFunctionBodyPreamble(node); decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { + if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { for (var i = 0, n = body.statements.length; i < n; i++) { write(" "); emit(body.statements[i]); @@ -21138,7 +25838,7 @@ var ts; emitStart(param); emitStart(param.name); write("this."); - emitNode(param.name); + emitNodeWithoutSourceMap(param.name); emitEnd(param.name); write(" = "); emit(param.name); @@ -21150,7 +25850,7 @@ var ts; function emitMemberAccessForPropertyName(memberName) { if (memberName.kind === 8 || memberName.kind === 7) { write("["); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); write("]"); } else if (memberName.kind === 126) { @@ -21158,7 +25858,7 @@ var ts; } else { write("."); - emitNode(memberName); + emitNodeWithoutSourceMap(memberName); } } function emitMemberAssignments(node, staticFlag) { @@ -21587,8 +26287,7 @@ var ts; emitImportDeclaration(node); return; } - if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { + if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); emitStart(node); if (!(node.flags & 1)) @@ -21617,11 +26316,11 @@ var ts; emitStart(specifier); emitContainingModuleName(specifier); write("."); - emitNode(specifier.name); + emitNodeWithoutSourceMap(specifier.name); write(" = "); write(generatedName); write("."); - emitNode(specifier.propertyName || specifier.name); + emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); write(";"); emitEnd(specifier); }); @@ -21639,15 +26338,15 @@ var ts; } } function createExternalImportInfo(node) { - if (node.kind === 202) { - if (node.moduleReference.kind === 212) { + if (node.kind === 203) { + if (node.moduleReference.kind === 213) { return { rootNode: node, declarationNode: node }; } } - else if (node.kind === 203) { + else if (node.kind === 204) { var importClause = node.importClause; if (importClause) { if (importClause.name) { @@ -21656,7 +26355,7 @@ var ts; declarationNode: importClause }; } - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { return { rootNode: node, declarationNode: importClause.namedBindings @@ -21672,7 +26371,7 @@ var ts; rootNode: node }; } - else if (node.kind === 209) { + else if (node.kind === 210) { if (node.moduleSpecifier) { return { rootNode: node @@ -21685,7 +26384,7 @@ var ts; exportSpecifiers = {}; exportDefault = undefined; ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 209 && !node.moduleSpecifier) { + if (node.kind === 210 && !node.moduleSpecifier) { ts.forEach(node.exportClause.elements, function (specifier) { if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; @@ -21694,7 +26393,7 @@ var ts; (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); }); } - else if (node.kind === 208) { + else if (node.kind === 209) { exportDefault = exportDefault || node; } else if (node.kind === 195 || node.kind === 196) { @@ -21724,7 +26423,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 208) { + if (node.kind === 209) { return node; } }); @@ -21802,10 +26501,10 @@ var ts; writeLine(); emitStart(exportDefault); write(emitAsReturn ? "return " : "module.exports = "); - if (exportDefault.kind === 208) { + if (exportDefault.kind === 209) { emit(exportDefault.expression); } - else if (exportDefault.kind === 211) { + else if (exportDefault.kind === 212) { emit(exportDefault.propertyName); } else { @@ -21829,8 +26528,7 @@ var ts; } return statements.length; } - function emitSourceFile(node) { - currentSourceFile = node; + function emitSourceFileNode(node) { writeLine(); emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); @@ -21870,14 +26568,14 @@ var ts; } emitLeadingComments(node.endOfFileToken); } - function emitNode(node, disableComments) { + function emitNodeWithoutSourceMapWithComments(node) { if (!node) { return; } if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = !disableComments && shouldEmitLeadingAndTrailingComments(node); + var emitComments = shouldEmitLeadingAndTrailingComments(node); if (emitComments) { emitLeadingComments(node); } @@ -21886,14 +26584,23 @@ var ts; emitTrailingComments(node); } } + function emitNodeWithoutSourceMapWithoutComments(node) { + if (!node) { + return; + } + if (node.flags & 2) { + return emitPinnedOrTripleSlashComments(node); + } + emitJavaScriptWorker(node); + } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { case 197: case 195: + case 204: case 203: - case 202: case 198: - case 208: + case 209: return false; case 200: return shouldEmitModuleDeclaration(node); @@ -21948,9 +26655,9 @@ var ts; return emitArrayLiteral(node); case 152: return emitObjectLiteral(node); - case 217: - return emitPropertyAssignment(node); case 218: + return emitPropertyAssignment(node); + case 219: return emitShorthandPropertyAssignment(node); case 126: return emitComputedPropertyName(node); @@ -22019,8 +26726,8 @@ var ts; return emitWithStatement(node); case 188: return emitSwitchStatement(node); - case 213: case 214: + case 215: return emitCaseOrDefaultClause(node); case 189: return emitLabelledStatement(node); @@ -22028,7 +26735,7 @@ var ts; return emitThrowStatement(node); case 191: return emitTryStatement(node); - case 216: + case 217: return emitCatchClause(node); case 192: return emitDebuggerStatement(node); @@ -22040,18 +26747,18 @@ var ts; return emitInterfaceDeclaration(node); case 199: return emitEnumDeclaration(node); - case 219: + case 220: return emitEnumMember(node); case 200: return emitModuleDeclaration(node); - case 203: + case 204: return emitImportDeclaration(node); - case 202: + case 203: return emitImportEqualsDeclaration(node); - case 209: + case 210: return emitExportDeclaration(node); - case 220: - return emitSourceFile(node); + case 221: + return emitSourceFileNode(node); } } function hasDetachedComments(pos) { @@ -22069,7 +26776,7 @@ var ts; } function getLeadingCommentsToEmit(node) { if (node.parent) { - if (node.parent.kind === 220 || node.pos !== node.parent.pos) { + if (node.parent.kind === 221 || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -22088,7 +26795,7 @@ var ts; } function emitTrailingDeclarationComments(node) { if (node.parent) { - if (node.parent.kind === 220 || node.end !== node.parent.end) { + if (node.parent.kind === 221 || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } @@ -22102,7 +26809,10 @@ var ts; else { leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, { + pos: pos, + end: pos + }, leadingComments); emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node) { @@ -22127,27 +26837,29 @@ var ts; if (nodeLine >= lastCommentLine + 2) { emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; + var currentDetachedCommentInfo = { + nodePos: node.pos, + detachedCommentEndPos: detachedComments[detachedComments.length - 1].end + }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); } else { - detachedCommentsInfo = [currentDetachedCommentInfo]; + detachedCommentsInfo = [ + currentDetachedCommentInfo + ]; } } } } } - function emitPinnedOrTripleSlashCommentsOfNode(node) { + function emitPinnedOrTripleSlashComments(node) { var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); function isPinnedOrTripleSlashComment(comment) { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { return true; } } @@ -22184,6 +26896,7 @@ var ts; (function (ts) { ts.emitTime = 0; ts.ioReadTime = 0; + ts.version = "1.5.0.0"; function createCompilerHost(options) { var currentDirectory; var existingDirectories = {}; @@ -22199,9 +26912,7 @@ var ts; } catch (e) { if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); + onError(e.number === unsupportedFileEncodingErrorCode ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText : e.message); } text = ""; } @@ -22237,12 +26948,20 @@ var ts; } return { getSourceFile: getSourceFile, - getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, + getDefaultLibFileName: function (options) { + return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); + }, writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, + getCurrentDirectory: function () { + return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); + }, + useCaseSensitiveFileNames: function () { + return ts.sys.useCaseSensitiveFileNames; + }, getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return ts.sys.newLine; } + getNewLine: function () { + return ts.sys.newLine; + } }; } ts.createCompilerHost = createCompilerHost; @@ -22282,7 +27001,9 @@ var ts; var seenNoDefaultLib = options.noLib; var commonSourceDirectory; host = host || createCompilerHost(options); - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); + ts.forEach(rootNames, function (name) { + return processRootFile(name, false); + }); if (!seenNoDefaultLib) { processRootFile(host.getDefaultLibFileName(options), true); } @@ -22291,21 +27012,35 @@ var ts; var noDiagnosticsTypeChecker; program = { getSourceFile: getSourceFile, - getSourceFiles: function () { return files; }, - getCompilerOptions: function () { return options; }, + getSourceFiles: function () { + return files; + }, + getCompilerOptions: function () { + return options; + }, getSyntacticDiagnostics: getSyntacticDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getTypeChecker: getTypeChecker, getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, + getCommonSourceDirectory: function () { + return commonSourceDirectory; + }, emit: emit, getCurrentDirectory: host.getCurrentDirectory, - getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, - getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, - getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); } + getNodeCount: function () { + return getDiagnosticsProducingTypeChecker().getNodeCount(); + }, + getIdentifierCount: function () { + return getDiagnosticsProducingTypeChecker().getIdentifierCount(); + }, + getSymbolCount: function () { + return getDiagnosticsProducingTypeChecker().getSymbolCount(); + }, + getTypeCount: function () { + return getDiagnosticsProducingTypeChecker().getTypeCount(); + } }; return program; function getEmitHost(writeFileCallback) { @@ -22332,7 +27067,11 @@ var ts; } function emit(sourceFile, writeFileCallback) { if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; + return { + diagnostics: [], + sourceMaps: undefined, + emitSkipped: true + }; } var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); @@ -22474,7 +27213,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 203 || node.kind === 202 || node.kind === 209) { + if (node.kind === 204 || node.kind === 203 || node.kind === 210) { var moduleNameExpr = ts.getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === 8) { var moduleNameText = moduleNameExpr.text; @@ -22496,8 +27235,7 @@ var ts; } else if (node.kind === 200 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { ts.forEachChild(node.body, function (node) { - if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { + if (ts.isExternalModuleImportEqualsDeclaration(node) && ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { @@ -22525,19 +27263,17 @@ var ts; } return; } - var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); + var firstExternalModuleSourceFile = ts.forEach(files, function (f) { + return ts.isExternalModule(f) ? f : undefined; + }); if (firstExternalModuleSourceFile && !options.module) { var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } - if (options.outDir || - options.sourceRoot || - (options.mapRoot && - (!options.out || firstExternalModuleSourceFile !== undefined))) { + if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { + if (!(sourceFile.flags & 2048) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); sourcePathComponents.pop(); if (commonPathComponents) { @@ -22715,10 +27451,20 @@ var ts; description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, experimental: true }, + { + name: "preserveNewLines", + type: "boolean", + description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, + experimental: true + }, { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + type: { + "es3": 0, + "es5": 1, + "es6": 2 + }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -22898,7 +27644,9 @@ var ts; var files = []; if (ts.hasProperty(json, "files")) { if (json["files"] instanceof Array) { - var files = ts.map(json["files"], function (s) { return ts.combinePaths(basePath, s); }); + var files = ts.map(json["files"], function (s) { + return ts.combinePaths(basePath, s); + }); } } else { @@ -22948,14 +27696,7 @@ var ts; var parent = n.parent; var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent.kind === 179 || - parent.kind === 182 || - parent.kind === 183 || - parent.kind === 181 || - parent.kind === 178 || - parent.kind === 180 || - parent.kind === 187 || - parent.kind === 216) { + if (parent.kind === 179 || parent.kind === 182 || parent.kind === 183 || parent.kind === 181 || parent.kind === 178 || parent.kind === 180 || parent.kind === 187 || parent.kind === 217) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); break; } @@ -22991,7 +27732,7 @@ var ts; case 197: case 199: case 152: - case 188: + case 202: var openBrace = ts.findChildOfKind(n, 14, sourceFile); var closeBrace = ts.findChildOfKind(n, 15, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); @@ -23042,7 +27783,13 @@ var ts; } var fileName = sourceFile.fileName; var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); + rawItems.push({ + name: name, + fileName: fileName, + matchKind: matchKind, + isCaseSensitive: allMatchesAreCaseSensitive(matches), + declaration: declaration + }); } } }); @@ -23076,9 +27823,7 @@ var ts; return undefined; } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 64 || - node.kind === 8 || - node.kind === 7) { + if (node.kind === 64 || node.kind === 8 || node.kind === 7) { return node.text; } return undefined; @@ -23142,11 +27887,11 @@ var ts; } return bestMatchKind; } - var baseSensitivity = { sensitivity: "base" }; + var baseSensitivity = { + sensitivity: "base" + }; function compareNavigateToItems(i1, i2) { - return i1.matchKind - i2.matchKind || - i1.name.localeCompare(i2.name, undefined, baseSensitivity) || - i1.name.localeCompare(i2.name); + return i1.matchKind - i2.matchKind || i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); } function createNavigateToItem(rawItem) { var declaration = rawItem.declaration; @@ -23204,19 +27949,19 @@ var ts; case 149: ts.forEach(node.elements, visit); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { childNodes.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { childNodes.push(importClause.namedBindings); } else { @@ -23236,9 +27981,9 @@ var ts; case 197: case 200: case 195: - case 202: - case 207: - case 211: + case 203: + case 208: + case 212: childNodes.push(node); break; } @@ -23296,7 +28041,9 @@ var ts; function isTopLevelFunctionDeclaration(functionDeclaration) { if (functionDeclaration.kind === 195) { if (functionDeclaration.body && functionDeclaration.body.kind === 174) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 195 && !isEmpty(s.name.text); })) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { + return s.kind === 195 && !isEmpty(s.name.text); + })) { return true; } if (!ts.isFunctionBlock(functionDeclaration.parent)) { @@ -23366,7 +28113,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 138: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 219: + case 220: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 136: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -23405,16 +28152,18 @@ var ts; } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 211: - case 207: - case 202: - case 204: + case 212: + case 208: + case 203: case 205: + case 206: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; function createItem(node, name, scriptElementKind) { - return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); + return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ]); } } function isEmpty(text) { @@ -23439,7 +28188,7 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 220: + case 221: return createSourceFileItem(node); case 196: return createClassItem(node); @@ -23468,12 +28217,16 @@ var ts; function createModuleItem(node) { var moduleName = getModuleName(node); var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); - return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createFunctionItem(node) { if (node.name && node.body && node.body.kind === 174) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } return undefined; } @@ -23483,10 +28236,10 @@ var ts; return undefined; } hasGlobalNode = true; - var rootName = ts.isExternalModule(node) - ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" - : ""; - return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); + var rootName = ts.isExternalModule(node) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" : ""; + return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [ + getNodeSpan(node) + ], childItems); } function createClassItem(node) { if (!node.name) { @@ -23499,26 +28252,38 @@ var ts; }); var nodes = removeDynamicallyNamedProperties(node); if (constructor) { - nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); + nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { + return !ts.isBindingPattern(p.name); + })); } var childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createEnumItem(node) { var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } function createIterfaceItem(node) { var childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [ + getNodeSpan(node) + ], childItems, getIndent(node)); } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 126; }); + return ts.filter(node.members, function (member) { + return member.name === undefined || member.name.kind !== 126; + }); } function removeDynamicallyNamedProperties(node) { - return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); + return ts.filter(node.members, function (member) { + return !ts.hasDynamicName(member); + }); } function getInnermostModule(node) { while (node.body.kind === 200) { @@ -23527,9 +28292,7 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 220 - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); + return node.kind === 221 ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -23559,7 +28322,9 @@ var ts; var stringToWordSpans = {}; pattern = pattern.trim(); var fullPatternSegment = createSegment(pattern); - var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); + var dotSeparatedSegments = pattern.split(".").map(function (p) { + return createSegment(p.trim()); + }); var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); return { getMatches: getMatches, @@ -23667,7 +28432,9 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [match]; + return [ + match + ]; } } var subWordTextChunks = segment.subWordTextChunks; @@ -23734,8 +28501,7 @@ var ts; for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { - if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || - !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { + if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; } } @@ -23756,10 +28522,7 @@ var ts; } ts.createPatternMatcher = createPatternMatcher; function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); + return compareType(match1, match2) || compareCamelCase(match1, match2) || compareCase(match1, match2) || comparePunctuation(match1, match2); } function comparePunctuation(result1, result2) { if (result1.punctuationStripped !== result2.punctuationStripped) { @@ -23908,11 +28671,7 @@ var ts; var currentIsDigit = isDigit(identifier.charCodeAt(i)); var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); var hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); - if (charIsPunctuation(identifier.charCodeAt(i - 1)) || - charIsPunctuation(identifier.charCodeAt(i)) || - lastIsDigit != currentIsDigit || - hasTransitionFromLowerToUpper || - hasTransitionFromUpperToLower) { + if (charIsPunctuation(identifier.charCodeAt(i - 1)) || charIsPunctuation(identifier.charCodeAt(i)) || lastIsDigit != currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { if (!isAllPunctuation(identifier, wordStart, i)) { result.push(ts.createTextSpan(wordStart, i - wordStart)); } @@ -23964,8 +28723,7 @@ var ts; } function transitionFromUpperToLower(identifier, word, index, wordStart) { if (word) { - if (index != wordStart && - index + 1 < identifier.length) { + if (index != wordStart && index + 1 < identifier.length) { var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { @@ -23983,9 +28741,7 @@ var ts; function transitionFromLowerToUpper(identifier, word, index) { var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - var transition = word - ? (currentIsUpper && !lastIsUpper) - : currentIsUpper; + var transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; return transition; } })(ts || (ts = {})); @@ -24021,8 +28777,7 @@ var ts; function getImmediatelyContainingArgumentInfo(node) { if (node.parent.kind === 155 || node.parent.kind === 156) { var callExpression = node.parent; - if (node.kind === 24 || - node.kind === 16) { + if (node.kind === 24 || node.kind === 16) { var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; ts.Debug.assert(list !== undefined); @@ -24031,15 +28786,15 @@ var ts; invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: 0, - argumentCount: getCommaBasedArgCount(list) + argumentCount: getArgumentCount(list) }; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { var list = listItemInfo.list; var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1; - var argumentCount = getCommaBasedArgCount(list); + var argumentIndex = getArgumentIndex(list, node); + var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: isTypeArgList ? 0 : 1, @@ -24076,10 +28831,29 @@ var ts; } return undefined; } - function getCommaBasedArgCount(argumentsList) { - return argumentsList.getChildCount() === 0 - ? 0 - : 1 + ts.countWhere(argumentsList.getChildren(), function (arg) { return arg.kind === 23; }); + function getArgumentIndex(argumentsList, node) { + var argumentIndex = 0; + var listChildren = argumentsList.getChildren(); + for (var i = 0, n = listChildren.length; i < n; i++) { + var child = listChildren[i]; + if (child === node) { + break; + } + if (child.kind !== 23) { + argumentIndex++; + } + } + return argumentIndex; + } + function getArgumentCount(argumentsList) { + var listChildren = argumentsList.getChildren(); + var argumentCount = ts.countWhere(listChildren, function (arg) { + return arg.kind !== 23; + }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { + argumentCount++; + } + return argumentCount; } function getArgumentIndexForTemplatePiece(spanIndex, node) { ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); @@ -24092,9 +28866,7 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - var argumentCount = tagExpression.template.kind === 10 - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = tagExpression.template.kind === 10 ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { kind: 2, @@ -24122,7 +28894,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 220; n = n.parent) { + for (var n = node; n.kind !== 221; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -24199,7 +28971,10 @@ var ts; isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23), ts.spacePart()], + separatorDisplayParts: [ + ts.punctuationPart(23), + ts.spacePart() + ], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; @@ -24308,24 +29083,31 @@ var ts; } ts.findListItemInfo = findListItemInfo; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.forEach(n.getChildren(sourceFile), function (c) { + return c.kind === kind && c; + }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 221 && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 222 && c.pos <= node.pos && c.end >= node.end) { return c; } }); + ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; } ts.findContainingList = findContainingList; function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isWord(n.kind); + }); } ts.getTouchingWord = getTouchingWord; function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); + return getTouchingToken(sourceFile, position, function (n) { + return isPropertyName(n.kind); + }); } ts.getTouchingPropertyName = getTouchingPropertyName; function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { @@ -24379,8 +29161,7 @@ var ts; var children = n.getChildren(); for (var i = 0, len = children.length; i < len; ++i) { var child = children[i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || - (child.pos === previousToken.end); + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -24418,7 +29199,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 220); + ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -24483,8 +29264,7 @@ var ts; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { - return ts.isTemplateLiteralKind(node.kind) - && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); + return ts.isTemplateLiteralKind(node.kind) && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); } ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function compareDataObjects(dst, src) { @@ -24517,19 +29297,38 @@ var ts; var indent; resetWriter(); return { - displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, 5); }, - writeOperator: function (text) { return writeKind(text, 12); }, - writePunctuation: function (text) { return writeKind(text, 15); }, - writeSpace: function (text) { return writeKind(text, 16); }, - writeStringLiteral: function (text) { return writeKind(text, 8); }, - writeParameter: function (text) { return writeKind(text, 13); }, + displayParts: function () { + return displayParts; + }, + writeKeyword: function (text) { + return writeKind(text, 5); + }, + writeOperator: function (text) { + return writeKind(text, 12); + }, + writePunctuation: function (text) { + return writeKind(text, 15); + }, + writeSpace: function (text) { + return writeKind(text, 16); + }, + writeStringLiteral: function (text) { + return writeKind(text, 8); + }, + writeParameter: function (text) { + return writeKind(text, 13); + }, writeSymbol: writeSymbol, writeLine: writeLine, - increaseIndent: function () { indent++; }, - decreaseIndent: function () { indent--; }, + increaseIndent: function () { + indent++; + }, + decreaseIndent: function () { + indent--; + }, clear: resetWriter, - trackSymbol: function () { } + trackSymbol: function () { + } }; function writeIndent() { if (lineStart) { @@ -24690,7 +29489,9 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, + lastTrailingTriviaWasNewLine: function () { + return wasNewLine; + }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -24751,8 +29552,7 @@ var ts; return container.kind === 9; } function shouldRescanTemplateToken(container) { - return container.kind === 12 || - container.kind === 13; + return container.kind === 12 || container.kind === 13; } function startsWithSlashToken(t) { return t === 36 || t === 56; @@ -24765,13 +29565,7 @@ var ts; token: undefined }; } - var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 - : shouldRescanSlashToken(n) - ? 2 - : shouldRescanTemplateToken(n) - ? 3 - : 0; + var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 : shouldRescanSlashToken(n) ? 2 : shouldRescanTemplateToken(n) ? 3 : 0; if (lastTokenInfo && expectedScanAction === lastScanAction) { return fixTokenKind(lastTokenInfo, n); } @@ -24951,9 +29745,7 @@ var ts; this.Flag = Flag; } Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + - "operation=" + this.Operation + "," + - "flag=" + this.Flag + "]"; + return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; }; return Rule; })(); @@ -24983,8 +29775,7 @@ var ts; this.RightTokenRange = RightTokenRange; } RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + - "rightRange=" + this.RightTokenRange + "]"; + return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; }; RuleDescriptor.create1 = function (left, right) { return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); @@ -25024,8 +29815,7 @@ var ts; this.Action = null; } RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + - "action=" + this.Action + "]"; + return "[context=" + this.Context + "," + "action=" + this.Action + "]"; }; RuleOperation.create1 = function (action) { return RuleOperation.create2(formatting.RuleOperationContext.Any, action); @@ -25091,7 +29881,12 @@ var ts; this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2)); this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15, 75), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15, 99), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([17, 19, 23, 22])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15, formatting.Shared.TokenRange.FromTokens([ + 17, + 19, + 23, + 22 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -25100,9 +29895,19 @@ var ts; this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([64, 3]); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 64, + 3 + ]); this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17, 3, 74, 95, 80, 75]); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([ + 17, + 3, + 74, + 95, + 80, + 75 + ]); this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2), 1); this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2)); @@ -25121,79 +29926,151 @@ var ts; this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([97, 93, 87, 73, 89, 96]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 69]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 97, + 93, + 87, + 73, + 89, + 96 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 104, + 69 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2)); this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8)); this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(82, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8)); this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(98, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2)); this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(89, 22), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17, 74, 75, 66]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); - this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([95, 80]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([115, 119]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 17, + 74, + 75, + 66 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 95, + 80 + ]), 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 115, + 119 + ]), 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2)); this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(113, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116, 117]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([68, 114, 76, 77, 78, 115, 102, 84, 103, 116, 106, 108, 119, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([78, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([ + 116, + 117 + ]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([ + 68, + 114, + 76, + 77, + 78, + 115, + 102, + 84, + 103, + 116, + 106, + 108, + 119, + 109 + ]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([ + 78, + 102 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 64), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([17, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.FromTokens([ + 17, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17, 24), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([ + 16, + 18, + 25, + 23 + ])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, this.SpaceBetweenCloseBraceAndElse, this.SpaceBetweenCloseBraceAndWhile, this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, this.NewLineAfterOpenBraceInBlockContext, this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.SpaceAfterLetConstInVariableDeclaration, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, + this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, + this.SpaceAfterColon, + this.NoSpaceBeforeQuestionMark, + this.SpaceAfterQuestionMarkInConditionalOperator, + this.NoSpaceAfterQuestionMark, + this.NoSpaceBeforeDot, + this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, + this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, + this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, + this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, + this.SpaceAfterSubtractWhenFollowedByPredecrement, + this.NoSpaceAfterCloseBrace, + this.SpaceAfterOpenBrace, + this.SpaceBeforeCloseBrace, + this.NewLineBeforeCloseBraceInBlockContext, + this.SpaceAfterCloseBrace, + this.SpaceBetweenCloseBraceAndElse, + this.SpaceBetweenCloseBraceAndWhile, + this.NoSpaceBetweenEmptyBraceBrackets, + this.SpaceAfterFunctionInFuncDecl, + this.NewLineAfterOpenBraceInBlockContext, + this.SpaceAfterGetSetInMember, + this.NoSpaceBetweenReturnAndSemicolon, + this.SpaceAfterCertainKeywords, + this.SpaceAfterLetConstInVariableDeclaration, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, + this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.NoSpaceAfterConstructor, + this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, + this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, + this.SpaceBeforeOpenBraceInFunction, + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterOpenBracket, + this.NoSpaceBeforeCloseBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, + this.SpaceAfterTryFinally + ]; this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); @@ -25235,10 +30112,10 @@ var ts; case 167: case 168: return true; - case 202: + case 203: case 193: case 128: - case 219: + case 220: case 130: case 129: return context.currentTokenSpan.kind === 52 || context.nextTokenSpan.kind === 52; @@ -25281,7 +30158,7 @@ var ts; } switch (node.kind) { case 174: - case 188: + case 202: case 152: case 201: return true; @@ -25324,7 +30201,7 @@ var ts; case 200: case 199: case 174: - case 216: + case 217: case 201: case 188: return true; @@ -25342,7 +30219,7 @@ var ts; case 191: case 179: case 187: - case 216: + case 217: return true; default: return false; @@ -25367,8 +30244,7 @@ var ts; return context.TokensAreOnSameLine(); }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 194 && - context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; + return context.currentTokenParent.kind === 194 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { return context.formattingRequestKind != 2; @@ -25402,8 +30278,7 @@ var ts; } }; Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { return context.currentTokenSpan.kind === 98 && context.currentTokenParent.kind === 164; @@ -25446,8 +30321,7 @@ var ts; }; RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && - rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; + var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); @@ -25521,19 +30395,13 @@ var ts; RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { var position; if (rule.Operation.Action == 1) { - position = specificTokens ? - 0 : - RulesPosition.IgnoreRulesAny; + position = specificTokens ? 0 : RulesPosition.IgnoreRulesAny; } else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? - RulesPosition.ContextRulesSpecific : - RulesPosition.ContextRulesAny; + position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; } else { - position = specificTokens ? - RulesPosition.NoContextRulesSpecific : - RulesPosition.NoContextRulesAny; + position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; } var state = constructionState[rulesBucketIndex]; if (state === undefined) { @@ -25590,7 +30458,9 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; + return [ + this.token + ]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -25644,18 +30514,68 @@ var ts; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([ + 3 + ])); TokenRange.Keywords = TokenRange.FromRange(65, 124); TokenRange.BinaryOperators = TokenRange.FromRange(24, 63); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([85, 86, 124]); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38, 39, 47, 46]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7, 64, 16, 18, 14, 92, 87]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([64, 16, 92, 87]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([64, 17, 19, 87]); - TokenRange.Comments = TokenRange.FromTokens([2, 3]); - TokenRange.TypeNames = TokenRange.FromTokens([64, 118, 120, 112, 121, 98, 111]); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([ + 85, + 86, + 124 + ]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([ + 38, + 39, + 47, + 46 + ]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([ + 7, + 64, + 16, + 18, + 14, + 92, + 87 + ]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([ + 64, + 16, + 92, + 87 + ]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([ + 64, + 17, + 19, + 87 + ]); + TokenRange.Comments = TokenRange.FromTokens([ + 2, + 3 + ]); + TokenRange.TypeNames = TokenRange.FromTokens([ + 64, + 118, + 120, + 112, + 121, + 98, + 111 + ]); return TokenRange; })(); Shared.TokenRange = TokenRange; @@ -25804,16 +30724,11 @@ var ts; } function findOutermostParent(position, expectedTokenKind, sourceFile) { var precedingToken = ts.findPrecedingToken(position, sourceFile); - if (!precedingToken || - precedingToken.kind !== expectedTokenKind || - position !== precedingToken.getEnd()) { + if (!precedingToken || precedingToken.kind !== expectedTokenKind || position !== precedingToken.getEnd()) { return undefined; } var current = precedingToken; - while (current && - current.parent && - current.parent.end === precedingToken.end && - !isListElement(current.parent, current)) { + while (current && current.parent && current.parent.end === precedingToken.end && !isListElement(current.parent, current)) { current = current.parent; } return current; @@ -25826,11 +30741,11 @@ var ts; case 200: var body = parent.body; return body && body.kind === 174 && ts.rangeContainsRange(body.statements, node); - case 220: + case 221: case 174: case 201: return ts.rangeContainsRange(parent.statements, node); - case 216: + case 217: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -25838,7 +30753,9 @@ var ts; function findEnclosingNode(range, sourceFile) { return find(sourceFile); function find(n) { - var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); + var candidate = ts.forEachChild(n, function (c) { + return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; + }); if (candidate) { var result = find(candidate); if (result) { @@ -25852,9 +30769,11 @@ var ts; if (!errors.length) { return rangeHasNoErrors; } - var sorted = errors - .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) - .sort(function (e1, e2) { return e1.start - e2.start; }); + var sorted = errors.filter(function (d) { + return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); + }).sort(function (e1, e2) { + return e1.start - e2.start; + }); if (!sorted.length) { return rangeHasNoErrors; } @@ -25948,10 +30867,7 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || - parent.kind === 220 || - parent.kind === 213 || - parent.kind === 214) { + if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -26000,8 +30916,12 @@ var ts; return nodeStartLine !== line ? indentation + delta : indentation; } }, - getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, + getIndentation: function () { + return indentation; + }, + getDelta: function () { + return delta; + }, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { if (lineAdded) { @@ -26194,8 +31114,7 @@ var ts; trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } else { - lineAdded = - processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + lineAdded = processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); } } previousRange = range; @@ -26223,9 +31142,7 @@ var ts; dynamicIndentation.recomputeIndentation(true); } } - trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + trimTrailingWhitespaces = (rule.Operation.Action & (4 | 2)) && rule.Flag !== 1; } else { trimTrailingWhitespaces = true; @@ -26262,10 +31179,16 @@ var ts; var startPos = commentRange.pos; for (var line = startLine; line < endLine; ++line) { var endOfLine = ts.getEndLinePosition(line, sourceFile); - parts.push({ pos: startPos, end: endOfLine }); + parts.push({ + pos: startPos, + end: endOfLine + }); startPos = ts.getStartPositionOfLine(line + 1, sourceFile); } - parts.push({ pos: startPos, end: commentRange.end }); + parts.push({ + pos: startPos, + end: commentRange.end + }); } var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); @@ -26280,9 +31203,7 @@ var ts; var delta = indentation - nonWhitespaceColumnInFirstPart.column; for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceCharacterAndColumn = i === 0 - ? nonWhitespaceColumnInFirstPart - : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); + var nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); @@ -26311,7 +31232,10 @@ var ts; } } function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; + return { + span: ts.createTextSpan(start, len), + newText: newText + }; } function recordDelete(start, len) { if (len) { @@ -26465,12 +31389,7 @@ var ts; if (!precedingToken) { return 0; } - var precedingTokenIsLiteral = precedingToken.kind === 8 || - precedingToken.kind === 9 || - precedingToken.kind === 10 || - precedingToken.kind === 11 || - precedingToken.kind === 12 || - precedingToken.kind === 13; + var precedingTokenIsLiteral = precedingToken.kind === 8 || precedingToken.kind === 9 || precedingToken.kind === 10 || precedingToken.kind === 11 || precedingToken.kind === 12 || precedingToken.kind === 13; if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } @@ -26530,8 +31449,7 @@ var ts; } } parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); if (actualIndentation !== -1) { @@ -26564,8 +31482,7 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 220 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -26605,8 +31522,7 @@ var ts; if (node.parent) { switch (node.parent.kind) { case 139: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; @@ -26622,8 +31538,7 @@ var ts; case 136: case 137: var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { + if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { return node.parent.typeParameters; } if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { @@ -26633,12 +31548,10 @@ var ts; case 156: case 155: var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { return node.parent.typeArguments; } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { + if (node.parent.arguments && ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { return node.parent.arguments; } break; @@ -26690,7 +31603,10 @@ var ts; } character++; } - return { column: column, character: character }; + return { + column: column, + character: character + }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -26707,15 +31623,15 @@ var ts; case 201: case 152: case 143: - case 188: + case 202: + case 215: case 214: - case 213: case 159: case 155: case 156: case 175: case 193: - case 208: + case 209: case 186: case 168: return true; @@ -26771,9 +31687,9 @@ var ts; case 152: case 174: case 201: - case 188: + case 202: return nodeEndsWith(n, 15, sourceFile); - case 216: + case 217: return isCompletedNode(n.block, sourceFile); case 159: case 136: @@ -26797,9 +31713,15 @@ var ts; return isCompletedNode(n.expression, sourceFile); case 151: return nodeEndsWith(n, 19, sourceFile); - case 213: case 214: + case 215: return false; + case 181: + return isCompletedNode(n.statement, sourceFile); + case 182: + return isCompletedNode(n.statement, sourceFile); + case 183: + return isCompletedNode(n.statement, sourceFile); case 180: return isCompletedNode(n.statement, sourceFile); case 179: @@ -26898,7 +31820,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(221, nodes.pos, nodes.end, 1024, this); + var list = createNode(222, nodes.pos, nodes.end, 1024, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -27067,10 +31989,7 @@ var ts; return pos; } function isName(pos, end, sourceFile, name) { - return pos + name.length < end && - sourceFile.text.substr(pos, name.length) === name && - (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || - ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); + return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { return isName(pos, end, sourceFile, paramTag); @@ -27286,7 +32205,9 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([ + this.declaration + ], undefined, false) : []; } return this.documentationComment; }; @@ -27320,9 +32241,7 @@ var ts; case 131: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; + var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; @@ -27339,12 +32258,12 @@ var ts; case 198: case 199: case 200: - case 202: - case 211: - case 207: - case 202: - case 204: + case 203: + case 212: + case 208: + case 203: case 205: + case 206: case 134: case 135: case 143: @@ -27374,24 +32293,24 @@ var ts; ts.forEachChild(node.name, visit); break; } - case 219: + case 220: case 130: case 129: namedDeclarations.push(node); break; - case 209: + case 210: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 203: + case 204: var importClause = node.importClause; if (importClause) { if (importClause.name) { namedDeclarations.push(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 205) { + if (importClause.namedBindings.kind === 206) { namedDeclarations.push(importClause.namedBindings); } else { @@ -27536,7 +32455,9 @@ var ts; ts.ClassificationTypeNames = ClassificationTypeNames; function displayPartsToString(displayParts) { if (displayParts) { - return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); + return ts.map(displayParts, function (displayPart) { + return displayPart.text; + }).join(""); } return ""; } @@ -27553,7 +32474,7 @@ var ts; return false; } for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 220 || parent.kind === 201) { + if (parent.kind === 221 || parent.kind === 201) { return false; } } @@ -27713,7 +32634,9 @@ var ts; return bucket; } function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { + var bucketInfoArray = Object.keys(buckets).filter(function (name) { + return name && name.charAt(0) === '_'; + }).map(function (name) { var entries = ts.lookUp(buckets, name); var sourceFiles = []; for (var i in entries) { @@ -27724,7 +32647,9 @@ var ts; references: entry.owners.slice(0) }); } - sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; }); + sourceFiles.sort(function (x, y) { + return y.refCount - x.refCount; + }); return { bucket: name, sourceFiles: sourceFiles @@ -27913,7 +32838,11 @@ var ts; processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { + referencedFiles: referencedFiles, + importedFiles: importedFiles, + isLibFile: isNoDefaultLib + }; } ts.preProcessFile = preProcessFile; function getTargetLabel(referenceNode, labelName) { @@ -27926,14 +32855,10 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 64 && - (node.parent.kind === 185 || node.parent.kind === 184) && - node.parent.label === node; + return node.kind === 64 && (node.parent.kind === 185 || node.parent.kind === 184) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 64 && - node.parent.kind === 189 && - node.parent.label === node; + return node.kind === 64 && node.parent.kind === 189 && node.parent.label === node; } function isLabeledBy(node, labelName) { for (var owner = node.parent; owner.kind === 189; owner = owner.parent) { @@ -27968,20 +32893,18 @@ var ts; return node.parent.kind === 200 && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 64 && - ts.isFunctionLike(node.parent) && node.parent.name === node; + return node.kind === 64 && ts.isFunctionLike(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 64 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 217 || node.parent.kind === 218) && node.parent.name === node; + return (node.kind === 64 || node.kind === 8 || node.kind === 7) && (node.parent.kind === 218 || node.parent.kind === 219) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 8 || node.kind === 7) { switch (node.parent.kind) { case 130: case 129: - case 217: - case 219: + case 218: + case 220: case 132: case 131: case 134: @@ -27996,15 +32919,12 @@ var ts; } function isNameOfExternalModuleImportOrDeclaration(node) { if (node.kind === 8) { - return isNameOfModuleDeclaration(node) || - (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); + return isNameOfModuleDeclaration(node) || (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); } return false; } function isInsideComment(sourceFile, token, position) { - return position <= token.getStart(sourceFile) && - (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || - isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments) { return ts.forEach(comments, function (comment) { if (comment.pos < position && position < comment.end) { @@ -28017,8 +32937,7 @@ var ts; return true; } else { - return !(text.charCodeAt(comment.end - 1) === 47 && - text.charCodeAt(comment.end - 2) === 42); + return !(text.charCodeAt(comment.end - 1) === 47 && text.charCodeAt(comment.end - 2) === 42); } } return false; @@ -28055,7 +32974,7 @@ var ts; return undefined; } switch (node.kind) { - case 220: + case 221: case 132: case 131: case 195: @@ -28073,38 +32992,49 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 200: return ScriptElementKind.moduleElement; - case 196: return ScriptElementKind.classElement; - case 197: return ScriptElementKind.interfaceElement; - case 198: return ScriptElementKind.typeElement; - case 199: return ScriptElementKind.enumElement; + case 200: + return ScriptElementKind.moduleElement; + case 196: + return ScriptElementKind.classElement; + case 197: + return ScriptElementKind.interfaceElement; + case 198: + return ScriptElementKind.typeElement; + case 199: + return ScriptElementKind.enumElement; case 193: - return ts.isConst(node) - ? ScriptElementKind.constElement - : ts.isLet(node) - ? ScriptElementKind.letElement - : ScriptElementKind.variableElement; - case 195: return ScriptElementKind.functionElement; - case 134: return ScriptElementKind.memberGetAccessorElement; - case 135: return ScriptElementKind.memberSetAccessorElement; + return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; + case 195: + return ScriptElementKind.functionElement; + case 134: + return ScriptElementKind.memberGetAccessorElement; + case 135: + return ScriptElementKind.memberSetAccessorElement; case 132: case 131: return ScriptElementKind.memberFunctionElement; case 130: case 129: return ScriptElementKind.memberVariableElement; - case 138: return ScriptElementKind.indexSignatureElement; - case 137: return ScriptElementKind.constructSignatureElement; - case 136: return ScriptElementKind.callSignatureElement; - case 133: return ScriptElementKind.constructorImplementationElement; - case 127: return ScriptElementKind.typeParameterElement; - case 219: return ScriptElementKind.variableElement; - case 128: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 202: - case 207: - case 204: - case 211: + case 138: + return ScriptElementKind.indexSignatureElement; + case 137: + return ScriptElementKind.constructSignatureElement; + case 136: + return ScriptElementKind.callSignatureElement; + case 133: + return ScriptElementKind.constructorImplementationElement; + case 127: + return ScriptElementKind.typeParameterElement; + case 220: + return ScriptElementKind.variableElement; + case 128: + return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 203: + case 208: case 205: + case 212: + case 206: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -28155,13 +33085,26 @@ var ts; var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, - getCancellationToken: function () { return cancellationToken; }, - getCanonicalFileName: function (fileName) { return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); }, - useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return host.getNewLine ? host.getNewLine() : "\r\n"; }, - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: function (fileName, data, writeByteOrderMark) { }, - getCurrentDirectory: function () { return host.getCurrentDirectory(); } + getCancellationToken: function () { + return cancellationToken; + }, + getCanonicalFileName: function (fileName) { + return useCaseSensitivefileNames ? fileName : fileName.toLowerCase(); + }, + useCaseSensitiveFileNames: function () { + return useCaseSensitivefileNames; + }, + getNewLine: function () { + return host.getNewLine ? host.getNewLine() : "\r\n"; + }, + getDefaultLibFileName: function (options) { + return host.getDefaultLibFileName(options); + }, + writeFile: function (fileName, data, writeByteOrderMark) { + }, + getCurrentDirectory: function () { + return host.getCurrentDirectory(); + } }); if (program) { var oldSourceFiles = program.getSourceFiles(); @@ -28248,8 +33191,7 @@ var ts; if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { return undefined; } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 || firstCharCode === 34)) { + if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 || firstCharCode === 34)) { displayName = displayName.substring(1, displayName.length - 1); } var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); @@ -28365,11 +33307,11 @@ var ts; getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); } } - else if (ts.getAncestor(previousToken, 204)) { + else if (ts.getAncestor(previousToken, 205)) { isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(previousToken)) { - var importDeclaration = ts.getAncestor(previousToken, 203); + var importDeclaration = ts.getAncestor(previousToken, 204); ts.Debug.assert(importDeclaration !== undefined); var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); var filteredExports = filterModuleExports(exports, importDeclaration); @@ -28410,16 +33352,14 @@ var ts; } function isCompletionListBlocker(previousToken) { var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || - isIdentifierDefinitionLocation(previousToken) || - isRightOfIllegalDot(previousToken); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function showCompletionsInImportsClause(node) { if (node) { if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 206; + return node.parent.kind === 207; } } return false; @@ -28429,16 +33369,9 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 151 - || containingNodeKind === 167; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 151 || containingNodeKind === 167; case 16: - return containingNodeKind === 155 - || containingNodeKind === 133 - || containingNodeKind === 156 - || containingNodeKind === 159; + return containingNodeKind === 155 || containingNodeKind === 133 || containingNodeKind === 156 || containingNodeKind === 159; case 18: return containingNodeKind === 151; case 116: @@ -28448,8 +33381,7 @@ var ts; case 14: return containingNodeKind === 196; case 52: - return containingNodeKind === 193 - || containingNodeKind === 167; + return containingNodeKind === 193 || containingNodeKind === 167; case 11: return containingNodeKind === 169; case 12: @@ -28469,9 +33401,7 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 - || previousToken.kind === 9 - || ts.isTemplateLiteralKind(previousToken.kind)) { + if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); if (start < position && position < end) { @@ -28518,43 +33448,23 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 23: - return containingNodeKind === 193 || - containingNodeKind === 194 || - containingNodeKind === 175 || - containingNodeKind === 199 || - isFunction(containingNodeKind) || - containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - containingNodeKind === 149 || - containingNodeKind === 148; + return containingNodeKind === 193 || containingNodeKind === 194 || containingNodeKind === 175 || containingNodeKind === 199 || isFunction(containingNodeKind) || containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || containingNodeKind === 149 || containingNodeKind === 148; case 20: return containingNodeKind === 149; case 18: return containingNodeKind === 149; case 16: - return containingNodeKind === 216 || - isFunction(containingNodeKind); + return containingNodeKind === 217 || isFunction(containingNodeKind); case 14: - return containingNodeKind === 199 || - containingNodeKind === 197 || - containingNodeKind === 143 || - containingNodeKind === 148; + return containingNodeKind === 199 || containingNodeKind === 197 || containingNodeKind === 143 || containingNodeKind === 148; case 22: - return containingNodeKind === 129 && - (previousToken.parent.parent.kind === 197 || - previousToken.parent.parent.kind === 143); + return containingNodeKind === 129 && (previousToken.parent.parent.kind === 197 || previousToken.parent.parent.kind === 143); case 24: - return containingNodeKind === 196 || - containingNodeKind === 195 || - containingNodeKind === 197 || - isFunction(containingNodeKind); + return containingNodeKind === 196 || containingNodeKind === 195 || containingNodeKind === 197 || isFunction(containingNodeKind); case 109: return containingNodeKind === 130; case 21: - return containingNodeKind === 128 || - containingNodeKind === 133 || - (previousToken.parent.parent.kind === 149); + return containingNodeKind === 128 || containingNodeKind === 133 || (previousToken.parent.parent.kind === 149); case 108: case 106: case 107: @@ -28599,8 +33509,7 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 206) { + if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -28609,7 +33518,9 @@ var ts; if (ts.isEmpty(exisingImports)) { return exports; } - return ts.filter(exports, function (e) { return !ts.lookUp(exisingImports, e.name); }); + return ts.filter(exports, function (e) { + return !ts.lookUp(exisingImports, e.name); + }); } function filterContextualMembersList(contextualMemberSymbols, existingMembers) { if (!existingMembers || existingMembers.length === 0) { @@ -28617,7 +33528,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 217 && m.kind !== 218) { + if (m.kind !== 218 && m.kind !== 219) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -28659,7 +33570,9 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, 5)], + displayParts: [ + ts.displayPart(entryName, 5) + ], documentation: undefined }; } @@ -28757,9 +33670,7 @@ var ts; return ScriptElementKind.unknown; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 - ? ts.getNodeModifiers(symbol.declarations[0]) - : ScriptElementKindModifier.none; + return symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } @@ -28842,8 +33753,7 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 113 && location.parent.kind === 133)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { var signature; var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); @@ -28858,8 +33768,7 @@ var ts; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 136 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; @@ -28935,7 +33844,7 @@ var ts; if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 219) { + if (declaration.kind === 220) { var constantValue = typeResolver.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -28951,7 +33860,7 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202) { + if (declaration.kind === 203) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); @@ -28979,9 +33888,7 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 || - symbolKind === ScriptElementKind.localVariableElement) { + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 || symbolKind === ScriptElementKind.localVariableElement) { displayParts.push(ts.punctuationPart(51)); displayParts.push(ts.spacePart()); if (type.symbol && type.symbol.flags & 262144) { @@ -28994,12 +33901,7 @@ var ts; displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 || - symbolFlags & 8192 || - symbolFlags & 16384 || - symbolFlags & 131072 || - symbolFlags & 98304 || - symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 || symbolFlags & 8192 || symbolFlags & 16384 || symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -29012,7 +33914,11 @@ var ts; if (!documentation) { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { + displayParts: displayParts, + documentation: documentation, + symbolKind: symbolKind + }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); @@ -29099,20 +34005,26 @@ var ts; if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; + return label ? [ + getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined) + ] : undefined; } - var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); + var comment = ts.forEach(sourceFile.referencedFiles, function (r) { + return (r.pos <= position && position < r.end) ? r : undefined; + }); if (comment) { var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); if (referenceFile) { - return [{ + return [ + { fileName: referenceFile.fileName, textSpan: ts.createTextSpanFromBounds(0, 0), kind: ScriptElementKind.scriptElement, name: comment.fileName, containerName: undefined, containerKind: undefined - }]; + } + ]; } return undefined; } @@ -29127,7 +34039,7 @@ var ts; } } var result = []; - if (node.parent.kind === 218) { + if (node.parent.kind === 219) { var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); var shorthandDeclarations = shorthandSymbol.getDeclarations(); var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); @@ -29143,8 +34055,7 @@ var ts; var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); var containerSymbol = symbol.parent; var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); @@ -29164,8 +34075,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || - (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { declarations.push(d); if (d.body) definition = d; @@ -29205,9 +34115,10 @@ var ts; if (!node) { return undefined; } - if (node.kind === 64 || node.kind === 92 || node.kind === 90 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], true, false, false); + if (node.kind === 64 || node.kind === 92 || node.kind === 90 || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + return getReferencesForNode(node, [ + sourceFile + ], true, false, false); } switch (node.kind) { case 83: @@ -29244,8 +34155,8 @@ var ts; break; case 66: case 72: - if (hasKind(parent(parent(node)), 188)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent); + if (hasKind(parent(parent(parent(node))), 188)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); } break; case 65: @@ -29255,9 +34166,7 @@ var ts; } break; case 81: - if (hasKind(node.parent, 181) || - hasKind(node.parent, 182) || - hasKind(node.parent, 183)) { + if (hasKind(node.parent, 181) || hasKind(node.parent, 182) || hasKind(node.parent, 183)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -29278,8 +34187,7 @@ var ts; return getGetAndSetOccurrences(node.parent); } default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { + if (ts.isModifier(node.kind) && node.parent && (ts.isDeclaration(node.parent) || node.parent.kind === 175)) { return getModifierOccurrences(node.kind, node.parent); } } @@ -29388,7 +34296,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 220) { + if (ts.isFunctionBlock(parent) || parent.kind === 221) { return parent; } if (parent.kind === 191) { @@ -29436,7 +34344,7 @@ var ts; function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; pushKeywordIf(keywords, switchStatement.getFirstToken(), 91); - ts.forEach(switchStatement.clauses, function (clause) { + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 66, 72); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { @@ -29524,15 +34432,16 @@ var ts; function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 115, 119); }); + ts.forEach(accessor.getChildren(), function (child) { + return pushKeywordIf(keywords, child, 115, 119); + }); } } } function getModifierOccurrences(modifier, declaration) { var container = declaration.parent; if (declaration.flags & 112) { - if (!(container.kind === 196 || - (declaration.kind === 128 && hasKind(container, 133)))) { + if (!(container.kind === 196 || (declaration.kind === 128 && hasKind(container, 133)))) { return undefined; } } @@ -29542,7 +34451,7 @@ var ts; } } else if (declaration.flags & (1 | 2)) { - if (!(container.kind === 201 || container.kind === 220)) { + if (!(container.kind === 201 || container.kind === 221)) { return undefined; } } @@ -29554,7 +34463,7 @@ var ts; var nodes; switch (container.kind) { case 201: - case 220: + case 221: nodes = container.statements; break; case 133: @@ -29576,7 +34485,9 @@ var ts; } ts.forEach(nodes, function (node) { if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + ts.forEach(node.modifiers, function (child) { + return pushKeywordIf(keywords, child, modifier); + }); } }); return ts.map(keywords, getReferenceEntryFromNode); @@ -29630,9 +34541,7 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 64 && - !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && - !isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind !== 64 && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } ts.Debug.assert(node.kind === 64 || node.kind === 7 || node.kind === 8); @@ -29642,7 +34551,9 @@ var ts; if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [ + getReferenceEntryFromNode(node) + ]; } else { return getLabelReferencesInNode(node.parent, node); @@ -29656,7 +34567,9 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [getReferenceEntryFromNode(node)]; + return [ + getReferenceEntryFromNode(node) + ]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -29690,17 +34603,17 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && - (location.parent.kind === 207 || location.parent.kind === 211) && - location.parent.propertyName === location; + return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 207 || declaration.kind === 211; + return declaration.kind === 208 || declaration.kind === 212; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(symbol.declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29714,7 +34627,9 @@ var ts; if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { + return d.kind === 160 ? d : undefined; + }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -29733,7 +34648,9 @@ var ts; } function getSymbolScope(symbol) { if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { + return (d.flags & 32) ? d : undefined; + }); if (privateDeclaration) { return ts.getAncestor(privateDeclaration, 196); } @@ -29755,7 +34672,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 220 && !ts.isExternalModule(container)) { + if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -29777,8 +34694,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -29796,8 +34712,7 @@ var ts; if (!node || node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || - (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { result.push(getReferenceEntryFromNode(node)); } }); @@ -29809,8 +34724,7 @@ var ts; case 64: return node.getWidth() === searchSymbolName.length; case 8: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { return node.getWidth() === searchSymbolName.length + 2; } break; @@ -29833,8 +34747,7 @@ var ts; cancellationToken.throwIfCancellationRequested(); var referenceLocation = ts.getTouchingPropertyName(sourceFile, position); if (!isValidReferencePosition(referenceLocation, searchText)) { - if ((findInStrings && isInString(position)) || - (findInComments && isInComment(position))) { + if ((findInStrings && isInString(position)) || (findInComments && isInComment(position))) { result.push({ fileName: sourceFile.fileName, textSpan: ts.createTextSpan(position, searchText.length), @@ -29932,7 +34845,7 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 220: + case 221: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } @@ -29943,7 +34856,7 @@ var ts; return undefined; } var result = []; - if (searchSpaceNode.kind === 220) { + if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -29981,8 +34894,8 @@ var ts; result.push(getReferenceEntryFromNode(node)); } break; - case 220: - if (container.kind === 220 && !ts.isExternalModule(container)) { + case 221: + if (container.kind === 221 && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -29991,7 +34904,9 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [symbol]; + var result = [ + symbol + ]; if (isImportOrExportSpecifierImportSymbol(symbol)) { result.push(typeInfoResolver.getAliasedSymbol(symbol)); } @@ -30044,13 +34959,14 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return true; } - if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && - searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { + if (isImportOrExportSpecifierImportSymbol(referenceSymbol) && searchSymbols.indexOf(typeInfoResolver.getAliasedSymbol(referenceSymbol)) >= 0) { return true; } if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { + return searchSymbols.indexOf(s) >= 0; + }); }); } return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { @@ -30060,7 +34976,9 @@ var ts; if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { var result = []; getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); - return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); + return ts.forEach(result, function (s) { + return searchSymbols.indexOf(s) >= 0; + }); } return false; }); @@ -30074,7 +34992,9 @@ var ts; if (contextualType.flags & 16384) { var unionProperty = contextualType.getProperty(name); if (unionProperty) { - return [unionProperty]; + return [ + unionProperty + ]; } else { var result = []; @@ -30090,7 +35010,9 @@ var ts; else { var symbol = contextualType.getProperty(name); if (symbol) { - return [symbol]; + return [ + symbol + ]; } } } @@ -30146,7 +35068,9 @@ var ts; return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); } function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1; }); + return ts.forEach(diagnostics, function (diagnostic) { + return diagnostic.category === 1; + }); } function getEmitOutput(fileName) { synchronizeHostData(); @@ -30172,9 +35096,9 @@ var ts; case 150: case 130: case 129: - case 217: case 218: case 219: + case 220: case 132: case 131: case 133: @@ -30183,7 +35107,7 @@ var ts; case 195: case 160: case 161: - case 216: + case 217: return 1; case 127: case 197: @@ -30203,14 +35127,14 @@ var ts; else { return 4; } - case 206: case 207: - case 202: - case 203: case 208: + case 203: + case 204: case 209: + case 210: return 1 | 2 | 4; - case 220: + case 221: return 4 | 1; } return 1 | 2 | 4; @@ -30240,15 +35164,13 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && - node.parent.right === node && - node.parent.parent.kind === 202) { + if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; } function getMeaningFromLocation(node) { - if (node.parent.kind === 208) { + if (node.parent.kind === 209) { return 1 | 2 | 4; } else if (isInRightSideOfImport(node)) { @@ -30301,8 +35223,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 200 && - nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 200 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { @@ -30349,8 +35270,7 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || - (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -30475,16 +35395,11 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 52) { - if (token.parent.kind === 193 || - token.parent.kind === 130 || - token.parent.kind === 128) { + if (token.parent.kind === 193 || token.parent.kind === 130 || token.parent.kind === 128) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 167 || - token.parent.kind === 165 || - token.parent.kind === 166 || - token.parent.kind === 168) { + if (token.parent.kind === 167 || token.parent.kind === 165 || token.parent.kind === 166 || token.parent.kind === 168) { return ClassificationTypeNames.operator; } } @@ -30582,14 +35497,22 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 14: return 15; - case 16: return 17; - case 18: return 19; - case 24: return 25; - case 15: return 14; - case 17: return 16; - case 19: return 18; - case 25: return 24; + case 14: + return 15; + case 16: + return 17; + case 18: + return 19; + case 24: + return 25; + case 15: + return 14; + case 17: + return 16; + case 19: + return 18; + case 25: + return 24; } return undefined; } @@ -30670,7 +35593,9 @@ var ts; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { + return "(" + escapeRegExp(d.text) + ")"; + }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; @@ -30678,9 +35603,7 @@ var ts; return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { - return (char >= 97 && char <= 122) || - (char >= 65 && char <= 90) || - (char >= 48 && char <= 57); + return (char >= 97 && char <= 122) || (char >= 65 && char <= 90) || (char >= 48 && char <= 57); } } function getRenameInfo(fileName, position) { @@ -30781,9 +35704,7 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || - node.parent.kind === 212 || - isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -30793,10 +35714,7 @@ var ts; } } function isArgumentOfElementAccessExpression(node) { - return node && - node.parent && - node.parent.kind === 154 && - node.parent.argumentExpression === node; + return node && node.parent && node.parent.kind === 154 && node.parent.argumentExpression === node; } function createClassifier() { var scanner = ts.createScanner(2, false); @@ -30825,10 +35743,7 @@ var ts; } function canFollow(keyword1, keyword2) { if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 115 || - keyword2 === 119 || - keyword2 === 113 || - keyword2 === 109) { + if (keyword2 === 115 || keyword2 === 119 || keyword2 === 113 || keyword2 === 109) { return true; } return false; @@ -30886,18 +35801,13 @@ var ts; else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { token = 64; } - else if (lastNonTriviaToken === 64 && - token === 24) { + else if (lastNonTriviaToken === 64 && token === 24) { angleBracketStack++; } else if (token === 25 && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 111 || - token === 120 || - token === 118 || - token === 112 || - token === 121) { + else if (token === 111 || token === 120 || token === 118 || token === 112 || token === 121) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 64; } @@ -30948,9 +35858,7 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 - ? 3 - : 2; + result.finalLexState = quoteChar === 34 ? 3 : 2; } } } @@ -30982,7 +35890,10 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ length: length, classification: classification }); + result.entries.push({ + length: length, + classification: classification + }); } } } @@ -31077,7 +35988,9 @@ var ts; return 5; } } - return { getClassificationsForLine: getClassificationsForLine }; + return { + getClassificationsForLine: getClassificationsForLine + }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -31092,7 +36005,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 220 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 221 ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -31101,9 +36014,15 @@ var ts; Node.prototype = proto; return Node; }, - getSymbolConstructor: function () { return SymbolObject; }, - getTypeConstructor: function () { return TypeObject; }, - getSignatureConstructor: function () { return SignatureObject; } + getSymbolConstructor: function () { + return SymbolObject; + }, + getTypeConstructor: function () { + return TypeObject; + }, + getSignatureConstructor: function () { + return SignatureObject; + } }; } initializeServices(); @@ -31183,7 +36102,7 @@ var ts; } case 201: return spanInBlock(node); - case 216: + case 217: return spanInBlock(node.block); case 177: return textSpan(node.expression); @@ -31209,20 +36128,20 @@ var ts; return textSpan(node, ts.findNextToken(node.expression, node)); case 188: return textSpan(node, ts.findNextToken(node.expression, node)); - case 213: case 214: + case 215: return spanInNode(node.statements[0]); case 191: return spanInBlock(node.tryBlock); case 190: return textSpan(node, node.expression); - case 208: + case 209: return textSpan(node, node.expression); - case 202: - return textSpan(node, node.moduleReference); case 203: + return textSpan(node, node.moduleReference); + case 204: return textSpan(node, node.moduleSpecifier); - case 209: + case 210: return textSpan(node, node.moduleSpecifier); case 200: if (ts.getModuleInstanceState(node) !== 1) { @@ -31230,7 +36149,7 @@ var ts; } case 196: case 199: - case 219: + case 220: case 155: case 156: return textSpan(node); @@ -31264,7 +36183,7 @@ var ts; case 80: return spanInNextNode(node); default: - if (node.parent.kind === 217 && node.parent.name === node) { + if (node.parent.kind === 218 && node.parent.name === node) { return spanInNode(node.parent.initializer); } if (node.parent.kind === 158 && node.parent.type === node) { @@ -31277,17 +36196,12 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 182 || - variableDeclaration.parent.parent.kind === 183) { + if (variableDeclaration.parent.parent.kind === 182 || variableDeclaration.parent.parent.kind === 183) { return spanInNode(variableDeclaration.parent.parent); } var isParentVariableStatement = variableDeclaration.parent.parent.kind === 175; var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 181 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; + var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.parent.initializer.declarations : undefined; if (variableDeclaration.initializer || (variableDeclaration.flags & 1)) { if (declarations && declarations[0] === variableDeclaration) { if (isParentVariableStatement) { @@ -31308,8 +36222,7 @@ var ts; } } function canHaveSpanInParameterDeclaration(parameter) { - return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16) || !!(parameter.flags & 32); + return !!parameter.initializer || parameter.dotDotDotToken !== undefined || !!(parameter.flags & 16) || !!(parameter.flags & 32); } function spanInParameterDeclaration(parameter) { if (canHaveSpanInParameterDeclaration(parameter)) { @@ -31327,8 +36240,7 @@ var ts; } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); + return !!(functionDeclaration.flags & 1) || (functionDeclaration.parent.kind === 196 && functionDeclaration.kind !== 133); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -31389,8 +36301,8 @@ var ts; case 196: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 188: - return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); + case 202: + return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } @@ -31407,12 +36319,12 @@ var ts; if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 216: + case 217: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 188: - var switchStatement = node.parent; - var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; + case 202: + var caseBlock = node.parent; + var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { return spanInNode(lastClause.statements[lastClause.statements.length - 1]); } @@ -31447,7 +36359,7 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 217) { + if (ts.isFunctionLike(node.parent) || node.parent.kind === 218) { return spanInPreviousNode(node); } return spanInNode(node.parent); @@ -31580,15 +36492,21 @@ var ts; function forwardJSONCall(logger, actionDescription, action) { try { var result = simpleForwardCall(logger, actionDescription, action); - return JSON.stringify({ result: result }); + return JSON.stringify({ + result: result + }); } catch (err) { if (err instanceof ts.OperationCanceledException) { - return JSON.stringify({ canceled: true }); + return JSON.stringify({ + canceled: true + }); } logInternalError(logger, err); err.description = actionDescription; - return JSON.stringify({ error: err }); + return JSON.stringify({ + error: err + }); } } var ShimBase = (function () { @@ -31638,7 +36556,9 @@ var ts; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { var _this = this; var newLine = this.getNewLine(); - return diagnostics.map(function (d) { return _this.realizeDiagnostic(d, newLine); }); + return diagnostics.map(function (d) { + return _this.realizeDiagnostic(d, newLine); + }); }; LanguageServiceShimObject.prototype.realizeDiagnostic = function (diagnostic, newLine) { return { diff --git a/bin/typescriptServices_internal.d.ts b/bin/typescriptServices_internal.d.ts index 2cd2257c3e1c5..a899c1e240ba2 100644 --- a/bin/typescriptServices_internal.d.ts +++ b/bin/typescriptServices_internal.d.ts @@ -171,6 +171,7 @@ declare module ts { function unescapeIdentifier(identifier: string): string; function makeIdentifierFromModuleName(moduleName: string): string; function isBlockOrCatchScoped(declaration: Declaration): boolean; + function getEnclosingBlockScopeContainer(node: Node): Node; function isCatchClauseVariableDeclaration(declaration: Declaration): boolean; function declarationNameToString(name: DeclarationName): string; function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; @@ -270,7 +271,6 @@ declare module ts { function nodeIsSynthesized(node: Node): boolean; function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string; - function createDiagnosticCollection(): DiagnosticCollection; /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) diff --git a/bin/typescript_internal.d.ts b/bin/typescript_internal.d.ts index e2e18df57263b..d01fe85350578 100644 --- a/bin/typescript_internal.d.ts +++ b/bin/typescript_internal.d.ts @@ -171,6 +171,7 @@ declare module "typescript" { function unescapeIdentifier(identifier: string): string; function makeIdentifierFromModuleName(moduleName: string): string; function isBlockOrCatchScoped(declaration: Declaration): boolean; + function getEnclosingBlockScopeContainer(node: Node): Node; function isCatchClauseVariableDeclaration(declaration: Declaration): boolean; function declarationNameToString(name: DeclarationName): string; function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; @@ -270,7 +271,6 @@ declare module "typescript" { function nodeIsSynthesized(node: Node): boolean; function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string; - function createDiagnosticCollection(): DiagnosticCollection; /** * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine)