diff --git a/Jakefile b/Jakefile index 324356a4af5..3a19812b958 100644 --- a/Jakefile +++ b/Jakefile @@ -252,6 +252,8 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu options += " --stripInternal" } + options += " --cacheDownlevelForOfLength --preserveNewLines"; + var cmd = host + " " + dir + compilerFilename + " " + options + " "; cmd = cmd + sources.join(" "); console.log(cmd + "\n"); diff --git a/bin/tsc.js b/bin/tsc.js index a19101dc546..1d7c008595d 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -44,8 +44,9 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (v === value) { return true; } } @@ -67,8 +68,9 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (predicate(v)) { count++; } } @@ -77,12 +79,13 @@ var ts; } ts.countWhere = countWhere; function filter(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (f(_item)) { + result.push(_item); } } } @@ -90,10 +93,12 @@ var ts; } ts.filter = filter; function map(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result.push(f(v)); } } return result; @@ -108,12 +113,14 @@ var ts; } ts.concatenate = concatenate; function deduplicate(array) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (!contains(result, _item)) { + result.push(_item); + } } } return result; @@ -121,15 +128,17 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result += v[prop]; } return result; } ts.sum = sum; function addRange(to, from) { - for (var i = 0, n = from.length; i < n; i++) { - to.push(from[i]); + for (var _i = 0, _n = from.length; _i < _n; _i++) { + var v = from[_i]; + to.push(v); } } ts.addRange = addRange; @@ -190,9 +199,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var id in second) { - if (!hasProperty(result, id)) { - result[id] = second[id]; + for (var _id in second) { + if (!hasProperty(result, _id)) { + result[_id] = second[_id]; } } return result; @@ -394,8 +403,8 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; + for (var _i = 0, _n = parts.length; _i < _n; _i++) { + var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { normalized.pop(); @@ -410,7 +419,7 @@ var ts; return normalized; } function normalizePath(path) { - var path = normalizeSlashes(path); + path = normalizeSlashes(path); var rootLength = getRootLength(path); var normalized = getNormalizedParts(path, rootLength); return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); @@ -433,7 +442,7 @@ var ts; return [path.substr(0, rootLength)].concat(normalizedParts); } function getNormalizedPathComponents(path, currentDirectory) { - var path = normalizeSlashes(path); + path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { path = combinePaths(normalizeSlashes(currentDirectory), path); @@ -536,8 +545,8 @@ var ts; ts.fileExtensionIs = fileExtensionIs; var supportedExtensions = [".d.ts", ".ts", ".js"]; function removeFileExtension(path) { - for (var i = 0; i < supportedExtensions.length; i++) { - var ext = supportedExtensions[i]; + for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); } @@ -688,15 +697,16 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var i = 0; i < files.length; i++) { - var name = files[i]; - if (!extension || ts.fileExtensionIs(name, extension)) { - result.push(ts.combinePaths(path, name)); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var _name = files[_i]; + if (!extension || ts.fileExtensionIs(_name, extension)) { + result.push(ts.combinePaths(path, _name)); } } var subfolders = getNames(folder.subfolders); - for (var i = 0; i < subfolders.length; i++) { - visitDirectory(ts.combinePaths(path, subfolders[i])); + for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + var current = subfolders[_a]; + visitDirectory(ts.combinePaths(path, current)); } } } @@ -781,8 +791,9 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var i = 0; i < files.length; i++) { - var name = ts.combinePaths(path, files[i]); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var current = files[_i]; + var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); if (stat.isFile()) { if (!extension || ts.fileExtensionIs(name, extension)) { @@ -793,8 +804,9 @@ var ts; directories.push(name); } } - for (var i = 0; i < directories.length; i++) { - visitDirectory(directories[i]); + for (var _a = 0, _b = directories.length; _a < _b; _a++) { + var _current = directories[_a]; + visitDirectory(_current); } } } @@ -1506,9 +1518,9 @@ var ts; } function makeReverseMap(source) { var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; + for (var _name in source) { + if (source.hasOwnProperty(_name)) { + result[source[_name]] = _name; } } return result; @@ -1684,8 +1696,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 62 && isConflictMarkerTrivia(text, pos)) { + var _ch = text.charCodeAt(pos); + if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -2083,8 +2095,8 @@ var ts; return result; } function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { + var _len = tokenValue.length; + if (_len >= 2 && _len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; @@ -2236,13 +2248,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 && text.charCodeAt(pos + 1) === 47) { + var _ch = text.charCodeAt(pos); + if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(ch)) { + if (isLineBreak(_ch)) { precedingLineBreak = true; } pos++; @@ -2275,22 +2287,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var value = scanBinaryOrOctalDigits(2); - if (value < 0) { + var _value = scanBinaryOrOctalDigits(2); + if (_value < 0) { error(ts.Diagnostics.Binary_digit_expected); - value = 0; + _value = 0; } - tokenValue = "" + value; + tokenValue = "" + _value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var value = scanBinaryOrOctalDigits(8); - if (value < 0) { + var _value_1 = scanBinaryOrOctalDigits(8); + if (_value_1 < 0) { error(ts.Diagnostics.Octal_digit_expected); - value = 0; + _value_1 = 0; } - tokenValue = "" + value; + tokenValue = "" + _value_1; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -2389,10 +2401,10 @@ var ts; case 126: return pos++, token = 47; case 92: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); @@ -2556,8 +2568,8 @@ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; } @@ -3039,8 +3051,8 @@ var ts; } case 7: case 8: - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -3048,7 +3060,7 @@ var ts; case 220: case 218: case 150: - return parent.initializer === node; + return _parent.initializer === node; case 177: case 178: case 179: @@ -3059,25 +3071,25 @@ var ts; case 214: case 190: case 188: - return parent.expression === node; + return _parent.expression === node; case 181: - var forStatement = parent; + var forStatement = _parent; return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; case 182: case 183: - var forInStatement = parent; + var forInStatement = _parent; return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || forInStatement.expression === node; case 158: - return node === parent.expression; + return node === _parent.expression; case 173: - return node === parent.expression; + return node === _parent.expression; case 126: - return node === parent.expression; + return node === _parent.expression; default: - if (isExpression(parent)) { + if (isExpression(_parent)) { return true; } } @@ -3236,14 +3248,14 @@ var ts; if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { return false; } - var parent = name.parent; - if (parent.kind === 208 || parent.kind === 212) { - if (parent.propertyName) { + var _parent = name.parent; + if (_parent.kind === 208 || _parent.kind === 212) { + if (_parent.propertyName) { return true; } } - if (isDeclaration(parent)) { - return parent.name === name; + if (isDeclaration(_parent)) { + return _parent.name === name; } return false; } @@ -3265,9 +3277,10 @@ var ts; ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - if (clauses[i].token === kind) { - return clauses[i]; + for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + var clause = clauses[_i]; + if (clause.token === kind) { + return clause; } } } @@ -3508,7 +3521,7 @@ var ts; ts.createSynthesizedNode = createSynthesizedNode; function generateUniqueName(baseName, isExistingName) { if (baseName.charCodeAt(0) !== 95) { - var baseName = "_" + baseName; + baseName = "_" + baseName; if (!isExistingName(baseName)) { return baseName; } @@ -3518,9 +3531,9 @@ var ts; } var i = 1; while (true) { - var name = baseName + i; - if (!isExistingName(name)) { - return name; + var _name = baseName + i; + if (!isExistingName(_name)) { + return _name; } i++; } @@ -3651,8 +3664,9 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var i = 0, len = nodes.length; i < len; i++) { - var result = cbNode(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + var result = cbNode(node); if (result) { return result; } @@ -3953,16 +3967,16 @@ var ts; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var parent = sourceFile; + var _parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== parent) { - n.parent = parent; - var saveParent = parent; - parent = n; + if (n.parent !== _parent) { + n.parent = _parent; + var saveParent = _parent; + _parent = n; forEachChild(n, visitNode); - parent = saveParent; + _parent = saveParent; } } } @@ -4000,8 +4014,9 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } } } @@ -4063,8 +4078,9 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } return; } @@ -4357,8 +4373,8 @@ var ts; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - parseErrorAtPosition(start, length, message, arg0); + var _length = scanner.getTextPos() - start; + parseErrorAtPosition(start, _length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -5184,11 +5200,11 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { var method = createNode(131, fullStart); - method.name = name; + method.name = _name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); @@ -5196,7 +5212,7 @@ var ts; } else { var property = createNode(129, fullStart); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -5523,6 +5539,11 @@ var ts; nextToken(); return !scanner.hasPrecedingLineBreak() && isIdentifier(); } + function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && + (isIdentifier() || token === 14 || token === 18); + } function parseYieldExpression() { var node = createNode(170); nextToken(); @@ -5859,10 +5880,10 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(155, expression.pos); - callExpr.expression = expression; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); + var _callExpr = createNode(155, expression.pos); + _callExpr.expression = expression; + _callExpr.arguments = parseArgumentList(); + expression = finishNode(_callExpr); continue; } return expression; @@ -6516,15 +6537,15 @@ var ts; } function parsePropertyOrMethodDeclaration(fullStart, modifiers) { var asteriskToken = parseOptionalToken(35); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); } else { var property = createNode(130, fullStart); setModifiers(property, modifiers); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); property.initializer = allowInAnd(parseNonParameterInitializer); @@ -6881,7 +6902,7 @@ var ts; return finishNode(node); } function isLetDeclaration() { - return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOnSameLine); + return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart() { switch (token) { @@ -7131,7 +7152,7 @@ var ts; } ts.bindSourceFile = bindSourceFile; function bindSourceFileWorker(file) { - var parent; + var _parent; var container; var blockScopeContainer; var lastContainer; @@ -7204,9 +7225,10 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (_name !== undefined) { + symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); if (symbol.flags & excludes) { if (node.name) { node.name.parent = node; @@ -7218,7 +7240,7 @@ var ts; file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); }); file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, name); + symbol = createSymbol(0, _name); } } else { @@ -7275,10 +7297,10 @@ var ts; if (symbolKind & 255504) { node.locals = {}; } - var saveParent = parent; + var saveParent = _parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; - parent = node; + _parent = node; if (symbolKind & 262128) { container = node; if (lastContainer) { @@ -7291,7 +7313,7 @@ var ts; } ts.forEachChild(node, bind); container = saveContainer; - parent = saveParent; + _parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -7394,7 +7416,7 @@ var ts; return "__" + ts.indexOf(node.parent.parameters, node); } function bind(node) { - node.parent = parent; + node.parent = _parent; switch (node.kind) { case 127: bindDeclaration(node, 262144, 530912, false); @@ -7528,10 +7550,10 @@ var ts; bindChildren(node, 0, true); break; default: - var saveParent = parent; - parent = node; + var saveParent = _parent; + _parent = node; ts.forEachChild(node, bind); - parent = saveParent; + _parent = saveParent; } } function bindParameter(node) { @@ -7574,6 +7596,8 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); + var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -7610,8 +7634,6 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfExternalModule: getExportsOfExternalModule }; - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); var anyType = createIntrinsicType(1, "any"); @@ -8018,11 +8040,11 @@ var ts; function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol) { - var name = specifier.propertyName || specifier.name; - if (name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), name.text, 107455 | 793056 | 1536); + var _name = specifier.propertyName || specifier.name; + if (_name.text) { + var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); return; } return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); @@ -8121,8 +8143,9 @@ var ts; if (ts.getFullWidth(name) === 0) { return undefined; } + var symbol; if (name.kind === 64) { - var symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } @@ -8133,7 +8156,7 @@ var ts; return undefined; } var right = name.right; - var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); + symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; @@ -8161,14 +8184,17 @@ var ts; return symbol; } } + var sourceFile; while (true) { var fileName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); - if (sourceFile || isRelative) + sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); + if (sourceFile || isRelative) { break; + } var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) + if (parentPath === searchPath) { break; + } searchPath = parentPath; } if (sourceFile) { @@ -8268,8 +8294,8 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; + for (var _i = 0, _n = members.length; _i < _n; _i++) { + var member = members[_i]; if (member.kind === 133 && ts.nodeIsPresent(member.body)) { return member; } @@ -8328,25 +8354,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { + for (var _location = enclosingDeclaration; _location; _location = _location.parent) { + if (_location.locals && !isGlobalSourceFile(_location)) { + if (result = callback(_location.locals)) { return result; } } - switch (location.kind) { + switch (_location.kind) { case 221: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalModule(_location)) { break; } case 200: - if (result = callback(getSymbolOfNode(location).exports)) { + if (result = callback(getSymbolOfNode(_location).exports)) { return result; } break; case 196: case 197: - if (result = callback(getSymbolOfNode(location).members)) { + if (result = callback(getSymbolOfNode(_location).members)) { return result; } break; @@ -8587,8 +8613,9 @@ var ts; walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + var accessibleSymbol = accessibleSymbolChain[_i]; + appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } } else { @@ -8770,15 +8797,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + var signature = _a[_i]; + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.constructSignatures.length; i++) { + for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { + var _signature = _c[_b]; writeKeyword(writer, 87); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -8808,17 +8837,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; + for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { + var p = _f[_e]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var j = 0; j < signatures.length; j++) { + for (var _h = 0, _j = signatures.length; _h < _j; _h++) { + var _signature_1 = signatures[_h]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -8956,10 +8986,11 @@ var ts; } function isUsedInExportAssignment(node) { var externalModule = getContainingExternalModule(node); + var exportAssignmentSymbol; + var resolvedExportSymbol; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; + exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; @@ -8999,12 +9030,12 @@ var ts; case 195: case 199: case 203: - var parent = getDeclarationContainer(node); + var _parent = getDeclarationContainer(node); if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); + !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { + return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(parent); + return isDeclarationVisible(_parent); case 130: case 129: case 134: @@ -9074,13 +9105,14 @@ var ts; } return parentType; } + var type; if (pattern.kind === 148) { - var name = declaration.propertyName || declaration.name; - var type = getTypeOfPropertyOfType(parentType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, 1) || + var _name = declaration.propertyName || declaration.name; + 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)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); return unknownType; } } @@ -9091,7 +9123,7 @@ var ts; } if (!declaration.dotDotDotToken) { var propName = "" + ts.indexOf(pattern.elements, declaration); - var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { 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); @@ -9103,7 +9135,7 @@ var ts; } } else { - var type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(getIndexTypeOfType(parentType, 1)); } } return type; @@ -9155,8 +9187,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + var _name = e.propertyName || e.name; + var symbol = createSymbol(flags, _name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -9283,8 +9315,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 134); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + var _getter = ts.getDeclarationOfKind(symbol, 134); + error(_getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } } @@ -9461,8 +9493,8 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var _declaration = ts.getDeclarationOfKind(symbol, 198); + error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -9518,23 +9550,23 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = symbol; } return result; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; + for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; } @@ -9542,8 +9574,9 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); + for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + var signature = baseSignatures[_i]; + signatures.push(signature); } } } @@ -9640,13 +9673,14 @@ var ts; function getUnionSignatures(types, 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) { + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; + if (signature.typeParameters) { return emptyArray; } } - for (var i = 1; i < signatureLists.length; i++) { - if (!signatureListsIdentical(signatures, signatureLists[i])) { + for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { return emptyArray; } } @@ -9660,8 +9694,9 @@ var ts; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var i = 0; i < types.length; i++) { - var indexType = getIndexTypeOfType(types[i], kind); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + var indexType = getIndexTypeOfType(type, kind); if (!indexType) { return undefined; } @@ -9678,17 +9713,22 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; + var members; + var callSignatures; + var constructSignatures; + var stringIndexType; + var numberIndexType; if (symbol.flags & 2048) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + members = symbol.members; + callSignatures = getSignaturesOfSymbol(members["__call"]); + constructSignatures = getSignaturesOfSymbol(members["__new"]); + stringIndexType = getIndexTypeOfSymbol(symbol, 0); + numberIndexType = getIndexTypeOfSymbol(symbol, 1); } else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; + members = emptySymbols; + callSignatures = emptyArray; + constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } @@ -9706,8 +9746,8 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + stringIndexType = undefined; + numberIndexType = (symbol.flags & 384) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -9790,8 +9830,9 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var i = 0; i < types.length; i++) { - var type = getApparentType(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (!prop) { @@ -9807,12 +9848,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop.declarations) { - declarations.push.apply(declarations, prop.declarations); + for (var _a = 0, _b = props.length; _a < _b; _a++) { + var _prop = props[_a]; + if (_prop.declarations) { + declarations.push.apply(declarations, _prop.declarations); } - propTypes.push(getTypeOfSymbol(prop)); + propTypes.push(getTypeOfSymbol(_prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -9849,9 +9890,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; + var _symbol = getPropertyOfObjectType(globalFunctionType, name); + if (_symbol) + return _symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -9972,14 +10013,15 @@ var ts; function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { signature.resolvedReturnType = resolvingType; + var type; if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -10044,8 +10086,9 @@ var ts; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var node = decl; if (node.parameters.length === 1) { var parameter = node.parameters[0]; if (parameter && parameter.type && parameter.type.kind === syntaxKind) { @@ -10083,8 +10126,9 @@ var ts; default: var result = ""; for (var i = 0; i < types.length; i++) { - if (i > 0) + if (i > 0) { result += ","; + } result += types[i].id; } return result; @@ -10092,8 +10136,9 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var i = 0; i < types.length; i++) { - result |= types[i].flags; + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + result |= type.flags; } return result & 786432; } @@ -10146,8 +10191,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = resolveEntityName(node.typeName, 793056); + var type; if (symbol) { - var type; if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } @@ -10185,8 +10230,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; switch (declaration.kind) { case 196: case 197: @@ -10268,13 +10313,15 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var i = 0, len = types.length; i < len; i++) { - addTypeToSortedSet(sortedTypes, types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -10290,8 +10337,9 @@ var ts; } } function containsAnyType(types) { - for (var i = 0; i < types.length; i++) { - if (types[i].flags & 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (type.flags & 1) { return true; } } @@ -10405,8 +10453,9 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); + for (var _i = 0, _n = items.length; _i < _n; _i++) { + var v = items[_i]; + result.push(instantiator(v, mapper)); } return result; } @@ -10425,8 +10474,9 @@ var ts; } return function (t) { for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) + if (t === sources[i]) { return targets[i]; + } } return t; }; @@ -10443,9 +10493,11 @@ var ts; case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) + for (var _i = 0, _n = sources.length; _i < _n; _i++) { + var source = sources[_i]; + if (t === source) { return anyType; + } } return t; }; @@ -10479,8 +10531,9 @@ var ts; return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { + var freshTypeParameters; if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); } var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); @@ -10637,7 +10690,7 @@ var ts; } function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { if (elaborateErrors === void 0) { elaborateErrors = false; } - var result; + var _result; if (source === target) return -1; if (relation !== identityRelation) { @@ -10661,54 +10714,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (result = unionTypeRelatedToUnionType(source, target)) { - if (result &= unionTypeRelatedToUnionType(target, source)) { - return result; + if (_result = unionTypeRelatedToUnionType(source, target)) { + if (_result &= unionTypeRelatedToUnionType(target, source)) { + return _result; } } } else if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = unionTypeRelatedToType(target, source, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(target, source, reportErrors)) { + return _result; } } } else { if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = typeRelatedToUnionType(source, target, reportErrors)) { - return result; + if (_result = typeRelatedToUnionType(source, target, reportErrors)) { + return _result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (result = typeParameterRelatedTo(source, target, reportErrors)) { - return result; + if (_result = typeParameterRelatedTo(source, target, reportErrors)) { + return _result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return result; + if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return _result; } } 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))) { + (_result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors, elaborateErrors))) { errorInfo = saveErrorInfo; - return result; + return _result; } } if (reportErrors) { @@ -10724,16 +10777,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = typeRelatedToUnionType(sourceTypes[i], target, false); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -10746,27 +10800,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = isRelatedTo(sourceTypes[i], target, reportErrors); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var _result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -10832,19 +10887,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; + var _result; if (expandingFlags === 3) { - var result = 1; + _result = 1; } else { - var result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (result) { - result &= numberIndexTypesRelatedTo(source, target, reportErrors); + _result = propertiesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (_result) { + _result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -10852,23 +10908,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result) { + if (_result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return result; + return _result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) { + if (t.flags & 4096 && t.target === _target) { count++; if (count >= 10) return true; @@ -10881,11 +10937,11 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var _result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { @@ -10936,7 +10992,7 @@ var ts; } return 0; } - result &= related; + _result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -10946,7 +11002,7 @@ var ts; } } } - return result; + return _result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -10954,9 +11010,9 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var result = -1; - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; + var _result = -1; + for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -10965,9 +11021,9 @@ var ts; if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -10978,18 +11034,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var _result = -1; var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; + outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; + for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - result &= related; + _result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -10999,7 +11055,7 @@ var ts; return 0; } } - return result; + return _result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -11029,14 +11085,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var _result = -1; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); + var related = isRelatedTo(_s, _t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(_t, _s, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -11045,13 +11101,13 @@ var ts; } errorInfo = saveErrorInfo; } - result &= related; + _result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return result; + return _result; var s = getReturnTypeOfSignature(source); - return result & isRelatedTo(s, t, reportErrors); + return _result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -11059,15 +11115,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var result = -1; + var _result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -11107,11 +11163,12 @@ var ts; } return 0; } + var related; if (sourceStringType && sourceNumberType) { - var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } if (!related) { if (reportErrors) { @@ -11186,14 +11243,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - var related = compareTypes(s, t); - if (!related) { + for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { + var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); + var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); + var _related = compareTypes(s, t); + if (!_related) { return 0; } - result &= related; + result &= _related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -11201,8 +11258,9 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; } return true; @@ -11305,29 +11363,30 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var errorReported = false; + var _errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - errorReported = true; + _errorReported = true; } }); - return errorReported; + return _errorReported; } return false; } function reportImplicitAnyError(declaration, type) { var typeAsString = typeToString(getWidenedType(type)); + var diagnostic; switch (declaration.kind) { case 130: case 129: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; + diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; case 128: - var diagnostic = declaration.dotDotDotToken ? + diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; @@ -11342,10 +11401,10 @@ var ts; error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } - var diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; + diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } @@ -11384,7 +11443,8 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) { + for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + var unused = typeParameters[_i]; inferences.push({ primary: undefined, secondary: undefined }); } return { @@ -11403,19 +11463,21 @@ var ts; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) + if (source === sourceStack[i] && target === targetStack[i]) { return true; + } } return false; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) + if (t.flags & 4096 && t.target === _target) { count++; + } } return count < 5; } @@ -11442,16 +11504,16 @@ var ts; else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); + for (var _i = 0; _i < sourceTypes.length; _i++) { + inferFromTypes(sourceTypes[_i], targetTypes[_i]); } } else if (target.flags & 16384) { - var targetTypes = target.types; + var _targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var i = 0; i < targetTypes.length; i++) { - var t = targetTypes[i]; + for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { + var t = _targetTypes[_a]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -11467,9 +11529,10 @@ var ts; } } else if (source.flags & 16384) { - var sourceTypes = source.types; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], target); + var _sourceTypes = source.types; + for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { + var sourceType = _sourceTypes[_b]; + inferFromTypes(sourceType, target); } } else if (source.flags & 48128 && (target.flags & (4096 | 8192) || @@ -11494,8 +11557,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -11677,10 +11740,10 @@ 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)) { - containerNodes.unshift(parent); + for (var _parent = node.parent; _parent; _parent = _parent.parent) { + if ((ts.isExpression(_parent) || ts.isObjectLiteralMethod(node)) && + isContextSensitive(_parent)) { + containerNodes.unshift(_parent); } } ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); @@ -11966,11 +12029,12 @@ var ts; var container = ts.getSuperContainer(node, true); if (container) { var canUseSuperExpression = false; + var needToCaptureLexicalThis; if (isCallExpression) { canUseSuperExpression = container.kind === 133; } else { - var needToCaptureLexicalThis = false; + needToCaptureLexicalThis = false; while (container && container.kind === 161) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; @@ -12117,8 +12181,9 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var i = 0; i < types.length; i++) { - var t = mapper(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var t = mapper(current); if (t) { if (!mappedType) { mappedType = t; @@ -12193,8 +12258,8 @@ var ts; if (node.contextualType) { return node.contextualType; } - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -12206,22 +12271,22 @@ var ts; return getContextualTypeForReturnExpression(node); case 155: case 156: - return getContextualTypeForArgument(parent, node); + return getContextualTypeForArgument(_parent, node); case 158: - return getTypeFromTypeNode(parent.type); + return getTypeFromTypeNode(_parent.type); case 167: return getContextualTypeForBinaryOperand(node); case 218: - return getContextualTypeForObjectLiteralElement(parent); + return getContextualTypeForObjectLiteralElement(_parent); case 151: return getContextualTypeForElementExpression(node); case 168: return getContextualTypeForConditionalOperand(node); case 173: - ts.Debug.assert(parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + ts.Debug.assert(_parent.parent.kind === 169); + return getContextualTypeForSubstitutionExpression(_parent.parent, node); case 159: - return getContextualType(parent); + return getContextualType(_parent); } return undefined; } @@ -12253,12 +12318,13 @@ var ts; } var signatureList; var types = type.types; - for (var i = 0; i < types.length; i++) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; if (signatureList && - getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + getSignaturesOfObjectOrUnionType(current, 0).length > 1) { return undefined; } - var signature = getNonGenericSignature(types[i]); + var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { signatureList = [signature]; @@ -12283,15 +12349,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var parent = node.parent; - if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { + var _parent = node.parent; + if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { return true; } - if (parent.kind === 218) { - return isAssignmentTarget(parent.parent); + if (_parent.kind === 218) { + return isAssignmentTarget(_parent.parent); } - if (parent.kind === 151) { - return isAssignmentTarget(parent); + if (_parent.kind === 151) { + return isAssignmentTarget(_parent); } return false; } @@ -12356,21 +12422,22 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var i = 0; i < node.properties.length; i++) { - var memberDecl = node.properties[i]; + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var memberDecl = _a[_i]; var member = memberDecl.symbol; if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + var type = void 0; if (memberDecl.kind === 218) { - var type = checkPropertyAssignment(memberDecl, contextualMapper); + type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { - var type = checkObjectLiteralMethod(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { ts.Debug.assert(memberDecl.kind === 219); - var type = memberDecl.name.kind === 126 + type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); } @@ -12405,15 +12472,15 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, type)) { - propTypes.push(type); + var _type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, _type)) { + propTypes.push(_type); } } } - var result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= result.flags; - return result; + var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= _result.flags; + return _result; } return undefined; } @@ -12516,9 +12583,9 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - var start = node.end - "]".length; - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); + var _start = node.end - "]".length; + var _end = node.end; + grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -12533,15 +12600,15 @@ var ts; return unknownType; } if (node.argumentExpression) { - var name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name !== undefined) { - var prop = getPropertyOfType(objectType, name); + var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (_name !== undefined) { + var prop = getPropertyOfType(objectType, _name); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); return unknownType; } } @@ -12628,22 +12695,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; + var _parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { + if (lastParent && _parent === lastParent) { index++; } else { - lastParent = parent; + lastParent = _parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent; + lastParent = _parent; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -12735,30 +12802,31 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + var argType = void 0; if (i === 0 && args[i].parent.kind === 157) { - var argType = globalTemplateStringsArrayType; + argType = globalTemplateStringsArrayType; } else { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - var argType = checkExpressionWithContextualType(arg, paramType, mapper); + argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + for (var _i = 0; _i < args.length; _i++) { + if (excludeArgument[_i] === false) { + var _arg = args[_i]; + var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); + inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); } } } var inferredTypes = getInferredTypes(context); context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var i = 0; i < inferredTypes.length; i++) { - if (inferredTypes[i] === inferenceFailureType) { - inferredTypes[i] = unknownType; + for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { + if (inferredTypes[_i_1] === inferenceFailureType) { + inferredTypes[_i_1] = unknownType; } } return context; @@ -12880,50 +12948,53 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (hasCorrectArity(node, args, candidates[i])) { - return candidates[i]; + for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + var candidate = candidates[_i]; + if (hasCorrectArity(node, args, candidate)) { + return candidate; } } } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var i = 0; i < candidates.length; i++) { - if (!hasCorrectArity(node, args, candidates[i])) { + for (var _a = 0, _b = candidates.length; _a < _b; _a++) { + var current = candidates[_a]; + if (!hasCorrectArity(node, args, current)) { continue; } - var originalCandidate = candidates[i]; - var inferenceResult; + var originalCandidate = current; + var inferenceResult = void 0; + var _candidate = void 0; + var typeArgumentsAreValid = void 0; while (true) { - var candidate = originalCandidate; - if (candidate.typeParameters) { - var typeArgumentTypes; - var typeArgumentsAreValid; + _candidate = originalCandidate; + if (_candidate.typeParameters) { + var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(_candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; typeArgumentTypes = inferenceResult.inferredTypes; } if (!typeArgumentsAreValid) { break; } - candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return candidate; + return _candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = candidate; + var instantiatedCandidate = _candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } @@ -12935,7 +13006,7 @@ var ts; } } else { - ts.Debug.assert(originalCandidate === candidate); + ts.Debug.assert(originalCandidate === _candidate); candidateForArgumentError = originalCandidate; } } @@ -13094,9 +13165,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var _parameter = signature.parameters[signature.parameters.length - 1]; + var _links = getSymbolLinks(_parameter); + _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -13104,15 +13175,16 @@ var ts; if (!func.body) { return unknownType; } + var type; if (func.body.kind !== 174) { - var type = checkExpressionCached(func.body, contextualMapper); + type = checkExpressionCached(func.body, contextualMapper); } else { var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } - var type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); + type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; @@ -13232,12 +13304,14 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: + case 64: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; - case 153: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + } + case 153: { + var _symbol = findSymbol(n); + return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + } case 154: return true; case 159: @@ -13249,18 +13323,20 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 64: - case 153: + case 153: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; - case 154: + } + case 154: { var index = n.argumentExpression; - var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { - var name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + var _symbol = findSymbol(n.expression); + if (_symbol && index && index.kind === 8) { + var _name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; + } case 159: return isConstVariableReference(n.expression); default: @@ -13332,8 +13408,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (types[i].flags & kind) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (current.flags & kind) { return true; } } @@ -13347,8 +13424,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (!(types[i].flags & kind)) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (!(current.flags & kind)) { return false; } } @@ -13382,19 +13460,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; if (p.kind === 218 || p.kind === 219) { - var name = p.name; + var _name = p.name; var type = sourceType.flags & 1 ? sourceType : - getTypeOfPropertyOfType(sourceType, name.text) || - isNumericLiteralName(name.text) && getIndexTypeOfType(sourceType, 1) || + getTypeOfPropertyOfType(sourceType, _name.text) || + isNumericLiteralName(_name.text) && getIndexTypeOfType(sourceType, 1) || getIndexTypeOfType(sourceType, 0); if (type) { - checkDestructuringAssignment(p.initializer || name, type); + checkDestructuringAssignment(p.initializer || _name, type); } else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); } } else { @@ -13829,8 +13907,9 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { case 120: @@ -14017,8 +14096,8 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; + for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; } @@ -14098,16 +14177,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; + var _errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { ts.Debug.assert(node.kind === 132 || node.kind === 131); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); + error(_errorNode, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14123,8 +14202,9 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; if (inAmbientContextOrInterface) { @@ -14181,9 +14261,10 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + var signature = signatures[_a]; + if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } } @@ -14195,7 +14276,6 @@ var ts; if (!produceDiagnostics) { return; } - var symbol; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); @@ -14332,8 +14412,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -14353,8 +14433,8 @@ var ts; return; } if (ts.getClassBaseTypeNode(enclosingClass)) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -14369,8 +14449,8 @@ var ts; if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { return; } - var parent = getDeclarationContainer(node); - if (parent.kind === 221 && ts.isExternalModule(parent)) { + var _parent = getDeclarationContainer(node); + 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)); } } @@ -14391,8 +14471,8 @@ var ts; (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); + 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); } } } @@ -14406,10 +14486,11 @@ var ts; return node.kind === 128; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind === 128) { - var func = ts.getContainingFunction(node); - visit(node.initializer); + if (getRootDeclaration(node).kind !== 128) { + return; } + var func = ts.getContainingFunction(node); + visit(node.initializer); function visit(n) { if (n.kind === 64) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; @@ -14839,8 +14920,8 @@ var ts; }); if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { var classDeclaration = type.symbol.valueDeclaration; - for (var i = 0; i < classDeclaration.members.length; i++) { - var member = classDeclaration.members[i]; + for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); @@ -14867,22 +14948,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var errorNode; + var _errorNode; if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + _errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - errorNode = indexDeclaration; + _errorNode = indexDeclaration; } else if (containingType.flags & 2048) { var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + _errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } - if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { + 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; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -14899,7 +14980,7 @@ var ts; } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { + for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { @@ -14971,8 +15052,9 @@ var ts; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); + for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + var baseProperty = baseProperties[_i]; + var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { continue; } @@ -14989,7 +15071,7 @@ var ts; if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { continue; } - var errorMessage; + var errorMessage = void 0; if (base.flags & 8192) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; @@ -15047,11 +15129,11 @@ var ts; var seen = {}; 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]; + for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; + for (var _b = 0, _c = properties.length; _b < _c; _b++) { + var prop = properties[_b]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; } @@ -15106,8 +15188,8 @@ var ts; checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128)) { + var _nodeLinks = getNodeLinks(node); + if (!(_nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; @@ -15144,7 +15226,7 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + _nodeLinks.flags |= 128; } function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { return evalConstant(initializer); @@ -15199,10 +15281,10 @@ var ts; } var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var enumType; + var _enumType; var propertyName; if (e.kind === 64) { - enumType = currentType; + _enumType = currentType; propertyName = e.text; } else { @@ -15211,21 +15293,21 @@ var ts; e.argumentExpression.kind !== 8) { return undefined; } - var enumType = getTypeOfNode(e.expression); + _enumType = getTypeOfNode(e.expression); propertyName = e.argumentExpression.text; } else { - var enumType = getTypeOfNode(e.expression); + _enumType = getTypeOfNode(e.expression); propertyName = e.name.text; } - if (enumType !== currentType) { + if (_enumType !== currentType) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(enumType, propertyName); + var property = getPropertyOfObjectType(_enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -15285,8 +15367,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -15462,18 +15544,19 @@ var ts; } function hasExportedMembers(moduleSymbol) { var declarations = moduleSymbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var statements = getModuleStatements(declarations[i]); - for (var j = 0; j < statements.length; j++) { - var node = statements[j]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var statements = getModuleStatements(current); + for (var _a = 0, _b = statements.length; _a < _b; _a++) { + var node = statements[_a]; if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; } var specifiers = exportClause.elements; - for (var k = 0; k < specifiers.length; k++) { - var specifier = specifiers[k]; + for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { + var specifier = specifiers[_c]; if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { return true; } @@ -15838,21 +15921,21 @@ var ts; } case 125: ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 142) { + var _parent = node.parent; + if (_parent.kind === 142) { return false; } - if (139 <= parent.kind && parent.kind <= 147) { + if (139 <= _parent.kind && _parent.kind <= 147) { return true; } - switch (parent.kind) { + switch (_parent.kind) { case 127: - return node === parent.constraint; + return node === _parent.constraint; case 130: case 129: case 128: case 193: - return node === parent.type; + return node === _parent.type; case 195: case 160: case 161: @@ -15861,16 +15944,16 @@ var ts; case 131: case 134: case 135: - return node === parent.type; + return node === _parent.type; case 136: case 137: case 138: - return node === parent.type; + return node === _parent.type; case 158: - return node === parent.type; + return node === _parent.type; case 155: case 156: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; case 157: return false; } @@ -15927,17 +16010,17 @@ var ts; return getNodeLinks(entityName).resolvedSymbol; } else if (entityName.kind === 125) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { + var _symbol = getNodeLinks(entityName).resolvedSymbol; + if (!_symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 139 ? 793056 : 1536; - meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; + _meaning |= 8388608; + return resolveEntityName(entityName, _meaning); } return undefined; } @@ -16011,21 +16094,21 @@ var ts; return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); + var _symbol = getSymbolInfo(node); + return _symbol && getDeclaredTypeOfSymbol(_symbol); } if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); + var _symbol_1 = getSymbolOfNode(node); + return getTypeOfSymbol(_symbol_1); } if (ts.isDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); + var _symbol_2 = getSymbolInfo(node); + return _symbol_2 && getTypeOfSymbol(_symbol_2); } if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + var _symbol_3 = getSymbolInfo(node); + var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); } return unknownType; } @@ -16036,7 +16119,7 @@ var ts; return checkExpression(expr); } function getAugmentedPropertiesOfType(type) { - var type = getApparentType(type); + type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { @@ -16050,9 +16133,9 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name = symbol.name; + var _name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, name)); + symbols.push(getPropertyOfType(t, _name)); }); return symbols; } @@ -16125,8 +16208,8 @@ var ts; return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); } function makeUniqueName(baseName) { - var name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[name] = name; + var _name = ts.generateUniqueName(baseName, isExistingName); + return generatedNames[_name] = _name; } function assignGeneratedName(node, name) { getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); @@ -16138,8 +16221,8 @@ var ts; } function generateNameForModuleOrEnum(node) { if (node.name.kind === 64) { - var name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); + var _name = node.name.text; + assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); } } function generateNameForImportOrExportDeclaration(node) { @@ -16301,7 +16384,7 @@ var ts; : undefined; var symbol = declarationSymbol || getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 2 | 8388608, undefined, undefined); + resolveName(n, n.text, 107455 | 8388608, undefined, undefined); var isLetOrConst = symbol && (symbol.flags & 2) && symbol.valueDeclaration.parent.kind !== 217; @@ -16395,13 +16478,13 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var i = 0, n = node.modifiers.length; i < n; i++) { - var modifier = node.modifiers[i]; + for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + var modifier = _a[_i]; switch (modifier.kind) { case 108: case 107: case 106: - var text; + var text = void 0; if (modifier.kind === 108) { text = "public"; } @@ -16600,8 +16683,8 @@ var ts; function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var i = 0, n = arguments.length; i < n; i++) { - var arg = arguments[i]; + for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + var arg = arguments[_i]; if (arg.kind === 172) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } @@ -16627,9 +16710,8 @@ var ts; var seenExtendsClause = false; var seenImplementsClause = false; if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -16656,9 +16738,8 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -16703,19 +16784,19 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - for (var i = 0, n = node.properties.length; i < n; i++) { - var prop = node.properties[i]; - var name = prop.name; + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var prop = _a[_i]; + var _name = prop.name; if (prop.kind === 172 || - name.kind === 126) { - checkGrammarComputedPropertyName(name); + _name.kind === 126) { + checkGrammarComputedPropertyName(_name); continue; } - var currentKind; + var currentKind = void 0; 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); + if (_name.kind === 7) { + checkGrammarNumbericLiteral(_name); } currentKind = Property; } @@ -16731,26 +16812,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name.text)) { - seen[name.text] = currentKind; + if (!ts.hasProperty(seen, _name.text)) { + seen[_name.text] = currentKind; } else { - var existingKind = seen[name.text]; + var existingKind = seen[_name.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; + seen[_name.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -16770,16 +16851,16 @@ var ts; } var firstDeclaration = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 182 + 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); + return grammarErrorOnNode(firstDeclaration.name, _diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 182 + var _diagnostic_1 = 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); + return grammarErrorOnNode(firstDeclaration, _diagnostic_1); } } } @@ -16913,10 +16994,10 @@ var ts; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 185 + 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); + return grammarErrorOnNode(node, _message); } } function checkGrammarBindingElement(node) { @@ -16963,8 +17044,9 @@ var ts; } else { var elements = name.elements; - for (var i = 0; i < elements.length; ++i) { - checkGrammarNameInLetOrConstDeclarations(elements[i].name); + for (var _i = 0, _n = elements.length; _i < _n; _i++) { + var element = elements[_i]; + checkGrammarNameInLetOrConstDeclarations(element.name); } } } @@ -17020,8 +17102,8 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var i = 0, n = enumDecl.members.length; i < n; i++) { - var node = enumDecl.members[i]; + for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + var node = _a[_i]; if (node.name.kind === 126) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } @@ -17116,8 +17198,8 @@ var ts; return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var i = 0, n = file.statements.length; i < n; i++) { - var decl = file.statements[i]; + for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; if (ts.isDeclaration(decl) || decl.kind === 175) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; @@ -17138,9 +17220,9 @@ var ts; 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 === 221) { - var links = getNodeLinks(node.parent); - if (!links.hasReportedStatementInAmbientContext) { - return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + var _links = getNodeLinks(node.parent); + if (!_links.hasReportedStatementInAmbientContext) { + return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } } else { @@ -17401,11 +17483,12 @@ var ts; } function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); } else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); } return emitOutputFilePathWithoutExtension + extension; } @@ -17487,17 +17570,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var writer = createTextWriter(newLine); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - setWriter(writer); - return writer; + var _writer = createTextWriter(newLine); + _writer.trackSymbol = trackSymbol; + _writer.writeKeyword = _writer.write; + _writer.writeOperator = _writer.write; + _writer.writePunctuation = _writer.write; + _writer.writeSpace = _writer.write; + _writer.writeStringLiteral = _writer.writeLiteral; + _writer.writeParameter = _writer.write; + _writer.writeSymbol = _writer.write; + setWriter(_writer); + return _writer; } function setWriter(newWriter) { writer = newWriter; @@ -17565,18 +17648,20 @@ var ts; } } function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emit(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (currentWriterPos !== writer.getTextPos()) { write(separator); } currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); + eachNodeEmitFn(node); } } function emitCommaList(nodes, eachNodeEmitFn) { @@ -18065,13 +18150,14 @@ var ts; return; } var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); if (!(node.flags & 32)) { - var accessorWithTypeAnnotation = node; + accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; @@ -18505,14 +18591,14 @@ var ts; } } function generateUniqueNameForLocation(location, baseName) { - var name; + var _name; if (!isExistingName(location, baseName)) { - name = baseName; + _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); + return recordNameInCurrentScope(_name); } function recordNameInCurrentScope(name) { if (!currentScopeNames) { @@ -18660,8 +18746,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name = node.name; - if (!name || name.kind !== 126) { + var _name = node.name; + if (!_name || _name.kind !== 126) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -18688,9 +18774,9 @@ var ts; node.kind === 196 || node.kind === 199) { if (node.name) { - var name = node.name; - scopeName = name.kind === 126 - ? ts.getTextOfNode(name) + var _name = node.name; + scopeName = _name.kind === 126 + ? ts.getTextOfNode(_name) : node.name.text; } recordScopeNameStart(scopeName); @@ -18805,14 +18891,18 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, forLoopVariable) { - var name = forLoopVariable ? "_i" : undefined; - while (true) { - if (name && !isExistingName(location, name)) { - break; + function createTempVariable(location, preferredName) { + for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { + var char = 97 + tempCount; + if (char === 105 || char === 110) { + continue; + } + if (tempCount < 26) { + name = "_" + String.fromCharCode(char); + } + else { + name = "_" + (tempCount - 26); } - name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); - tempCount++; } recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); @@ -18825,8 +18915,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location) { - var temp = createTempVariable(location, false); + function createAndRecordTempVariable(location, preferredName) { + var temp = createTempVariable(location, preferredName); recordTempDeclaration(temp); return temp; } @@ -19056,7 +19146,7 @@ var ts; emitLiteral(node.head); headEmitted = true; } - for (var i = 0; i < node.templateSpans.length; i++) { + for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; var needsParens = templateSpan.expression.kind !== 159 && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; @@ -19133,8 +19223,8 @@ var ts; } } function isNotExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 128: case 193: case 150: @@ -19154,7 +19244,7 @@ var ts; case 199: case 200: case 203: - return parent.name === node; + return _parent.name === node; case 185: case 184: case 209: @@ -19261,8 +19351,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var length = elements.length; - while (pos < length) { + var _length = elements.length; + while (pos < _length) { if (group === 1) { write(".concat("); } @@ -19277,14 +19367,14 @@ var ts; } else { var i = pos; - while (i < length && elements[i].kind !== 171) { + while (i < _length && elements[i].kind !== 171) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); if (multiLine) { decreaseIndent(); } @@ -19360,8 +19450,8 @@ var ts; var propertyDescriptor = ts.createSynthesizedNode(152); var descriptorProperties = []; if (getAccessor) { - var getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(_getProperty); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); @@ -19474,7 +19564,6 @@ var ts; } } write("{"); - var properties = node.properties; if (properties.length) { emitLinePreservingList(node, properties, languageVersion >= 1, true); } @@ -19919,8 +20008,9 @@ var ts; write(" "); endPos = emitToken(16, endPos); var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, true); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + var counter = createTempVariable(node, "_i"); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); + var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -19934,12 +20024,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } + if (cachedLength) { + write(", "); + emitNodeWithoutSourceMap(cachedLength); + write(" = "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); + if (cachedLength) { + emitNodeWithoutSourceMap(cachedLength); + } + else { + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -19967,7 +20069,7 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node, false)); + emitNodeWithoutSourceMap(createTempVariable(node)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -20135,7 +20237,7 @@ var ts; } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; + var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } @@ -20160,7 +20262,7 @@ var ts; function ensureIdentifier(expr) { if (expr.kind !== 64) { var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!isDeclaration) { + if (!_isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -20215,8 +20317,8 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); @@ -20261,18 +20363,18 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var value = root.right; + var _value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, _value); } else { if (root.parent.kind !== 159) { write("("); } - value = ensureIdentifier(value); - emitDestructuringAssignment(target, value); + _value = ensureIdentifier(_value); + emitDestructuringAssignment(target, _value); write(", "); - emit(value); + emit(_value); if (root.parent.kind !== 159) { write(")"); } @@ -20343,12 +20445,12 @@ var ts; } } function emitExportVariableAssignments(node) { - var name = node.name; - if (name.kind === 64) { - emitExportMemberAssignments(name); + var _name = node.name; + if (_name.kind === 64) { + emitExportMemberAssignments(_name); } - else if (ts.isBindingPattern(name)) { - ts.forEach(name.elements, emitExportVariableAssignments); + else if (ts.isBindingPattern(_name)) { + ts.forEach(_name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { @@ -20373,10 +20475,10 @@ var ts; return; } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 221 + var _parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(parent, node.text); + var generatedName = generateUniqueNameForLocation(_parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { generatedBlockScopeNames = []; @@ -20396,12 +20498,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name = createTempVariable(node); + var _name = createTempVariable(node); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name); - emit(name); + tempParameters.push(_name); + emit(_name); } else { emit(node.name); @@ -20448,7 +20550,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, true).text; + var tempName = createTempVariable(node, "_i").text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -20647,9 +20749,10 @@ var ts; decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var i = 0, n = body.statements.length; i < n; i++) { + for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { + var statement = _a[_i]; write(" "); - emit(body.statements[i]); + emit(statement); } emitTempDeclarations(false); write(" "); @@ -20887,11 +20990,12 @@ var ts; emitDetachedComments(ctor.body.statements); } emitCaptureThisForNodeIfNecessary(node); + var superCall; if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); if (baseTypeNode) { - var superCall = findInitialSuperCall(ctor); + superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); emit(superCall); @@ -21239,8 +21343,8 @@ var ts; if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; } - var name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); + var _name = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); }); } else if (node.kind === 209) { @@ -21263,8 +21367,8 @@ var ts; } function getExternalImportInfo(node) { if (externalImports) { - for (var i = 0; i < externalImports.length; i++) { - var info = externalImports[i]; + for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { + var info = externalImports[_i]; if (info.rootNode === node) { return info; } @@ -21425,12 +21529,12 @@ var ts; if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = shouldEmitLeadingAndTrailingComments(node); - if (emitComments) { + var _emitComments = shouldEmitLeadingAndTrailingComments(node); + if (_emitComments) { emitLeadingComments(node); } emitJavaScriptWorker(node); - if (emitComments) { + if (_emitComments) { emitTrailingComments(node); } } @@ -21750,9 +21854,10 @@ var ts; } var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { + var text; try { var start = new Date().getTime(); - var text = ts.sys.readFile(fileName, options.charset); + text = ts.sys.readFile(fileName, options.charset); ts.ioReadTime += new Date().getTime() - start; } catch (e) { @@ -21943,9 +22048,11 @@ var ts; processSourceFile(ts.normalizePath(fileName), isDefaultLib); } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { + var start; + var _length; if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; + start = refPos; + _length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -21970,7 +22077,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -22011,17 +22118,17 @@ var ts; files.push(file); } } + return file; } - return file; function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; + var _file = filesByName[canonicalName]; + if (_file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return file; + return _file; } } function processReferencedFiles(file, basePath) { @@ -22059,10 +22166,10 @@ var ts; var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); + findModuleSourceFile(_searchName + ".d.ts", nameLiteral); } } } @@ -22279,6 +22386,12 @@ var ts; description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, experimental: true }, + { + name: "cacheDownlevelForOfLength", + type: "boolean", + description: "Cache length access when downlevel emitting for-of statements", + experimental: true + }, { name: "target", shortName: "t", diff --git a/bin/tsserver.js b/bin/tsserver.js index 65a06ca9928..44075b1f778 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -44,8 +44,9 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (v === value) { return true; } } @@ -67,8 +68,9 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (predicate(v)) { count++; } } @@ -77,12 +79,13 @@ var ts; } ts.countWhere = countWhere; function filter(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (f(_item)) { + result.push(_item); } } } @@ -90,10 +93,12 @@ var ts; } ts.filter = filter; function map(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result.push(f(v)); } } return result; @@ -108,12 +113,14 @@ var ts; } ts.concatenate = concatenate; function deduplicate(array) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (!contains(result, _item)) { + result.push(_item); + } } } return result; @@ -121,15 +128,17 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result += v[prop]; } return result; } ts.sum = sum; function addRange(to, from) { - for (var i = 0, n = from.length; i < n; i++) { - to.push(from[i]); + for (var _i = 0, _n = from.length; _i < _n; _i++) { + var v = from[_i]; + to.push(v); } } ts.addRange = addRange; @@ -190,9 +199,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var id in second) { - if (!hasProperty(result, id)) { - result[id] = second[id]; + for (var _id in second) { + if (!hasProperty(result, _id)) { + result[_id] = second[_id]; } } return result; @@ -244,13 +253,13 @@ 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) { @@ -321,7 +330,12 @@ 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) { @@ -348,9 +362,7 @@ 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]; @@ -391,8 +403,8 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; + for (var _i = 0, _n = parts.length; _i < _n; _i++) { + var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { normalized.pop(); @@ -407,7 +419,7 @@ var ts; return normalized; } function normalizePath(path) { - var path = normalizeSlashes(path); + path = normalizeSlashes(path); var rootLength = getRootLength(path); var normalized = getNormalizedParts(path, rootLength); return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); @@ -427,12 +439,10 @@ 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); + path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { path = combinePaths(normalizeSlashes(currentDirectory), path); @@ -463,9 +473,7 @@ var ts; } } if (rootLength === urlLength) { - return [ - url - ]; + return [url]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -473,9 +481,7 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [ - url + ts.directorySeparator - ]; + return [url + ts.directorySeparator]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -537,14 +543,10 @@ 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]; + for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); } @@ -595,15 +597,9 @@ 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) { @@ -701,15 +697,16 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var i = 0; i < files.length; i++) { - var name = files[i]; - if (!extension || ts.fileExtensionIs(name, extension)) { - result.push(ts.combinePaths(path, name)); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var _name = files[_i]; + if (!extension || ts.fileExtensionIs(_name, extension)) { + result.push(ts.combinePaths(path, _name)); } } var subfolders = getNames(folder.subfolders); - for (var i = 0; i < subfolders.length; i++) { - visitDirectory(ts.combinePaths(path, subfolders[i])); + for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + var current = subfolders[_a]; + visitDirectory(ts.combinePaths(path, current)); } } } @@ -794,8 +791,9 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var i = 0; i < files.length; i++) { - var name = ts.combinePaths(path, files[i]); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var current = files[_i]; + var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); if (stat.isFile()) { if (!extension || ts.fileExtensionIs(name, extension)) { @@ -806,8 +804,9 @@ var ts; directories.push(name); } } - for (var i = 0; i < directories.length; i++) { - visitDirectory(directories[i]); + for (var _a = 0, _b = directories.length; _a < _b; _a++) { + var _current = directories[_a]; + visitDirectory(_current); } } } @@ -821,14 +820,9 @@ 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) { @@ -884,2431 +878,491 @@ var 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." - } + 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; @@ -3425,2806 +1479,10 @@ 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; @@ -6248,17 +1506,21 @@ 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 = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; + for (var _name in source) { + if (source.hasOwnProperty(_name)) { + result[source[_name]] = _name; } } return result; @@ -6325,7 +1587,9 @@ 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) { @@ -6412,7 +1676,8 @@ var ts; return false; } } - return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || + text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -6431,8 +1696,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 62 && isConflictMarkerTrivia(text, pos)) { + var _ch = text.charCodeAt(pos); + if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -6492,11 +1757,7 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ - pos: startPos, - end: pos, - hasTrailingNewLine: hasTrailingNewLine - }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; } @@ -6523,11 +1784,15 @@ 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) { @@ -6546,10 +1811,14 @@ 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; @@ -6826,8 +2095,8 @@ var ts; return result; } function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { + var _len = tokenValue.length; + if (_len >= 2 && _len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; @@ -6979,13 +2248,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 && text.charCodeAt(pos + 1) === 47) { + var _ch = text.charCodeAt(pos); + if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(ch)) { + if (isLineBreak(_ch)) { precedingLineBreak = true; } pos++; @@ -7018,22 +2287,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var value = scanBinaryOrOctalDigits(2); - if (value < 0) { + var _value = scanBinaryOrOctalDigits(2); + if (_value < 0) { error(ts.Diagnostics.Binary_digit_expected); - value = 0; + _value = 0; } - tokenValue = "" + value; + tokenValue = "" + _value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var value = scanBinaryOrOctalDigits(8); - if (value < 0) { + var _value_1 = scanBinaryOrOctalDigits(8); + if (_value_1 < 0) { error(ts.Diagnostics.Octal_digit_expected); - value = 0; + _value_1 = 0; } - tokenValue = "" + value; + tokenValue = "" + _value_1; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -7132,10 +2401,10 @@ var ts; case 126: return pos++, token = 47; case 92: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); @@ -7272,39 +2541,17 @@ 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, @@ -7461,14 +2708,16 @@ var ts; description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, experimental: true }, + { + name: "cacheDownlevelForOfLength", + type: "boolean", + description: "Cache length access when downlevel emitting for-of statements", + 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 @@ -7648,9 +2897,7 @@ 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 { @@ -7671,8 +2918,8 @@ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; } @@ -7684,13 +2931,9 @@ 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, @@ -7698,18 +2941,11 @@ 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(); @@ -7731,7 +2967,8 @@ 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; } @@ -7810,7 +3047,8 @@ 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) { @@ -7838,7 +3076,10 @@ var ts; } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; + return declaration && + declaration.kind === 193 && + declaration.parent && + declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -7890,7 +3131,9 @@ 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; @@ -7953,7 +3196,9 @@ 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; @@ -8156,8 +3401,8 @@ var ts; } case 7: case 8: - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -8165,7 +3410,7 @@ var ts; case 220: case 218: case 150: - return parent.initializer === node; + return _parent.initializer === node; case 177: case 178: case 179: @@ -8176,22 +3421,25 @@ var ts; case 214: case 190: case 188: - return parent.expression === node; + return _parent.expression === node; case 181: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; + var forStatement = _parent; + 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; + var forInStatement = _parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + forInStatement.expression === node; case 158: - return node === parent.expression; + return node === _parent.expression; case 173: - return node === parent.expression; + return node === _parent.expression; case 126: - return node === parent.expression; + return node === _parent.expression; default: - if (isExpression(parent)) { + if (isExpression(_parent)) { return true; } } @@ -8201,7 +3449,8 @@ 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) { @@ -8349,14 +3598,14 @@ var ts; if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { return false; } - var parent = name.parent; - if (parent.kind === 208 || parent.kind === 212) { - if (parent.propertyName) { + var _parent = name.parent; + if (_parent.kind === 208 || _parent.kind === 212) { + if (_parent.propertyName) { return true; } } - if (isDeclaration(parent)) { - return parent.name === name; + if (isDeclaration(_parent)) { + return _parent.name === name; } return false; } @@ -8378,9 +3627,10 @@ var ts; ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - if (clauses[i].token === kind) { - return clauses[i]; + for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + var clause = clauses[_i]; + if (clause.token === kind) { + return clause; } } } @@ -8448,7 +3698,9 @@ 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) { @@ -8552,10 +3804,7 @@ 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) { @@ -8574,10 +3823,7 @@ 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); @@ -8625,7 +3871,7 @@ var ts; ts.createSynthesizedNode = createSynthesizedNode; function generateUniqueName(baseName, isExistingName) { if (baseName.charCodeAt(0) !== 95) { - var baseName = "_" + baseName; + baseName = "_" + baseName; if (!isExistingName(baseName)) { return baseName; } @@ -8635,9 +3881,9 @@ var ts; } var i = 1; while (true) { - var name = baseName + i; - if (!isExistingName(name)) { - return name; + var _name = baseName + i; + if (!isExistingName(_name)) { + return _name; } i++; } @@ -8738,9 +3984,9 @@ 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 = {})); @@ -8768,8 +4014,9 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var i = 0, len = nodes.length; i < len; i++) { - var result = cbNode(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + var result = cbNode(node); if (result) { return result; } @@ -8784,9 +4031,12 @@ 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: @@ -8794,13 +4044,22 @@ var ts; 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: @@ -8809,9 +4068,17 @@ 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: @@ -8832,16 +4099,23 @@ 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: @@ -8853,91 +4127,142 @@ 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 221: - return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); + 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) || visitNode(cbNode, node.caseBlock); + 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); + 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); + return visitNode(cbNode, node.tryBlock) || + visitNode(cbNode, node.catchClause) || + visitNode(cbNode, node.finallyBlock); case 217: - return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); + 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); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); case 220: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.body); case 203: - 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.moduleReference); case 204: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.importClause) || + visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.namedBindings); case 206: return visitNode(cbNode, node.name); case 207: case 211: return visitNodes(cbNodes, node.elements); case 210: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.exportClause) || + visitNode(cbNode, node.moduleSpecifier); case 208: case 212: - return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + return visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name); case 209: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: @@ -8953,84 +4278,55 @@ var ts; 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; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var parent = sourceFile; + var _parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== parent) { - n.parent = parent; - var saveParent = parent; - parent = n; + if (n.parent !== _parent) { + n.parent = _parent; + var saveParent = _parent; + _parent = n; forEachChild(n, visitNode); - parent = saveParent; + _parent = saveParent; } } } @@ -9068,8 +4364,9 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } } } @@ -9131,8 +4428,9 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } return; } @@ -9246,7 +4544,8 @@ 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) { @@ -9424,8 +4723,8 @@ var ts; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - parseErrorAtPosition(start, length, message, arg0); + var _length = scanner.getTextPos() - start; + parseErrorAtPosition(start, _length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -9464,7 +4763,9 @@ 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; @@ -9515,7 +4816,8 @@ 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); @@ -9592,7 +4894,9 @@ 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) { @@ -9645,7 +4949,10 @@ 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(); @@ -9703,7 +5010,8 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || token === 78) { + if (token === 102 || + token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -10084,7 +5392,9 @@ 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; @@ -10123,7 +5433,9 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 ? parseLiteralNode(true) : parseType(); + return token === 8 + ? parseLiteralNode(true) + : parseType(); } return undefined; } @@ -10238,11 +5550,11 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { var method = createNode(131, fullStart); - method.name = name; + method.name = _name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); @@ -10250,7 +5562,7 @@ var ts; } else { var property = createNode(129, fullStart); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -10281,7 +5593,11 @@ 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) { @@ -10289,7 +5605,9 @@ 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); @@ -10311,7 +5629,9 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; + return isIndexSignature() + ? parseIndexSignatureDeclaration(modifiers) + : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -10417,9 +5737,7 @@ 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()); @@ -10444,7 +5762,9 @@ 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) { @@ -10569,10 +5889,16 @@ var ts; nextToken(); return !scanner.hasPrecedingLineBreak() && isIdentifier(); } + function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && + (isIdentifier() || token === 14 || token === 18); + } 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); @@ -10587,9 +5913,7 @@ 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); @@ -10601,7 +5925,9 @@ 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; } @@ -10823,7 +6149,9 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); + var expression = token === 90 + ? parseSuperExpression() + : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -10877,7 +6205,9 @@ 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; } @@ -10900,10 +6230,10 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(155, expression.pos); - callExpr.expression = expression; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); + var _callExpr = createNode(155, expression.pos); + _callExpr.expression = expression; + _callExpr.arguments = parseArgumentList(); + expression = finishNode(_callExpr); continue; } return expression; @@ -10923,7 +6253,9 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() + ? typeArguments + : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -10998,7 +6330,9 @@ 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); @@ -11553,15 +6887,15 @@ var ts; } function parsePropertyOrMethodDeclaration(fullStart, modifiers) { var asteriskToken = parseOptionalToken(35); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); } else { var property = createNode(130, fullStart); setModifiers(property, modifiers); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); property.initializer = allowInAnd(parseNonParameterInitializer); @@ -11648,7 +6982,11 @@ 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."); @@ -11661,7 +6999,9 @@ 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 { @@ -11671,7 +7011,9 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseHeritageClausesWorker) + : parseHeritageClausesWorker(); } return undefined; } @@ -11750,7 +7092,9 @@ 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) { @@ -11762,17 +7106,21 @@ 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); @@ -11792,7 +7140,9 @@ var ts; } 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); } @@ -11805,13 +7155,16 @@ var ts; if (identifier) { importClause.name = identifier; } - if (!importClause.name || parseOptional(23)) { + 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(213); @@ -11899,7 +7252,7 @@ var ts; return finishNode(node); } function isLetDeclaration() { - return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOnSameLine); + return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart() { switch (token) { @@ -11941,11 +7294,13 @@ 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(); @@ -11999,7 +7354,9 @@ 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); @@ -12014,10 +7371,7 @@ 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) { @@ -12048,10 +7402,7 @@ 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); } } @@ -12063,7 +7414,13 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; + return node.flags & 1 + || node.kind === 203 && node.moduleReference.kind === 213 + || node.kind === 204 + || node.kind === 209 + || node.kind === 210 + ? node + : undefined; }); } } @@ -12145,7 +7502,7 @@ var ts; } ts.bindSourceFile = bindSourceFile; function bindSourceFileWorker(file) { - var parent; + var _parent; var container; var blockScopeContainer; var lastContainer; @@ -12218,19 +7575,22 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (_name !== undefined) { + symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); if (symbol.flags & excludes) { 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))); }); file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, name); + symbol = createSymbol(0, _name); } } else { @@ -12271,7 +7631,9 @@ 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; @@ -12285,10 +7647,10 @@ var ts; if (symbolKind & 255504) { node.locals = {}; } - var saveParent = parent; + var saveParent = _parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; - parent = node; + _parent = node; if (symbolKind & 262128) { container = node; if (lastContainer) { @@ -12301,7 +7663,7 @@ var ts; } ts.forEachChild(node, bind); container = saveContainer; - parent = saveParent; + _parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -12404,7 +7766,7 @@ var ts; return "__" + ts.indexOf(node.parent.parameters, node); } function bind(node) { - node.parent = parent; + node.parent = _parent; switch (node.kind) { case 127: bindDeclaration(node, 262144, 530912, false); @@ -12538,10 +7900,10 @@ var ts; bindChildren(node, 0, true); break; default: - var saveParent = parent; - parent = node; + var saveParent = _parent; + _parent = node; ts.forEachChild(node, bind); - parent = saveParent; + _parent = saveParent; } } function bindParameter(node) { @@ -12551,7 +7913,9 @@ 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); } @@ -12582,25 +7946,15 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); + var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); 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, @@ -12630,8 +7984,6 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfExternalModule: getExportsOfExternalModule }; - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); var anyType = createIntrinsicType(1, "any"); @@ -12696,7 +8048,9 @@ 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) { @@ -12782,7 +8136,8 @@ 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)); }); @@ -12969,18 +8324,18 @@ var ts; } 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; - }); + 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) { + 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) { + else if (variableDeclaration.parent.parent.kind === 183 || + variableDeclaration.parent.parent.kind === 182) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -13001,12 +8356,15 @@ var ts; return false; } function isAliasSymbolDeclaration(node) { - return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; + 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 === 213) { @@ -13032,11 +8390,11 @@ var ts; function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol) { - var name = specifier.propertyName || specifier.name; - if (name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), name.text, 107455 | 793056 | 1536); + var _name = specifier.propertyName || specifier.name; + if (_name.text) { + var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); return; } return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); @@ -13047,7 +8405,9 @@ 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); @@ -13133,8 +8493,9 @@ var ts; if (ts.getFullWidth(name) === 0) { return undefined; } + var symbol; if (name.kind === 64) { - var symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } @@ -13145,7 +8506,7 @@ var ts; return undefined; } var right = name.right; - var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); + symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; @@ -13173,14 +8534,17 @@ var ts; return symbol; } } + var sourceFile; while (true) { var fileName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); - if (sourceFile || isRelative) + sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); + if (sourceFile || isRelative) { break; + } var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) + if (parentPath === searchPath) { break; + } searchPath = parentPath; } if (sourceFile) { @@ -13262,7 +8626,9 @@ 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) { @@ -13278,8 +8644,8 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; + for (var _i = 0, _n = members.length; _i < _n; _i++) { + var member = members[_i]; if (member.kind === 133 && ts.nodeIsPresent(member.body)) { return member; } @@ -13301,7 +8667,10 @@ 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; @@ -13335,25 +8704,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { + for (var _location = enclosingDeclaration; _location; _location = _location.parent) { + if (_location.locals && !isGlobalSourceFile(_location)) { + if (result = callback(_location.locals)) { return result; } } - switch (location.kind) { + switch (_location.kind) { case 221: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalModule(_location)) { break; } case 200: - if (result = callback(getSymbolOfNode(location).exports)) { + if (result = callback(getSymbolOfNode(_location).exports)) { return result; } break; case 196: case 197: - if (result = callback(getSymbolOfNode(location).members)) { + if (result = callback(getSymbolOfNode(_location).members)) { return result; } break; @@ -13375,28 +8744,24 @@ 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); } } } @@ -13461,9 +8826,7 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { - accessibility: 0 - }; + return { accessibility: 0 }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -13473,22 +8836,20 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && 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 === 203 && !(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)) { @@ -13496,9 +8857,7 @@ var ts; } } else { - aliasesToMakeVisible = [ - declaration - ]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -13512,7 +8871,8 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || entityName.parent.kind === 203) { + else if (entityName.kind === 125 || + entityName.parent.kind === 203) { meaning = 1536; } else { @@ -13598,12 +8958,14 @@ 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) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + var accessibleSymbol = accessibleSymbolChain[_i]; + appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } } else { @@ -13630,7 +8992,8 @@ 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); @@ -13723,14 +9086,16 @@ 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 === 221 || 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)); } } } @@ -13782,15 +9147,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + var signature = _a[_i]; + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.constructSignatures.length; i++) { + for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { + var _signature = _c[_b]; writeKeyword(writer, 87); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -13820,17 +9187,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; + for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { + var p = _f[_e]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var j = 0; j < signatures.length; j++) { + for (var _h = 0, _j = signatures.length; _h < _j; _h++) { + var _signature_1 = signatures[_h]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -13968,10 +9336,11 @@ var ts; } function isUsedInExportAssignment(node) { var externalModule = getContainingExternalModule(node); + var exportAssignmentSymbol; + var resolvedExportSymbol; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; + exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; @@ -14011,11 +9380,12 @@ var ts; case 195: case 199: case 203: - var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); + var _parent = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { + return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(parent); + return isDeclarationVisible(_parent); case 130: case 129: case 134: @@ -14067,9 +9437,7 @@ 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); @@ -14087,11 +9455,14 @@ var ts; } return parentType; } + var type; 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 _name = declaration.propertyName || declaration.name; + 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)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); return unknownType; } } @@ -14102,7 +9473,7 @@ var ts; } if (!declaration.dotDotDotToken) { var propName = "" + ts.indexOf(pattern.elements, declaration); - var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { 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); @@ -14114,7 +9485,7 @@ var ts; } } else { - var type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(getIndexTypeOfType(parentType, 1)); } } return type; @@ -14166,8 +9537,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + var _name = e.propertyName || e.name; + var symbol = createSymbol(flags, _name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -14185,7 +9556,9 @@ 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); @@ -14229,7 +9602,9 @@ 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)); } } @@ -14290,8 +9665,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 134); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + var _getter = ts.getDeclarationOfKind(symbol, 134); + error(_getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } } @@ -14363,9 +9738,7 @@ 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); @@ -14470,8 +9843,8 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var _declaration = ts.getDeclarationOfKind(symbol, 198); + error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -14527,23 +9900,23 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = symbol; } return result; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; + for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; } @@ -14551,8 +9924,9 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); + for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + var signature = baseSignatures[_i]; + signatures.push(signature); } } } @@ -14611,15 +9985,14 @@ 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 = {}; @@ -14648,17 +10021,16 @@ 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) { + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; + if (signature.typeParameters) { return emptyArray; } } - for (var i = 1; i < signatureLists.length; i++) { - if (!signatureListsIdentical(signatures, signatureLists[i])) { + for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { return emptyArray; } } @@ -14666,16 +10038,15 @@ 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; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var i = 0; i < types.length; i++) { - var indexType = getIndexTypeOfType(types[i], kind); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + var indexType = getIndexTypeOfType(type, kind); if (!indexType) { return undefined; } @@ -14692,17 +10063,22 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; + var members; + var callSignatures; + var constructSignatures; + var stringIndexType; + var numberIndexType; if (symbol.flags & 2048) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + members = symbol.members; + callSignatures = getSignaturesOfSymbol(members["__call"]); + constructSignatures = getSignaturesOfSymbol(members["__new"]); + stringIndexType = getIndexTypeOfSymbol(symbol, 0); + numberIndexType = getIndexTypeOfSymbol(symbol, 1); } else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; + members = emptySymbols; + callSignatures = emptyArray; + constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } @@ -14720,8 +10096,8 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + stringIndexType = undefined; + numberIndexType = (symbol.flags & 384) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -14804,17 +10180,16 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var i = 0; i < types.length; i++) { - var type = getApparentType(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (!prop) { return undefined; } if (!props) { - props = [ - prop - ]; + props = [prop]; } else { props.push(prop); @@ -14823,12 +10198,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop.declarations) { - declarations.push.apply(declarations, prop.declarations); + for (var _a = 0, _b = props.length; _a < _b; _a++) { + var _prop = props[_a]; + if (_prop.declarations) { + declarations.push.apply(declarations, _prop.declarations); } - propTypes.push(getTypeOfSymbol(prop)); + propTypes.push(getTypeOfSymbol(_prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -14865,9 +10240,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; + var _symbol = getPropertyOfObjectType(globalFunctionType, name); + if (_symbol) + return _symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -14904,17 +10279,18 @@ var ts; if (!node.moduleSpecifier) { return emptyArray; } - var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module || !module.exports) { + var _module = resolveExternalModuleName(node, node.moduleSpecifier); + if (!_module || !_module.exports) { return emptyArray; } - return ts.mapToArray(getExportsOfModule(module)); + return ts.mapToArray(getExportsOfModule(_module)); } function getSignatureFromDeclaration(declaration) { 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; @@ -14987,14 +10363,15 @@ var ts; function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { signature.resolvedReturnType = resolvingType; + var type; if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -15045,12 +10422,8 @@ 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; @@ -15063,8 +10436,9 @@ var ts; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var node = decl; if (node.parameters.length === 1) { var parameter = node.parameters[0]; if (parameter && parameter.type && parameter.type.kind === syntaxKind) { @@ -15077,7 +10451,9 @@ 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) { @@ -15100,8 +10476,9 @@ var ts; default: var result = ""; for (var i = 0; i < types.length; i++) { - if (i > 0) + if (i > 0) { result += ","; + } result += types[i].id; } return result; @@ -15109,8 +10486,9 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var i = 0; i < types.length; i++) { - result |= types[i].flags; + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + result |= type.flags; } return result & 786432; } @@ -15131,9 +10509,7 @@ 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; @@ -15147,9 +10523,7 @@ 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) { @@ -15167,8 +10541,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = resolveEntityName(node.typeName, 793056); + var type; if (symbol) { - var type; if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } @@ -15206,8 +10580,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; switch (declaration.kind) { case 196: case 197: @@ -15248,9 +10622,7 @@ 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); @@ -15291,13 +10663,15 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var i = 0, len = types.length; i < len; i++) { - addTypeToSortedSet(sortedTypes, types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -15313,8 +10687,9 @@ var ts; } } function containsAnyType(types) { - for (var i = 0; i < types.length; i++) { - if (types[i].flags & 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (type.flags & 1) { return true; } } @@ -15428,59 +10803,51 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); + for (var _i = 0, _n = items.length; _i < _n; _i++) { + var v = items[_i]; + result.push(instantiator(v, mapper)); } return result; } 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++) { - if (t === sources[i]) + if (t === sources[i]) { return targets[i]; + } } return t; }; } 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++) { - if (t === sources[i]) + for (var _i = 0, _n = sources.length; _i < _n; _i++) { + var source = sources[_i]; + if (t === source) { return anyType; + } } return t; }; @@ -15499,9 +10866,7 @@ 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); @@ -15516,8 +10881,9 @@ var ts; return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { + var freshTypeParameters; if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); } var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); @@ -15561,7 +10927,8 @@ 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)); @@ -15586,9 +10953,11 @@ 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)); + return node.operatorToken.kind === 49 && + (isContextSensitive(node.left) || isContextSensitive(node.right)); case 218: return isContextSensitive(node.initializer); case 132: @@ -15600,9 +10969,7 @@ 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) { @@ -15673,7 +11040,7 @@ var ts; } function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { if (elaborateErrors === void 0) { elaborateErrors = false; } - var result; + var _result; if (source === target) return -1; if (relation !== identityRelation) { @@ -15697,53 +11064,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (result = unionTypeRelatedToUnionType(source, target)) { - if (result &= unionTypeRelatedToUnionType(target, source)) { - return result; + if (_result = unionTypeRelatedToUnionType(source, target)) { + if (_result &= unionTypeRelatedToUnionType(target, source)) { + return _result; } } } else if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = unionTypeRelatedToType(target, source, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(target, source, reportErrors)) { + return _result; } } } else { if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = typeRelatedToUnionType(source, target, reportErrors)) { - return result; + if (_result = typeRelatedToUnionType(source, target, reportErrors)) { + return _result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (result = typeParameterRelatedTo(source, target, reportErrors)) { - return result; + if (_result = typeParameterRelatedTo(source, target, reportErrors)) { + return _result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return result; + if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return _result; } } 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; + return _result; } } if (reportErrors) { @@ -15759,16 +11127,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = typeRelatedToUnionType(sourceTypes[i], target, false); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -15781,27 +11150,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = isRelatedTo(sourceTypes[i], target, reportErrors); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var _result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -15867,19 +11237,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; + var _result; if (expandingFlags === 3) { - var result = 1; + _result = 1; } else { - var result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (result) { - result &= numberIndexTypesRelatedTo(source, target, reportErrors); + _result = propertiesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (_result) { + _result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -15887,23 +11258,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result) { + if (_result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return result; + return _result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) { + if (t.flags & 4096 && t.target === _target) { count++; if (count >= 10) return true; @@ -15916,11 +11287,11 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var _result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { @@ -15971,7 +11342,7 @@ var ts; } return 0; } - result &= related; + _result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -15981,7 +11352,7 @@ var ts; } } } - return result; + return _result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -15989,9 +11360,9 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var result = -1; - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; + var _result = -1; + for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -16000,9 +11371,9 @@ var ts; if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -16013,18 +11384,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var _result = -1; var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; + outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; + for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - result &= related; + _result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -16034,7 +11405,7 @@ var ts; return 0; } } - return result; + return _result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -16064,14 +11435,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var _result = -1; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); + var related = isRelatedTo(_s, _t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(_t, _s, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -16080,13 +11451,13 @@ var ts; } errorInfo = saveErrorInfo; } - result &= related; + _result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return result; + return _result; var s = getReturnTypeOfSignature(source); - return result & isRelatedTo(s, t, reportErrors); + return _result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -16094,15 +11465,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var result = -1; + var _result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -16142,11 +11513,12 @@ var ts; } return 0; } + var related; if (sourceStringType && sourceNumberType) { - var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } if (!related) { if (reportErrors) { @@ -16198,7 +11570,9 @@ 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; @@ -16219,14 +11593,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - var related = compareTypes(s, t); - if (!related) { + for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { + var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); + var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); + var _related = compareTypes(s, t); + if (!_related) { return 0; } - result &= related; + result &= _related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -16234,16 +11608,15 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; } 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; @@ -16340,29 +11713,32 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var errorReported = false; + var _errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - errorReported = true; + _errorReported = true; } }); - return errorReported; + return _errorReported; } return false; } function reportImplicitAnyError(declaration, type) { var typeAsString = typeToString(getWidenedType(type)); + var diagnostic; switch (declaration.kind) { case 130: case 129: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; + 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; + 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: @@ -16375,10 +11751,10 @@ var ts; error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } - var diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; + diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } @@ -16417,11 +11793,9 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ - primary: undefined, - secondary: undefined - }); + for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + var unused = typeParameters[_i]; + inferences.push({ primary: undefined, secondary: undefined }); } return { typeParameters: typeParameters, @@ -16439,19 +11813,21 @@ var ts; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) + if (source === sourceStack[i] && target === targetStack[i]) { return true; + } } return false; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) + if (t.flags & 4096 && t.target === _target) { count++; + } } return count < 5; } @@ -16466,7 +11842,9 @@ 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; @@ -16476,16 +11854,16 @@ var ts; else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); + for (var _i = 0; _i < sourceTypes.length; _i++) { + inferFromTypes(sourceTypes[_i], targetTypes[_i]); } } else if (target.flags & 16384) { - var targetTypes = target.types; + var _targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var i = 0; i < targetTypes.length; i++) { - var t = targetTypes[i]; + for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { + var t = _targetTypes[_a]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -16501,12 +11879,14 @@ var ts; } } else if (source.flags & 16384) { - var sourceTypes = source.types; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], target); + var _sourceTypes = source.types; + for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { + var sourceType = _sourceTypes[_b]; + inferFromTypes(sourceType, 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 = []; @@ -16527,8 +11907,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -16616,12 +11996,8 @@ var ts; 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 (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; } @@ -16714,14 +12090,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)) { - containerNodes.unshift(parent); + for (var _parent = node.parent; _parent; _parent = _parent.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); @@ -16850,9 +12225,7 @@ 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; } @@ -16908,7 +12281,9 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { + if (languageVersion >= 2 || + (symbol.flags & 2) === 0 || + symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -17004,21 +12379,33 @@ var ts; var container = ts.getSuperContainer(node, true); if (container) { var canUseSuperExpression = false; + var needToCaptureLexicalThis; if (isCallExpression) { canUseSuperExpression = container.kind === 133; } else { - var needToCaptureLexicalThis = false; + needToCaptureLexicalThis = false; while (container && container.kind === 161) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } 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; } } } @@ -17065,7 +12452,8 @@ 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]); } } @@ -17143,17 +12531,15 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var i = 0; i < types.length; i++) { - var t = mapper(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var t = mapper(current); if (t) { if (!mappedType) { mappedType = t; } else if (!mappedTypes) { - mappedTypes = [ - mappedType, - t - ]; + mappedTypes = [mappedType, t]; } else { mappedTypes.push(t); @@ -17169,17 +12555,13 @@ 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)); @@ -17199,7 +12581,8 @@ 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; } @@ -17208,7 +12591,9 @@ 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; } @@ -17223,8 +12608,8 @@ var ts; if (node.contextualType) { return node.contextualType; } - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -17236,22 +12621,22 @@ var ts; return getContextualTypeForReturnExpression(node); case 155: case 156: - return getContextualTypeForArgument(parent, node); + return getContextualTypeForArgument(_parent, node); case 158: - return getTypeFromTypeNode(parent.type); + return getTypeFromTypeNode(_parent.type); case 167: return getContextualTypeForBinaryOperand(node); case 218: - return getContextualTypeForObjectLiteralElement(parent); + return getContextualTypeForObjectLiteralElement(_parent); case 151: return getContextualTypeForElementExpression(node); case 168: return getContextualTypeForConditionalOperand(node); case 173: - ts.Debug.assert(parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + ts.Debug.assert(_parent.parent.kind === 169); + return getContextualTypeForSubstitutionExpression(_parent.parent, node); case 159: - return getContextualType(parent); + return getContextualType(_parent); } return undefined; } @@ -17272,7 +12657,9 @@ 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; } @@ -17281,16 +12668,16 @@ var ts; } var signatureList; var types = type.types; - for (var i = 0; i < types.length; i++) { - if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (signatureList && + getSignaturesOfObjectOrUnionType(current, 0).length > 1) { return undefined; } - var signature = getNonGenericSignature(types[i]); + var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { - signatureList = [ - signature - ]; + signatureList = [signature]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -17312,15 +12699,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var parent = node.parent; - if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { + var _parent = node.parent; + if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { return true; } - if (parent.kind === 218) { - return isAssignmentTarget(parent.parent); + if (_parent.kind === 218) { + return isAssignmentTarget(_parent.parent); } - if (parent.kind === 151) { - return isAssignmentTarget(parent); + if (_parent.kind === 151) { + return isAssignmentTarget(_parent); } return false; } @@ -17385,19 +12772,24 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var i = 0; i < node.properties.length; i++) { - var memberDecl = node.properties[i]; + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218 || + memberDecl.kind === 219 || + ts.isObjectLiteralMethod(memberDecl)) { + var type = void 0; if (memberDecl.kind === 218) { - var type = checkPropertyAssignment(memberDecl, contextualMapper); + type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { - var type = checkObjectLiteralMethod(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { ts.Debug.assert(memberDecl.kind === 219); - var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); + type = memberDecl.name.kind === 126 + ? unknownType + : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -17430,15 +12822,15 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, type)) { - propTypes.push(type); + var _type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, _type)) { + propTypes.push(_type); } } } - var result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= result.flags; - return result; + var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= _result.flags; + return _result; } return undefined; } @@ -17513,7 +12905,9 @@ 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); @@ -17539,9 +12933,9 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - var start = node.end - "]".length; - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); + var _start = node.end - "]".length; + var _end = node.end; + grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -17550,20 +12944,21 @@ 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; } if (node.argumentExpression) { - var name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name !== undefined) { - var prop = getPropertyOfType(objectType, name); + var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (_name !== undefined) { + var prop = getPropertyOfType(objectType, _name); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); return unknownType; } } @@ -17650,22 +13045,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; + var _parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { + if (lastParent && _parent === lastParent) { index++; } else { - lastParent = parent; + lastParent = _parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent; + lastParent = _parent; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -17717,7 +13112,8 @@ 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; } @@ -17734,7 +13130,8 @@ 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]; } } @@ -17755,30 +13152,31 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + var argType = void 0; if (i === 0 && args[i].parent.kind === 157) { - var argType = globalTemplateStringsArrayType; + argType = globalTemplateStringsArrayType; } else { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - var argType = checkExpressionWithContextualType(arg, paramType, mapper); + argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + for (var _i = 0; _i < args.length; _i++) { + if (excludeArgument[_i] === false) { + var _arg = args[_i]; + var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); + inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); } } } var inferredTypes = getInferredTypes(context); context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var i = 0; i < inferredTypes.length; i++) { - if (inferredTypes[i] === inferenceFailureType) { - inferredTypes[i] = unknownType; + for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { + if (inferredTypes[_i_1] === inferenceFailureType) { + inferredTypes[_i_1] = unknownType; } } return context; @@ -17804,7 +13202,9 @@ 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; } @@ -17816,9 +13216,7 @@ 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); @@ -17900,50 +13298,53 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (hasCorrectArity(node, args, candidates[i])) { - return candidates[i]; + for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + var candidate = candidates[_i]; + if (hasCorrectArity(node, args, candidate)) { + return candidate; } } } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var i = 0; i < candidates.length; i++) { - if (!hasCorrectArity(node, args, candidates[i])) { + for (var _a = 0, _b = candidates.length; _a < _b; _a++) { + var current = candidates[_a]; + if (!hasCorrectArity(node, args, current)) { continue; } - var originalCandidate = candidates[i]; - var inferenceResult; + var originalCandidate = current; + var inferenceResult = void 0; + var _candidate = void 0; + var typeArgumentsAreValid = void 0; while (true) { - var candidate = originalCandidate; - if (candidate.typeParameters) { - var typeArgumentTypes; - var typeArgumentsAreValid; + _candidate = originalCandidate; + if (_candidate.typeParameters) { + var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(_candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; typeArgumentTypes = inferenceResult.inferredTypes; } if (!typeArgumentsAreValid) { break; } - candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return candidate; + return _candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = candidate; + var instantiatedCandidate = _candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } @@ -17955,7 +13356,7 @@ var ts; } } else { - ts.Debug.assert(originalCandidate === candidate); + ts.Debug.assert(originalCandidate === _candidate); candidateForArgumentError = originalCandidate; } } @@ -18070,7 +13471,10 @@ 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); } @@ -18095,9 +13499,13 @@ 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); @@ -18107,9 +13515,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var _parameter = signature.parameters[signature.parameters.length - 1]; + var _links = getSymbolLinks(_parameter); + _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -18117,15 +13525,16 @@ var ts; if (!func.body) { return unknownType; } + var type; if (func.body.kind !== 174) { - var type = checkExpressionCached(func.body, contextualMapper); + type = checkExpressionCached(func.body, contextualMapper); } else { var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } - var type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); + type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; @@ -18245,12 +13654,14 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: + case 64: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; - case 153: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + } + case 153: { + var _symbol = findSymbol(n); + return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + } case 154: return true; case 159: @@ -18262,18 +13673,20 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 64: - case 153: + case 153: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; - case 154: + } + case 154: { var index = n.argumentExpression; - var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { - var name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + var _symbol = findSymbol(n.expression); + if (_symbol && index && index.kind === 8) { + var _name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; + } case 159: return isConstVariableReference(n.expression); default: @@ -18345,8 +13758,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (types[i].flags & kind) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (current.flags & kind) { return true; } } @@ -18360,8 +13774,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (!(types[i].flags & kind)) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (!(current.flags & kind)) { return false; } } @@ -18395,16 +13810,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; 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 _name = p.name; + 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); + checkDestructuringAssignment(p.initializer || _name, type); } else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); } } else { @@ -18424,7 +13842,9 @@ 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); } @@ -18505,7 +13925,9 @@ 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 { @@ -18567,10 +13989,7 @@ var ts; case 48: return rightType; case 49: - return getUnionType([ - leftType, - rightType - ]); + return getUnionType([leftType, rightType]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -18578,7 +13997,9 @@ 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; @@ -18624,10 +14045,7 @@ 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) { @@ -18691,7 +14109,9 @@ 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); } @@ -18801,7 +14221,9 @@ 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); @@ -18835,8 +14257,9 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { case 120: @@ -18894,10 +14317,8 @@ 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) { @@ -18909,13 +14330,14 @@ 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)) { @@ -19024,8 +14446,8 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; + for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; } @@ -19105,16 +14527,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; + var _errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { ts.Debug.assert(node.kind === 132 || node.kind === 131); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); + error(_errorNode, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -19130,8 +14552,9 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; if (inAmbientContextOrInterface) { @@ -19188,9 +14611,10 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + var signature = signatures[_a]; + if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } } @@ -19202,7 +14626,6 @@ var ts; if (!produceDiagnostics) { return; } - var symbol; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); @@ -19237,16 +14660,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 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; @@ -19255,7 +14678,10 @@ 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); @@ -19310,7 +14736,12 @@ 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)) { @@ -19331,8 +14762,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -19352,8 +14783,8 @@ var ts; return; } if (ts.getClassBaseTypeNode(enclosingClass)) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -19368,8 +14799,8 @@ var ts; if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { return; } - var parent = getDeclarationContainer(node); - if (parent.kind === 221 && ts.isExternalModule(parent)) { + var _parent = getDeclarationContainer(node); + 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)); } } @@ -19378,14 +14809,20 @@ 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 === 221); + 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); + 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); } } } @@ -19399,10 +14836,11 @@ var ts; return node.kind === 128; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind === 128) { - var func = ts.getContainingFunction(node); - visit(node.initializer); + if (getRootDeclaration(node).kind !== 128) { + return; } + var func = ts.getContainingFunction(node); + visit(node.initializer); function visit(n) { if (n.kind === 64) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; @@ -19598,15 +15036,17 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, 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; @@ -19670,7 +15110,9 @@ var ts; } 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; + 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; @@ -19680,10 +15122,7 @@ var ts; if (arrayElementType.flags & 258) { return stringType; } - return getUnionType([ - arrayElementType, - stringType - ]); + return getUnionType([arrayElementType, stringType]); } return arrayElementType; } @@ -19831,8 +15270,8 @@ var ts; }); if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { var classDeclaration = type.symbol.valueDeclaration; - for (var i = 0; i < classDeclaration.members.length; i++) { - var member = classDeclaration.members[i]; + for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); @@ -19845,9 +15284,7 @@ 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]; } } @@ -19861,22 +15298,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var errorNode; + var _errorNode; if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + _errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - errorNode = indexDeclaration; + _errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { - return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); - }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + 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; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + 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; + error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -19893,7 +15330,7 @@ var ts; } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { + for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { @@ -19965,8 +15402,9 @@ var ts; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); + for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + var baseProperty = baseProperties[_i]; + var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { continue; } @@ -19983,7 +15421,7 @@ var ts; if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { continue; } - var errorMessage; + var errorMessage = void 0; if (base.flags & 8192) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; @@ -20039,23 +15477,15 @@ 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]; + for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; + for (var _b = 0, _c = properties.length; _b < _c; _b++) { + var prop = properties[_b]; 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]; @@ -20108,8 +15538,8 @@ var ts; checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128)) { + var _nodeLinks = getNodeLinks(node); + if (!(_nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; @@ -20146,7 +15576,7 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + _nodeLinks.flags |= 128; } function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { return evalConstant(initializer); @@ -20158,12 +15588,9 @@ 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: @@ -20179,28 +15606,17 @@ 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: @@ -20215,32 +15631,33 @@ var ts; } var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var enumType; + var _enumType; var propertyName; if (e.kind === 64) { - enumType = currentType; + _enumType = currentType; propertyName = e.text; } 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); + _enumType = getTypeOfNode(e.expression); propertyName = e.argumentExpression.text; } else { - var enumType = getTypeOfNode(e.expression); + _enumType = getTypeOfNode(e.expression); propertyName = e.name.text; } - if (enumType !== currentType) { + if (_enumType !== currentType) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(enumType, propertyName); + var property = getPropertyOfObjectType(_enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -20300,8 +15717,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -20319,7 +15736,10 @@ 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)) { @@ -20355,7 +15775,9 @@ var ts; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; 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); + 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)) { @@ -20368,9 +15790,13 @@ 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 === 212 ? 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)); } } @@ -20468,18 +15894,19 @@ var ts; } function hasExportedMembers(moduleSymbol) { var declarations = moduleSymbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var statements = getModuleStatements(declarations[i]); - for (var j = 0; j < statements.length; j++) { - var node = statements[j]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var statements = getModuleStatements(current); + for (var _a = 0, _b = statements.length; _a < _b; _a++) { + var node = statements[_a]; if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; } var specifiers = exportClause.elements; - for (var k = 0; k < specifiers.length; k++) { - var specifier = specifiers[k]; + for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { + var specifier = specifiers[_c]; if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { return true; } @@ -20803,7 +16230,9 @@ 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) { @@ -20842,21 +16271,21 @@ var ts; } case 125: ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 142) { + var _parent = node.parent; + if (_parent.kind === 142) { return false; } - if (139 <= parent.kind && parent.kind <= 147) { + if (139 <= _parent.kind && _parent.kind <= 147) { return true; } - switch (parent.kind) { + switch (_parent.kind) { case 127: - return node === parent.constraint; + return node === _parent.constraint; case 130: case 129: case 128: case 193: - return node === parent.type; + return node === _parent.type; case 195: case 160: case 161: @@ -20865,16 +16294,16 @@ var ts; case 131: case 134: case 135: - return node === parent.type; + return node === _parent.type; case 136: case 137: case 138: - return node === parent.type; + return node === _parent.type; case 158: - return node === parent.type; + return node === _parent.type; case 155: case 156: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; case 157: return false; } @@ -20897,7 +16326,8 @@ 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)) { @@ -20930,17 +16360,17 @@ var ts; return getNodeLinks(entityName).resolvedSymbol; } else if (entityName.kind === 125) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { + var _symbol = getNodeLinks(entityName).resolvedSymbol; + if (!_symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 139 ? 793056 : 1536; - meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; + _meaning |= 8388608; + return resolveEntityName(entityName, _meaning); } return undefined; } @@ -20952,7 +16382,9 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 + ? getSymbolOfEntityNameOrPropertyAccessExpression(node) + : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -20971,7 +16403,10 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && 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: @@ -21009,21 +16444,21 @@ var ts; return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); + var _symbol = getSymbolInfo(node); + return _symbol && getDeclaredTypeOfSymbol(_symbol); } if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); + var _symbol_1 = getSymbolOfNode(node); + return getTypeOfSymbol(_symbol_1); } if (ts.isDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); + var _symbol_2 = getSymbolInfo(node); + return _symbol_2 && getTypeOfSymbol(_symbol_2); } if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + var _symbol_3 = getSymbolInfo(node); + var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); } return unknownType; } @@ -21034,7 +16469,7 @@ var ts; return checkExpression(expr); } function getAugmentedPropertiesOfType(type) { - var type = getApparentType(type); + type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { @@ -21048,23 +16483,19 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name = symbol.name; + var _name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, name)); + symbols.push(getPropertyOfType(t, _name)); }); return symbols; } 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 === 221; @@ -21127,8 +16558,8 @@ var ts; return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); } function makeUniqueName(baseName) { - var name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[name] = name; + var _name = ts.generateUniqueName(baseName, isExistingName); + return generatedNames[_name] = _name; } function assignGeneratedName(node, name) { getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); @@ -21140,13 +16571,14 @@ var ts; } function generateNameForModuleOrEnum(node) { if (node.name.kind === 64) { - var name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); + var _name = node.name.text; + assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); } } 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) { @@ -21244,7 +16676,8 @@ 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; } @@ -21271,7 +16704,9 @@ 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) { @@ -21280,19 +16715,29 @@ var ts; } 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); + 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 !== 217; + 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, 107455 | 8388608, undefined, undefined); + var isLetOrConst = symbol && + (symbol.flags & 2) && + symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -21383,13 +16828,13 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var i = 0, n = node.modifiers.length; i < n; i++) { - var modifier = node.modifiers[i]; + for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + var modifier = _a[_i]; switch (modifier.kind) { case 108: case 107: case 106: - var text; + var text = void 0; if (modifier.kind === 108) { text = "public"; } @@ -21582,13 +17027,14 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || + checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var i = 0, n = arguments.length; i < n; i++) { - var arg = arguments[i]; + for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + var arg = arguments[_i]; if (arg.kind === 172) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } @@ -21596,7 +17042,8 @@ 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; @@ -21613,9 +17060,8 @@ var ts; var seenExtendsClause = false; var seenImplementsClause = false; if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21642,9 +17088,8 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21689,18 +17134,19 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - 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) { - checkGrammarComputedPropertyName(name); + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var prop = _a[_i]; + var _name = prop.name; + if (prop.kind === 172 || + _name.kind === 126) { + checkGrammarComputedPropertyName(_name); continue; } - var currentKind; + var currentKind = void 0; 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); + if (_name.kind === 7) { + checkGrammarNumbericLiteral(_name); } currentKind = Property; } @@ -21716,26 +17162,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name.text)) { - seen[name.text] = currentKind; + if (!ts.hasProperty(seen, _name.text)) { + seen[_name.text] = currentKind; } else { - var existingKind = seen[name.text]; + var existingKind = seen[_name.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; + seen[_name.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -21748,17 +17194,23 @@ 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; - return grammarErrorOnNode(firstDeclaration.name, diagnostic); + 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; - return grammarErrorOnNode(firstDeclaration, diagnostic); + var _diagnostic_1 = 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_1); } } } @@ -21811,7 +17263,9 @@ 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) { @@ -21862,7 +17316,8 @@ 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); } @@ -21883,12 +17338,16 @@ 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; - return grammarErrorOnNode(node, message); + 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); } } function checkGrammarBindingElement(node) { @@ -21924,7 +17383,8 @@ 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) { @@ -21934,8 +17394,9 @@ var ts; } else { var elements = name.elements; - for (var i = 0; i < elements.length; ++i) { - checkGrammarNameInLetOrConstDeclarations(elements[i].name); + for (var _i = 0, _n = elements.length; _i < _n; _i++) { + var element = elements[_i]; + checkGrammarNameInLetOrConstDeclarations(element.name); } } } @@ -21991,8 +17452,8 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var i = 0, n = enumDecl.members.length; i < n; i++) { - var node = enumDecl.members[i]; + for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + var node = _a[_i]; if (node.name.kind === 126) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } @@ -22056,7 +17517,8 @@ 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; } } @@ -22075,14 +17537,19 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (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); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var i = 0, n = file.statements.length; i < n; i++) { - var decl = file.statements[i]; + for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; if (ts.isDeclaration(decl) || decl.kind === 175) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; @@ -22103,9 +17570,9 @@ var ts; 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 === 221) { - var links = getNodeLinks(node.parent); - if (!links.hasReportedStatementInAmbientContext) { - return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + var _links = getNodeLinks(node.parent); + if (!_links.hasReportedStatementInAmbientContext) { + return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } } else { @@ -22137,10 +17604,7 @@ 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]; @@ -22215,34 +17679,21 @@ 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(); } } @@ -22271,7 +17722,9 @@ 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); @@ -22349,7 +17802,8 @@ 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) { @@ -22379,11 +17833,12 @@ var ts; } function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); } else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); } return emitOutputFilePathWithoutExtension + extension; } @@ -22405,8 +17860,7 @@ 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 = ""; @@ -22415,7 +17869,9 @@ 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; @@ -22432,7 +17888,8 @@ 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); } @@ -22463,17 +17920,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var writer = createTextWriter(newLine); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - setWriter(writer); - return writer; + var _writer = createTextWriter(newLine); + _writer.trackSymbol = trackSymbol; + _writer.writeKeyword = _writer.write; + _writer.writeOperator = _writer.write; + _writer.writePunctuation = _writer.write; + _writer.writeSpace = _writer.write; + _writer.writeStringLiteral = _writer.writeLiteral; + _writer.writeParameter = _writer.write; + _writer.writeSymbol = _writer.write; + setWriter(_writer); + return _writer; } function setWriter(newWriter) { writer = newWriter; @@ -22486,9 +17943,7 @@ 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--) { @@ -22543,18 +17998,20 @@ var ts; } } function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emit(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (currentWriterPos !== writer.getTextPos()) { write(separator); } currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); + eachNodeEmitFn(node); } } function emitCommaList(nodes, eachNodeEmitFn) { @@ -22813,8 +18270,15 @@ 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 { @@ -22877,7 +18341,9 @@ 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; @@ -22910,9 +18376,7 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([ - baseTypeNode - ], false); + emitHeritageClause([baseTypeNode], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -22972,17 +18436,31 @@ 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 ? { @@ -22999,9 +18477,7 @@ 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); @@ -23024,13 +18500,14 @@ var ts; return; } var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); if (!(node.flags & 32)) { - var accessorWithTypeAnnotation = node; + accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; @@ -23046,17 +18523,25 @@ 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, @@ -23066,10 +18551,18 @@ 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, @@ -23083,7 +18576,8 @@ 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); @@ -23150,28 +18644,48 @@ 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); @@ -23198,7 +18712,9 @@ 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)) { @@ -23208,28 +18724,50 @@ 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); @@ -23281,7 +18819,11 @@ var ts; } } 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; } @@ -23345,28 +18887,20 @@ 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 emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; var emit = emitNodeWithoutSourceMap; var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; - var emitStart = function (node) { - }; - var emitEnd = function (node) { - }; + 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(); @@ -23392,10 +18926,7 @@ var ts; var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { - names: names, - previous: lastFrame - }; + lastFrame = { names: names, previous: lastFrame }; return true; } return false; @@ -23410,16 +18941,14 @@ var ts; } } function generateUniqueNameForLocation(location, baseName) { - var name; + var _name; if (!isExistingName(location, baseName)) { - name = baseName; + _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); + return recordNameInCurrentScope(_name); } function recordNameInCurrentScope(name) { if (!currentScopeNames) { @@ -23517,7 +19046,12 @@ 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, @@ -23562,8 +19096,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name = node.name; - if (!name || name.kind !== 126) { + var _name = node.name; + if (!_name || _name.kind !== 126) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -23580,10 +19114,20 @@ 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; + var _name = node.name; + scopeName = _name.kind === 126 + ? ts.getTextOfNode(_name) + : node.name.text; } recordScopeNameStart(scopeName); } @@ -23697,14 +19241,18 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, forLoopVariable) { - var name = forLoopVariable ? "_i" : undefined; - while (true) { - if (name && !isExistingName(location, name)) { - break; + function createTempVariable(location, preferredName) { + for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { + var char = 97 + tempCount; + if (char === 105 || char === 110) { + continue; + } + if (tempCount < 26) { + name = "_" + String.fromCharCode(char); + } + else { + name = "_" + (tempCount - 26); } - name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); - tempCount++; } recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); @@ -23717,8 +19265,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location) { - var temp = createTempVariable(location, false); + function createAndRecordTempVariable(location, preferredName) { + var temp = createTempVariable(location, preferredName); recordTempDeclaration(temp); return temp; } @@ -23926,7 +19474,8 @@ 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); }); } @@ -23937,7 +19486,8 @@ 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("("); } @@ -23946,9 +19496,10 @@ var ts; emitLiteral(node.head); headEmitted = true; } - for (var i = 0; i < node.templateSpans.length; i++) { + for (var i = 0, n = node.templateSpans.length; i < n; 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(" + "); } @@ -24022,8 +19573,8 @@ var ts; } } function isNotExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 128: case 193: case 150: @@ -24043,7 +19594,7 @@ var ts; case 199: case 200: case 203: - return parent.name === node; + return _parent.name === node; case 185: case 184: case 209: @@ -24150,8 +19701,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var length = elements.length; - while (pos < length) { + var _length = elements.length; + while (pos < _length) { if (group === 1) { write(".concat("); } @@ -24166,14 +19717,14 @@ var ts; } else { var i = pos; - while (i < length && elements[i].kind !== 171) { + while (i < _length && elements[i].kind !== 171) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); if (multiLine) { decreaseIndent(); } @@ -24249,8 +19800,8 @@ var ts; var propertyDescriptor = ts.createSynthesizedNode(152); var descriptorProperties = []; if (getAccessor) { - var getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(_getProperty); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); @@ -24363,7 +19914,6 @@ var ts; } } write("{"); - var properties = node.properties; if (properties.length) { emitLinePreservingList(node, properties, languageVersion >= 1, true); } @@ -24446,9 +19996,7 @@ 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) { @@ -24561,7 +20109,14 @@ 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; } @@ -24604,7 +20159,8 @@ 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)) { + if (languageVersion < 2 && node.operatorToken.kind === 52 && + (node.left.kind === 152 || node.left.kind === 151)) { emitDestructuring(node, node.parent.kind === 177); } else { @@ -24802,8 +20358,9 @@ var ts; write(" "); endPos = emitToken(16, endPos); var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, true); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + var counter = createTempVariable(node, "_i"); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); + var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -24817,12 +20374,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } + if (cachedLength) { + write(", "); + emitNodeWithoutSourceMap(cachedLength); + write(" = "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); + if (cachedLength) { + emitNodeWithoutSourceMap(cachedLength); + } + else { + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -24850,7 +20419,7 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node, false)); + emitNodeWithoutSourceMap(createTempVariable(node)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -24911,13 +20480,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 === 214) { @@ -25015,7 +20587,7 @@ var ts; } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; + var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } @@ -25040,7 +20612,7 @@ var ts; function ensureIdentifier(expr) { if (expr.kind !== 64) { var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!isDeclaration) { + if (!_isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -25095,8 +20667,8 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); @@ -25141,18 +20713,18 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var value = root.right; + var _value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, _value); } else { if (root.parent.kind !== 159) { write("("); } - value = ensureIdentifier(value); - emitDestructuringAssignment(target, value); + _value = ensureIdentifier(_value); + emitDestructuringAssignment(target, _value); write(", "); - emit(value); + emit(_value); if (root.parent.kind !== 159) { write(")"); } @@ -25211,8 +20783,11 @@ var ts; 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(); } } @@ -25220,12 +20795,12 @@ var ts; } } function emitExportVariableAssignments(node) { - var name = node.name; - if (name.kind === 64) { - emitExportMemberAssignments(name); + var _name = node.name; + if (_name.kind === 64) { + emitExportMemberAssignments(_name); } - else if (ts.isBindingPattern(name)) { - ts.forEach(name.elements, emitExportVariableAssignments); + else if (ts.isBindingPattern(_name)) { + ts.forEach(_name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { @@ -25235,7 +20810,10 @@ 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); @@ -25247,8 +20825,10 @@ var ts; return; } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(parent, node.text); + var _parent = blockScopeContainer.kind === 221 + ? blockScopeContainer + : blockScopeContainer.parent; + var generatedName = generateUniqueNameForLocation(_parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { generatedBlockScopeNames = []; @@ -25268,12 +20848,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name = createTempVariable(node); + var _name = createTempVariable(node); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name); - emit(name); + tempParameters.push(_name); + emit(_name); } else { emit(node.name); @@ -25320,7 +20900,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, true).text; + var tempName = createTempVariable(node, "_i").text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -25519,9 +21099,10 @@ var ts; decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var i = 0, n = body.statements.length; i < n; i++) { + for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { + var statement = _a[_i]; write(" "); - emit(body.statements[i]); + emit(statement); } emitTempDeclarations(false); write(" "); @@ -25759,11 +21340,12 @@ var ts; emitDetachedComments(ctor.body.statements); } emitCaptureThisForNodeIfNecessary(node); + var superCall; if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); if (baseTypeNode) { - var superCall = findInitialSuperCall(ctor); + superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); emit(superCall); @@ -26008,7 +21590,8 @@ 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)) @@ -26110,8 +21693,8 @@ var ts; if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; } - var name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); + var _name = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); }); } else if (node.kind === 209) { @@ -26134,8 +21717,8 @@ var ts; } function getExternalImportInfo(node) { if (externalImports) { - for (var i = 0; i < externalImports.length; i++) { - var info = externalImports[i]; + for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { + var info = externalImports[_i]; if (info.rootNode === node) { return info; } @@ -26296,12 +21879,12 @@ var ts; if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = shouldEmitLeadingAndTrailingComments(node); - if (emitComments) { + var _emitComments = shouldEmitLeadingAndTrailingComments(node); + if (_emitComments) { emitLeadingComments(node); } emitJavaScriptWorker(node); - if (emitComments) { + if (_emitComments) { emitTrailingComments(node); } } @@ -26530,10 +22113,7 @@ 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) { @@ -26558,17 +22138,12 @@ 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]; } } } @@ -26580,7 +22155,10 @@ var ts; 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; } } @@ -26626,14 +22204,17 @@ var ts; } var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { + var text; try { var start = new Date().getTime(); - var text = ts.sys.readFile(fileName, options.charset); + text = ts.sys.readFile(fileName, options.charset); ts.ioReadTime += new Date().getTime() - start; } 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 = ""; } @@ -26669,20 +22250,12 @@ 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; @@ -26722,9 +22295,7 @@ 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); } @@ -26733,35 +22304,21 @@ 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) { @@ -26788,11 +22345,7 @@ 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(); @@ -26845,9 +22398,11 @@ var ts; processSourceFile(ts.normalizePath(fileName), isDefaultLib); } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { + var start; + var _length; if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; + start = refPos; + _length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -26872,7 +22427,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -26913,17 +22468,17 @@ var ts; files.push(file); } } + return file; } - return file; function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; + var _file = filesByName[canonicalName]; + if (_file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return file; + return _file; } } function processReferencedFiles(file, basePath) { @@ -26956,14 +22511,15 @@ 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) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); + findModuleSourceFile(_searchName + ".d.ts", nameLiteral); } } } @@ -26984,17 +22540,19 @@ 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) { @@ -27203,12 +22761,17 @@ 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) { @@ -27229,7 +22792,8 @@ 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)) { @@ -27247,7 +22811,8 @@ 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) { @@ -27418,17 +22983,24 @@ var ts; switch (n.kind) { case 174: if (!ts.isFunctionBlock(n)) { - var parent = n.parent; + 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 === 217) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + 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; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -27448,20 +23020,22 @@ var ts; }); break; } - case 201: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + case 201: { + var _openBrace = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); break; + } case 196: case 197: case 199: case 152: - case 202: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + case 202: { + var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); break; + } case 151: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); @@ -27488,8 +23062,8 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); @@ -27508,13 +23082,7 @@ 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 }); } } }); @@ -27526,8 +23094,9 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var i = 0, n = matches.length; i < n; i++) { - if (!matches[i].isCaseSensitive) { + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + if (!match.isCaseSensitive) { return false; } } @@ -27548,7 +23117,9 @@ 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; @@ -27603,20 +23174,21 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var bestMatchKind = 3; - for (var i = 0, n = matches.length; i < n; i++) { - var kind = matches[i].kind; - if (kind < bestMatchKind) { - bestMatchKind = kind; + var _bestMatchKind = 3; + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + var kind = match.kind; + if (kind < _bestMatchKind) { + _bestMatchKind = kind; } } - return bestMatchKind; + 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; @@ -27740,8 +23312,8 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; switch (node.kind) { case 196: case 199: @@ -27766,9 +23338,7 @@ 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)) { @@ -27781,19 +23351,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var i = 0, n = nodes.length; i < n; i++) { - var child = nodes[i]; - var item = createItem(child); - if (item !== undefined) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind + "-" + item.indent; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + var _item = createItem(child); + if (_item !== undefined) { + if (_item.text.length > 0) { + var key = _item.text + "-" + _item.kind + "-" + _item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item); + merge(itemWithSameName, _item); } else { - keyToItem[key] = item; - items.push(item); + keyToItem[key] = _item; + items.push(_item); } } } @@ -27806,10 +23376,10 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var i = 0, n = source.childItems.length; i < n; i++) { - var sourceChild = source.childItems[i]; - for (var j = 0, m = target.childItems.length; j < m; j++) { - var targetChild = target.childItems[j]; + outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + var sourceChild = _a[_i]; + for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); continue outer; @@ -27852,9 +23422,9 @@ var ts; case 193: case 150: var variableDeclarationNode; - var name; + var _name; if (node.kind === 150) { - name = node.name; + _name = node.name; variableDeclarationNode = node; while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { variableDeclarationNode = variableDeclarationNode.parent; @@ -27864,16 +23434,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name = node.name; + _name = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -27886,9 +23456,7 @@ var ts; } 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) { @@ -27942,16 +23510,12 @@ 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; } @@ -27961,10 +23525,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) { @@ -27977,38 +23541,26 @@ 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); + 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) { @@ -28017,7 +23569,9 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 221 ? 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); @@ -28047,9 +23601,7 @@ 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, @@ -28109,8 +23661,8 @@ var ts; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var i = 0, n = wordSpans.length; i < n; i++) { - var span = wordSpans[i]; + for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } @@ -28157,15 +23709,13 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [ - match - ]; + return [match]; } } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var i = 0, n = subWordTextChunks.length; i < n; i++) { - var subWordTextChunk = subWordTextChunks[i]; + for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { return undefined; @@ -28191,10 +23741,10 @@ var ts; } } else { - for (var i = 0; i < patternPartLength; i++) { - var ch1 = pattern.charCodeAt(patternPartStart + i); - var ch2 = candidate.charCodeAt(candidateSpan.start + i); - if (ch1 !== ch2) { + for (var _i = 0; _i < patternPartLength; _i++) { + var _ch1 = pattern.charCodeAt(patternPartStart + _i); + var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); + if (_ch1 !== _ch2) { return false; } } @@ -28226,7 +23776,8 @@ 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; } } @@ -28247,7 +23798,10 @@ 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) { @@ -28396,7 +23950,11 @@ 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)); } @@ -28448,7 +24006,8 @@ 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) { @@ -28466,7 +24025,9 @@ 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 = {})); @@ -28496,7 +24057,8 @@ 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); @@ -28510,15 +24072,15 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var list = listItemInfo.list; - var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = getArgumentIndex(list, node); - var argumentCount = getArgumentCount(list); + var _list = listItemInfo.list; + var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; + 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, + kind: _isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(list), + argumentsSpan: getApplicableSpanForArguments(_list), argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -28533,28 +24095,28 @@ var ts; var templateExpression = node.parent; var tagExpression = templateExpression.parent; ts.Debug.assert(templateExpression.kind === 169); - var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); } else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { var templateSpan = node.parent; - var templateExpression = templateSpan.parent; - var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); + var _templateExpression = templateSpan.parent; + var _tagExpression = _templateExpression.parent; + ts.Debug.assert(_templateExpression.kind === 169); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); - var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); + var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); } return undefined; } 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]; + for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + var child = listChildren[_i]; if (child === node) { break; } @@ -28566,9 +24128,7 @@ var ts; } function getArgumentCount(argumentsList) { var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { - return arg.kind !== 23; - }); + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23; }); if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { argumentCount++; } @@ -28585,7 +24145,9 @@ 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, @@ -28620,9 +24182,9 @@ var ts; if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (argumentInfo) { - return argumentInfo; + var _argumentInfo = getImmediatelyContainingArgumentInfo(n); + if (_argumentInfo) { + return _argumentInfo; } } return undefined; @@ -28690,10 +24252,7 @@ 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() }; @@ -28802,9 +24361,7 @@ 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) { @@ -28818,15 +24375,11 @@ var ts; } 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) { @@ -28878,9 +24431,10 @@ var ts; return n; } 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); + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || + (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -28904,7 +24458,7 @@ var ts; return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; ++i) { + for (var i = 0, len = children.length; i < len; i++) { var child = children[i]; if (nodeHasTokens(child)) { if (position <= child.end) { @@ -28920,8 +24474,8 @@ var ts; } ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); + var _candidate = findRightmostChildNodeWithTokens(children, children.length); + return _candidate && findRightmostToken(_candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -28983,7 +24537,8 @@ 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) { @@ -29016,38 +24571,19 @@ 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) { @@ -29201,9 +24737,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { - return wasNewLine; - }, + lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -29229,21 +24763,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var t = scanner.getToken(); - if (!ts.isTrivia(t)) { + var _t = scanner.getToken(); + if (!ts.isTrivia(_t)) { break; } scanner.scan(); - var item = { + var _item = { pos: pos, end: scanner.getStartPos(), - kind: t + kind: _t }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item); + leadingTrivia.push(_item); } savedPos = scanner.getStartPos(); } @@ -29264,7 +24798,8 @@ 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; @@ -29277,7 +24812,13 @@ 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); } @@ -29340,8 +24881,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return startPos < endPos && current !== 1 && !ts.isTrivia(current); + var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return _startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -29444,7 +24985,9 @@ 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; })(); @@ -29462,7 +25005,8 @@ 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)); @@ -29492,7 +25036,8 @@ 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); @@ -29527,8 +25072,9 @@ var ts; if (this.IsAny()) { return true; } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { + for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + var check = _a[_i]; + if (!check(context)) { return false; } } @@ -29558,12 +25104,7 @@ 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)); @@ -29572,19 +25113,9 @@ 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)); @@ -29603,151 +25134,79 @@ 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)); @@ -29771,9 +25230,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; + for (var _name in o) { + if (o[_name] === rule) { + return _name; } } throw new Error("Unknown rule"); @@ -29921,7 +25380,8 @@ 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; @@ -29955,7 +25415,8 @@ 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; @@ -29998,7 +25459,8 @@ 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); @@ -30014,10 +25476,11 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) + for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + var rule = _a[_i]; + if (rule.Operation.Context.InContext(context)) { return rule; + } } } return null; @@ -30072,13 +25535,19 @@ 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) { @@ -30135,9 +25604,7 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [ - this.token - ]; + return [this.token]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -30191,68 +25658,18 @@ 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; @@ -30385,23 +25802,28 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!parent) { + var _parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!_parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), - end: parent.end + pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), + end: _parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } 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; @@ -30426,9 +25848,7 @@ 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) { @@ -30442,11 +25862,9 @@ 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; } @@ -30527,10 +25945,10 @@ var ts; } } else { - var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (startLine !== parentStartLine || startPos === column) { + if (_startLine !== parentStartLine || startPos === column) { return column; } } @@ -30540,7 +25958,10 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { + if (isSomeBlock(parent.kind) || + parent.kind === 221 || + parent.kind === 214 || + parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -30589,12 +26010,8 @@ 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) { @@ -30648,19 +26065,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > childStartPos) { + var _tokenInfo = formattingScanner.readTokenInfo(node); + if (_tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var tokenInfo = formattingScanner.readTokenInfo(child); - ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(child); + ts.Debug.assert(_tokenInfo_1.token.end === child.end); + consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -30672,33 +26089,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var startLine = parentStartLine; + var _startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.end > nodes.pos) { + var _tokenInfo = formattingScanner.readTokenInfo(parent); + if (_tokenInfo.token.end > nodes.pos) { break; } - else if (tokenInfo.token.kind === listStartToken) { - startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + else if (_tokenInfo.token.kind === listStartToken) { + _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; + var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var i = 0, len = nodes.length; i < len; ++i) { - inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, true); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); + if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { + consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); } } } @@ -30735,8 +26153,8 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { - var triviaItem = currentTokenInfo.leadingTrivia[i]; + for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } @@ -30749,8 +26167,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, commentIndentation, false); + var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, _commentIndentation, false); indentNextTokenOrTrivia = false; } break; @@ -30770,8 +26188,8 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var i = 0, len = trivia.length; i < len; ++i) { - var triviaItem = trivia[i]; + for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); @@ -30787,7 +26205,8 @@ 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; @@ -30815,7 +26234,9 @@ 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; @@ -30839,31 +26260,26 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - if (startLine === endLine) { + var parts; + if (_startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } return; } else { - var parts = []; + parts = []; var startPos = commentRange.pos; - for (var line = startLine; line < endLine; ++line) { + 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 startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -30871,19 +26287,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - startLine++; + _startLine++; } - 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 newIndentation = nonWhitespaceCharacterAndColumn.column + delta; + 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 newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); } } } @@ -30905,10 +26323,7 @@ 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) { @@ -31058,7 +26473,12 @@ 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; } @@ -31084,9 +26504,9 @@ var ts; } break; } - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation; + var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation; } previous = current; current = current.parent; @@ -31103,9 +26523,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var parent = current.parent; + var _parent = current.parent; var parentStart; - while (parent) { + while (_parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -31117,20 +26537,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + parentStart = getParentStart(_parent, current, 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) { - return actualIndentation + indentationDelta; + var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = parent; + current = _parent; currentStart = parentStart; - parent = current.parent; + _parent = current.parent; } return indentationDelta; } @@ -31151,7 +26572,8 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && + (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -31191,7 +26613,8 @@ 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; @@ -31205,25 +26628,30 @@ var ts; case 132: case 131: case 136: - case 137: + 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())) { return node.parent.parameters; } break; + } case 156: - case 155: - var start = node.getStart(sourceFile); - if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + case 155: { + var _start = node.getStart(sourceFile); + 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; + } } } return undefined; @@ -31272,10 +26700,7 @@ var ts; } character++; } - return { - column: column, - character: character - }; + return { column: column, character: character }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -31492,8 +26917,8 @@ var ts; 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++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -31507,9 +26932,10 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; + var children; if (this.kind >= 125) { scanner.setText((sourceFile || this.getSourceFile()).text); - var children = []; + children = []; var pos = this.pos; var processNode = function (node) { if (pos < node.pos) { @@ -31550,8 +26976,8 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (child.kind < 125) { return child; } @@ -31658,7 +27084,10 @@ 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); @@ -31670,7 +27099,7 @@ var ts; } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var docComments = []; + var _docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -31705,14 +27134,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && docComments.length) { + else if (!isInParamTag && _docComments.length) { blankLineCount++; } } - return docComments; + return _docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -31813,8 +27242,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42) { + var _ch = sourceFile.text.charCodeAt(pos); + if (_ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -31874,9 +27303,7 @@ 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; }; @@ -31910,7 +27337,9 @@ 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; @@ -32108,9 +27537,7 @@ 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 ""; } @@ -32126,8 +27553,8 @@ var ts; if (declaration.kind !== 193 && declaration.kind !== 195) { return false; } - for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 221 || parent.kind === 201) { + for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { + if (_parent.kind === 221 || _parent.kind === 201) { return false; } } @@ -32168,8 +27595,9 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var i = 0, n = rootFileNames.length; i < n; i++) { - this.createEntry(rootFileNames[i]); + for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + var fileName = rootFileNames[_i]; + this.createEntry(fileName); } this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); } @@ -32228,17 +27656,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var version = this.host.getScriptVersion(fileName); + var _version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); } - else if (this.currentFileVersion !== version) { + else if (this.currentFileVersion !== _version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); } if (sourceFile) { - this.currentFileVersion = version; + this.currentFileVersion = _version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -32287,9 +27715,7 @@ 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) { @@ -32300,9 +27726,7 @@ 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 @@ -32491,11 +27915,7 @@ 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) { @@ -32508,10 +27928,14 @@ 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) { @@ -32546,10 +27970,12 @@ 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 === 218 || node.parent.kind === 219) && 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) { @@ -32572,12 +27998,15 @@ 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) { @@ -32590,7 +28019,8 @@ 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; @@ -32630,44 +28060,33 @@ 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 220: - return ScriptElementKind.variableElement; - case 128: - return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + 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: @@ -32723,31 +28142,19 @@ 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(); - for (var i = 0, n = oldSourceFiles.length; i < n; i++) { - var fileName = oldSourceFiles[i].fileName; + for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + var oldSourceFile = oldSourceFiles[_i]; + var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { documentRegistry.releaseDocument(fileName, oldSettings); } @@ -32762,8 +28169,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var oldSourceFile = program && program.getSourceFile(fileName); - if (oldSourceFile) { + var _oldSourceFile = program && program.getSourceFile(fileName); + if (_oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -32780,8 +28187,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var i = 0, n = rootFileNames.length; i < n; i++) { - if (!sourceFileUpToDate(program.getSourceFile(rootFileNames[i]))) { + for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { + var _fileName = rootFileNames[_a]; + if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { return false; } } @@ -32829,12 +28237,13 @@ 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); - for (var i = 1, n = displayName.length; isValid && i < n; i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); + for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { + isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); } if (isValid) { return ts.unescapeIdentifier(displayName); @@ -32860,20 +28269,20 @@ var ts; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } - var start = new Date().getTime(); + start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var start = new Date().getTime(); + var _start = new Date().getTime(); previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); } if (previousToken && isCompletionListBlocker(previousToken)) { log("Returning an empty list because completion was requested in an invalid position."); @@ -32901,12 +28310,14 @@ var ts; typeChecker: typeInfoResolver }; log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var location = ts.getTouchingPropertyName(sourceFile, position); + var _location = ts.getTouchingPropertyName(sourceFile, position); var semanticStart = new Date().getTime(); + var isMemberCompletion; + var isNewIdentifierLocation; if (isRightOfDot) { var symbols = []; - var isMemberCompletion = true; - var isNewIdentifierLocation = false; + isMemberCompletion = true; + isNewIdentifierLocation = false; if (node.kind === 64 || node.kind === 125 || node.kind === 153) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { @@ -32951,8 +28362,8 @@ var ts; if (showCompletionsInImportsClause(previousToken)) { var importDeclaration = ts.getAncestor(previousToken, 204); ts.Debug.assert(importDeclaration !== undefined); - var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - var filteredExports = filterModuleExports(exports, importDeclaration); + var _exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); + var filteredExports = filterModuleExports(_exports, importDeclaration); getCompletionEntriesFromSymbols(filteredExports, activeCompletionSession); } } @@ -32960,8 +28371,8 @@ var ts; isMemberCompletion = false; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); } } if (!isMemberCompletion) { @@ -32975,9 +28386,9 @@ var ts; entries: activeCompletionSession.entries }; function getCompletionEntriesFromSymbols(symbols, session) { - var start = new Date().getTime(); + var _start_1 = new Date().getTime(); ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, location); + var entry = createCompletionEntry(symbol, session.typeChecker, _location); if (entry) { var id = ts.escapeIdentifier(entry.name); if (!ts.lookUp(session.symbols, id)) { @@ -32986,12 +28397,14 @@ var ts; } } }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); } function isCompletionListBlocker(previousToken) { - var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + var _start_1 = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); return result; } function showCompletionsInImportsClause(node) { @@ -33007,9 +28420,16 @@ 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: @@ -33019,7 +28439,8 @@ 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: @@ -33039,10 +28460,12 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var start = previousToken.getStart(); + if (previousToken.kind === 8 + || previousToken.kind === 9 + || ts.isTemplateLiteralKind(previousToken.kind)) { + var _start_1 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start < position && position < end) { + if (_start_1 < position && position < end) { return true; } else if (position === end) { @@ -33053,12 +28476,12 @@ var ts; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { if (previousToken) { - var parent = previousToken.parent; + var _parent = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (parent && parent.kind === 152) { - return parent; + if (_parent && _parent.kind === 152) { + return _parent; } break; } @@ -33086,23 +28509,43 @@ 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 === 217 || 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: @@ -33147,18 +28590,17 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { + 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; + var _name = el.propertyName || el.name; + exisingImports[_name.text] = true; }); } 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) { @@ -33174,13 +28616,13 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var filteredMembers = []; + var _filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - filteredMembers.push(s); + _filteredMembers.push(s); } }); - return filteredMembers; + return _filteredMembers; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -33191,10 +28633,10 @@ var ts; } var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); if (symbol) { - var location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, session.typeChecker, location, 7); + var _location = ts.getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); + ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -33208,9 +28650,7 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ - ts.displayPart(entryName, 5) - ], + displayParts: [ts.displayPart(entryName, 5)], documentation: undefined }; } @@ -33308,7 +28748,9 @@ 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); } @@ -33317,11 +28759,13 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); var hasAddedSymbolInfo; + var type; if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } - var type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + var signature; + type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { if (location.parent && location.parent.kind === 153) { var right = location.parent.name; @@ -33391,24 +28835,25 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { - var signature; + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || + (location.kind === 113 && location.parent.kind === 133)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = allSignatures[0]; + signature = _allSignatures[0]; } if (functionDeclaration.kind === 133) { symbolKind = ScriptElementKind.constructorImplementationElement; 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); + addSignatureDisplayParts(signature, _allSignatures); hasAddedSymbolInfo = true; } } @@ -33468,7 +28913,7 @@ var ts; } else { var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); if (signatureDeclaration.kind === 137) { displayParts.push(ts.keywordPart(87)); displayParts.push(ts.spacePart()); @@ -33476,7 +28921,7 @@ var ts; else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); } } if (symbolFlags & 8) { @@ -33526,7 +28971,9 @@ 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) { @@ -33539,9 +28986,14 @@ 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) { - var allSignatures = type.getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + else if (symbolFlags & 16 || + symbolFlags & 8192 || + symbolFlags & 16384 || + symbolFlags & 131072 || + symbolFlags & 98304 || + symbolKind === ScriptElementKind.memberFunctionElement) { + var _allSignatures_1 = type.getCallSignatures(); + addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); } } } @@ -33552,11 +29004,7 @@ 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()); @@ -33590,10 +29038,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { + var _typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, typeParameterParts); + displayParts.push.apply(displayParts, _typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -33643,26 +29091,20 @@ 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; } @@ -33693,7 +29135,8 @@ 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)); }); @@ -33710,11 +29153,12 @@ var ts; }; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; + var _declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - declarations.push(d); + if ((selectConstructors && d.kind === 133) || + (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + _declarations.push(d); if (d.body) definition = d; } @@ -33723,8 +29167,8 @@ var ts; result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); return true; } - else if (declarations.length) { - result.push(getDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); + else if (_declarations.length) { + result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); return true; } return false; @@ -33753,10 +29197,9 @@ 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: @@ -33804,7 +29247,9 @@ 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; @@ -33825,7 +29270,8 @@ 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); } } @@ -33838,8 +29284,8 @@ var ts; while (ifStatement) { var children = ifStatement.getChildren(); pushKeywordIf(keywords, children[0], 83); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 75)) { + for (var _i = children.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, children[_i], 75)) { break; } } @@ -33849,10 +29295,10 @@ var ts; ifStatement = ifStatement.elseStatement; } var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 75 && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; + for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { + if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { + var elseKeyword = keywords[_i_1]; + var ifKeyword = keywords[_i_1 + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -33866,11 +29312,11 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - i++; + _i_1++; continue; } } - result.push(getReferenceEntryFromNode(keywords[i])); + result.push(getReferenceEntryFromNode(keywords[_i_1])); } return result; } @@ -33933,17 +29379,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 221) { - return parent; + var _parent = child.parent; + if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { + return _parent; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent; + child = _parent; } return undefined; } @@ -33964,8 +29410,8 @@ var ts; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { if (loopNode.kind === 179) { var loopTokens = loopNode.getChildren(); - for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 99)) { + for (var _i = loopTokens.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, loopTokens[_i], 99)) { break; } } @@ -34028,8 +29474,8 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var node = statement.parent; node; node = node.parent) { - switch (node.kind) { + for (var _node = statement.parent; _node; _node = _node.parent) { + switch (_node.kind) { case 188: if (statement.kind === 184) { continue; @@ -34039,12 +29485,12 @@ var ts; case 183: case 180: case 179: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; + if (!statement.label || isLabeledBy(_node, statement.label.text)) { + return _node; } break; default: - if (ts.isFunctionLike(node)) { + if (ts.isFunctionLike(_node)) { return undefined; } break; @@ -34070,16 +29516,15 @@ 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; } } @@ -34123,9 +29568,7 @@ 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); @@ -34179,7 +29622,9 @@ 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); @@ -34189,9 +29634,7 @@ 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); @@ -34205,9 +29648,7 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [ - getReferenceEntryFromNode(node) - ]; + return [getReferenceEntryFromNode(node)]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -34241,7 +29682,9 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && 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) { @@ -34249,46 +29692,38 @@ var ts; }); } 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; }); + var _name; if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; + _name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(name); + _name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(_name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { - return d.kind === 160 ? d : undefined; - }); - if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; - } - else { - var name = symbol.name; - } - return stripQuotes(name); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var _name = functionExpression && functionExpression.name + ? functionExpression.name.text + : symbol.name; + return stripQuotes(_name); } function stripQuotes(name) { - var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { - return name.substring(1, length - 1); + var _length = name.length; + if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { + return name.substring(1, _length - 1); } ; return name; } 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); } @@ -34299,24 +29734,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var scope = undefined; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var i = 0, n = declarations.length; i < n; i++) { - var container = getContainerNode(declarations[i]); + var _scope = undefined; + var _declarations = symbol.getDeclarations(); + if (_declarations) { + for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { + var declaration = _declarations[_i]; + var container = getContainerNode(declaration); if (!container) { return undefined; } - if (scope && scope !== container) { + if (_scope && _scope !== container) { return undefined; } if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } - scope = container; + _scope = container; } } - return scope; + return _scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -34332,7 +29768,8 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -34340,21 +29777,22 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var result = []; + var _result = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - result.push(getReferenceEntryFromNode(node)); + if (_node === targetLabel || + (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function isValidReferencePosition(node, searchSymbolName) { if (node) { @@ -34362,7 +29800,8 @@ 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; @@ -34385,7 +29824,8 @@ 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), @@ -34450,21 +29890,21 @@ var ts; default: return undefined; } - var result = []; + var _result = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 90) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 90) { return; } - var container = ts.getSuperContainer(node, false); + var container = ts.getSuperContainer(_node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - result.push(getReferenceEntryFromNode(node)); + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); @@ -34493,48 +29933,49 @@ var ts; default: return undefined; } - var result = []; + var _result = []; + var possiblePositions; if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); } - return result; + return _result; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 92) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 92) { return; } - var container = ts.getThisContainer(node, false); + var container = ts.getThisContainer(_node, false); switch (searchSpaceNode.kind) { case 160: case 195: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 132: case 131: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 196: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 221: if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; } @@ -34542,30 +29983,28 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [ - symbol - ]; + var _result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + _result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - result.push(shorthandValueSymbol); + _result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - result.push(rootSymbol); + _result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); } }); - return result; + return _result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { @@ -34597,14 +30036,13 @@ 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) { @@ -34612,11 +30050,9 @@ var ts; return true; } 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; - }); + var _result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); } return false; }); @@ -34625,32 +30061,28 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name = node.text; + var _name = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name); + var unionProperty = contextualType.getProperty(_name); if (unionProperty) { - return [ - unionProperty - ]; + return [unionProperty]; } else { - var result = []; + var _result = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result.push(symbol); + var _symbol = t.getProperty(_name); + if (_symbol) { + _result.push(_symbol); } }); - return result; + return _result; } } else { - var symbol = contextualType.getProperty(name); - if (symbol) { - return [ - symbol - ]; + var _symbol = contextualType.getProperty(_name); + if (_symbol) { + return [_symbol]; } } } @@ -34659,10 +30091,12 @@ var ts; } function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { + var lastIterationMeaning; do { - var lastIterationMeaning = meaning; - for (var i = 0, n = declarations.length; i < n; i++) { - var declarationMeaning = getMeaningFromDeclaration(declarations[i]); + lastIterationMeaning = meaning; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; + var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; } @@ -34689,13 +30123,13 @@ var ts; if (node.kind === 64 && ts.isDeclarationName(node)) { return true; } - var parent = node.parent; - if (parent) { - if (parent.kind === 166 || parent.kind === 165) { + var _parent = node.parent; + if (_parent) { + if (_parent.kind === 166 || _parent.kind === 165) { return true; } - else if (parent.kind === 167 && parent.left === node) { - var operator = parent.operatorToken.kind; + else if (_parent.kind === 167 && _parent.left === node) { + var operator = _parent.operatorToken.kind; return 52 <= operator && operator <= 63; } } @@ -34706,9 +30140,7 @@ 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(); @@ -34802,7 +30234,9 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { + if (node.parent.kind === 125 && + node.parent.right === node && + node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; @@ -34861,7 +30295,8 @@ 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 { @@ -34908,7 +30343,8 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || + (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -35033,11 +30469,16 @@ 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; } } @@ -35091,8 +30532,8 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); } @@ -35116,8 +30557,8 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var i = 0, n = childNodes.length; i < n; i++) { - var current = childNodes[i]; + for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); @@ -35135,22 +30576,14 @@ 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; } @@ -35159,7 +30592,7 @@ var ts; var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); return result; @@ -35205,9 +30638,9 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; + for (var _i = 0, n = descriptors.length; _i < n; _i++) { + if (matchArray[_i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[_i]; } } ts.Debug.assert(descriptor !== undefined); @@ -35230,18 +30663,18 @@ var ts; var singleLineCommentStart = /(?:\/\/+\s*)/.source; 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 _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; 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) { @@ -35255,9 +30688,10 @@ var ts; if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var i = 0; i < declarations.length; i++) { - var sourceFile = declarations[i].getSourceFile(); - if (sourceFile && getCanonicalFileName(ts.normalizePath(sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var _sourceFile = current.getSourceFile(); + if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -35342,7 +30776,9 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || + node.parent.kind === 213 || + isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -35352,10 +30788,13 @@ 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); + var _scanner = ts.createScanner(2, false); var noRegexTable = []; noRegexTable[64] = true; noRegexTable[8] = true; @@ -35381,7 +30820,10 @@ 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; @@ -35419,17 +30861,17 @@ var ts; templateStack.push(11); break; } - scanner.setText(text); + _scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = scanner.scan(); + token = _scanner.scan(); if (!ts.isTrivia(token)) { if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9) { + if (_scanner.reScanSlashToken() === 9) { token = 9; } } @@ -35439,13 +30881,18 @@ 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; } @@ -35462,7 +30909,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = scanner.reScanTemplateToken(); + token = _scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -35482,13 +30929,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = scanner.getTokenPos(); - var end = scanner.getTextPos(); + var start = _scanner.getTokenPos(); + var end = _scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = scanner.getTokenText(); - if (scanner.isUnterminated()) { + var tokenText = _scanner.getTokenText(); + if (_scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -35496,17 +30943,19 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 ? 3 : 2; + result.finalLexState = quoteChar === 34 + ? 3 + : 2; } } } else if (token === 3) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -35528,10 +30977,7 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ - length: length, - classification: classification - }); + result.entries.push({ length: length, classification: classification }); } } } @@ -35626,9 +31072,7 @@ var ts; return 5; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -35652,15 +31096,9 @@ 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(); @@ -35741,9 +31179,7 @@ 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(); @@ -35836,10 +31272,7 @@ 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; })(); @@ -35917,9 +31350,7 @@ 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) { @@ -36016,7 +31447,8 @@ 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; } @@ -36138,9 +31570,7 @@ 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); }); } } } @@ -36222,16 +31652,12 @@ 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); @@ -36244,9 +31670,7 @@ var ts; proj.addRoot(info); } else { - return { - errorMsg: "specified file " + rootFilename + " not found" - }; + return { errorMsg: "specified file " + rootFilename + " not found" }; } } var projectOptions = { @@ -36257,15 +31681,10 @@ 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" }; } } }; @@ -36342,12 +31761,8 @@ 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) { @@ -36539,7 +31954,9 @@ 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(); } }; @@ -36644,9 +32061,7 @@ 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) { @@ -36825,10 +32240,7 @@ 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; @@ -36842,10 +32254,7 @@ var ts; else { lines.length--; } - return { - lines: lines, - lineMap: lineStarts - }; + return { lines: lines, lineMap: lineStarts }; }; return LineIndex; })(); @@ -36959,10 +32368,7 @@ 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) { @@ -37149,12 +32555,7 @@ var ts; (function (ts) { var server; (function (server) { - var spaceCache = [ - " ", - " ", - " ", - " " - ]; + var spaceCache = [" ", " ", " ", " "]; function generateSpaces(n) { if (!spaceCache[n]) { var strBuilder = ""; @@ -37240,22 +32641,16 @@ 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) { @@ -37277,7 +32672,8 @@ var ts; if (this.logger.isVerbose()) { this.logger.info(msg.type + ": " + json); } - this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + '\r\n\r\n' + json); + this.sendLineToClient('Content-Length: ' + (1 + Buffer.byteLength(json, 'utf8')) + + '\r\n\r\n' + json); }; Session.prototype.event = function (info, eventName) { var ev = { @@ -37313,13 +32709,8 @@ 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) { @@ -37330,13 +32721,8 @@ 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) { @@ -37405,13 +32791,11 @@ 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); @@ -37435,13 +32819,11 @@ 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; } @@ -37468,22 +32850,13 @@ 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); @@ -37606,10 +32979,7 @@ var ts; } if (indentPosition > 0) { var spaces = generateSpaces(indentPosition); - edits.push({ - span: ts.createTextSpanFromBounds(position, position), - newText: spaces - }); + edits.push({ span: ts.createTextSpanFromBounds(position, position), newText: spaces }); } else if (indentPosition < 0) { edits.push({ @@ -37676,17 +33046,12 @@ 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) { @@ -37701,9 +33066,7 @@ 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) { @@ -37737,20 +33100,16 @@ 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); @@ -37813,12 +33172,10 @@ 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()) { @@ -37831,119 +33188,101 @@ var ts; 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); @@ -38184,9 +33523,7 @@ var ts; 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 bf6b204d3bb..8f71dc4ee08 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -1200,8 +1200,6 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1443,7 +1441,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; @@ -1451,7 +1449,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the language service API */ - var servicesVersion: string; + let servicesVersion: string; interface Node { getSourceFile(): SourceFile; getChildCount(sourceFile?: SourceFile): number; @@ -1938,7 +1936,7 @@ declare module "typescript" { throwIfCancellationRequested(): void; } function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - var disableIncrementalParsing: boolean; + let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createDocumentRegistry(): DocumentRegistry; function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; diff --git a/bin/typescript.js b/bin/typescript.js index 0fb345eea1b..9e939631006 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -625,8 +625,9 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (v === value) { return true; } } @@ -648,8 +649,9 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (predicate(v)) { count++; } } @@ -658,12 +660,13 @@ var ts; } ts.countWhere = countWhere; function filter(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (f(_item)) { + result.push(_item); } } } @@ -671,10 +674,12 @@ var ts; } ts.filter = filter; function map(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result.push(f(v)); } } return result; @@ -689,12 +694,14 @@ var ts; } ts.concatenate = concatenate; function deduplicate(array) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (!contains(result, _item)) { + result.push(_item); + } } } return result; @@ -702,15 +709,17 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result += v[prop]; } return result; } ts.sum = sum; function addRange(to, from) { - for (var i = 0, n = from.length; i < n; i++) { - to.push(from[i]); + for (var _i = 0, _n = from.length; _i < _n; _i++) { + var v = from[_i]; + to.push(v); } } ts.addRange = addRange; @@ -771,9 +780,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var id in second) { - if (!hasProperty(result, id)) { - result[id] = second[id]; + for (var _id in second) { + if (!hasProperty(result, _id)) { + result[_id] = second[_id]; } } return result; @@ -825,13 +834,13 @@ 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) { @@ -902,7 +911,12 @@ 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) { @@ -929,9 +943,7 @@ 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]; @@ -972,8 +984,8 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; + for (var _i = 0, _n = parts.length; _i < _n; _i++) { + var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { normalized.pop(); @@ -988,7 +1000,7 @@ var ts; return normalized; } function normalizePath(path) { - var path = normalizeSlashes(path); + path = normalizeSlashes(path); var rootLength = getRootLength(path); var normalized = getNormalizedParts(path, rootLength); return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); @@ -1008,12 +1020,10 @@ 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); + path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { path = combinePaths(normalizeSlashes(currentDirectory), path); @@ -1044,9 +1054,7 @@ var ts; } } if (rootLength === urlLength) { - return [ - url - ]; + return [url]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -1054,9 +1062,7 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [ - url + ts.directorySeparator - ]; + return [url + ts.directorySeparator]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -1118,14 +1124,10 @@ 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]; + for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); } @@ -1176,15 +1178,9 @@ 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"; @@ -1289,15 +1285,16 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var i = 0; i < files.length; i++) { - var name = files[i]; - if (!extension || ts.fileExtensionIs(name, extension)) { - result.push(ts.combinePaths(path, name)); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var _name = files[_i]; + if (!extension || ts.fileExtensionIs(_name, extension)) { + result.push(ts.combinePaths(path, _name)); } } var subfolders = getNames(folder.subfolders); - for (var i = 0; i < subfolders.length; i++) { - visitDirectory(ts.combinePaths(path, subfolders[i])); + for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + var current = subfolders[_a]; + visitDirectory(ts.combinePaths(path, current)); } } } @@ -1382,8 +1379,9 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var i = 0; i < files.length; i++) { - var name = ts.combinePaths(path, files[i]); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var current = files[_i]; + var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); if (stat.isFile()) { if (!extension || ts.fileExtensionIs(name, extension)) { @@ -1394,8 +1392,9 @@ var ts; directories.push(name); } } - for (var i = 0; i < directories.length; i++) { - visitDirectory(directories[i]); + for (var _a = 0, _b = directories.length; _a < _b; _a++) { + var _current = directories[_a]; + visitDirectory(_current); } } } @@ -1409,14 +1408,9 @@ 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) { @@ -1472,2431 +1466,491 @@ var 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." - } + 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; @@ -4013,2806 +2067,10 @@ 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; @@ -6836,17 +2094,21 @@ 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 = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; + for (var _name in source) { + if (source.hasOwnProperty(_name)) { + result[source[_name]] = _name; } } return result; @@ -6913,7 +2175,9 @@ 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) { @@ -7000,7 +2264,8 @@ var ts; return false; } } - return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || + text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -7019,8 +2284,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 62 && isConflictMarkerTrivia(text, pos)) { + var _ch = text.charCodeAt(pos); + if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -7080,11 +2345,7 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ - pos: startPos, - end: pos, - hasTrailingNewLine: hasTrailingNewLine - }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; } @@ -7111,11 +2372,15 @@ 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) { @@ -7134,10 +2399,14 @@ 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; @@ -7414,8 +2683,8 @@ var ts; return result; } function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { + var _len = tokenValue.length; + if (_len >= 2 && _len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; @@ -7567,13 +2836,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 && text.charCodeAt(pos + 1) === 47) { + var _ch = text.charCodeAt(pos); + if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(ch)) { + if (isLineBreak(_ch)) { precedingLineBreak = true; } pos++; @@ -7606,22 +2875,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var value = scanBinaryOrOctalDigits(2); - if (value < 0) { + var _value = scanBinaryOrOctalDigits(2); + if (_value < 0) { error(ts.Diagnostics.Binary_digit_expected); - value = 0; + _value = 0; } - tokenValue = "" + value; + tokenValue = "" + _value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var value = scanBinaryOrOctalDigits(8); - if (value < 0) { + var _value_1 = scanBinaryOrOctalDigits(8); + if (_value_1 < 0) { error(ts.Diagnostics.Octal_digit_expected); - value = 0; + _value_1 = 0; } - tokenValue = "" + value; + tokenValue = "" + _value_1; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -7720,10 +2989,10 @@ var ts; case 126: return pos++, token = 47; case 92: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); @@ -7860,39 +3129,17 @@ 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, @@ -7909,8 +3156,8 @@ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; } @@ -7922,13 +3169,9 @@ 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, @@ -7936,18 +3179,11 @@ 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(); @@ -7969,7 +3205,8 @@ 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; } @@ -8048,7 +3285,8 @@ 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) { @@ -8076,7 +3314,10 @@ var ts; } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; + return declaration && + declaration.kind === 193 && + declaration.parent && + declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -8128,7 +3369,9 @@ 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; @@ -8191,7 +3434,9 @@ 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; @@ -8394,8 +3639,8 @@ var ts; } case 7: case 8: - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -8403,7 +3648,7 @@ var ts; case 220: case 218: case 150: - return parent.initializer === node; + return _parent.initializer === node; case 177: case 178: case 179: @@ -8414,22 +3659,25 @@ var ts; case 214: case 190: case 188: - return parent.expression === node; + return _parent.expression === node; case 181: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; + var forStatement = _parent; + 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; + var forInStatement = _parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + forInStatement.expression === node; case 158: - return node === parent.expression; + return node === _parent.expression; case 173: - return node === parent.expression; + return node === _parent.expression; case 126: - return node === parent.expression; + return node === _parent.expression; default: - if (isExpression(parent)) { + if (isExpression(_parent)) { return true; } } @@ -8439,7 +3687,8 @@ 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) { @@ -8587,14 +3836,14 @@ var ts; if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { return false; } - var parent = name.parent; - if (parent.kind === 208 || parent.kind === 212) { - if (parent.propertyName) { + var _parent = name.parent; + if (_parent.kind === 208 || _parent.kind === 212) { + if (_parent.propertyName) { return true; } } - if (isDeclaration(parent)) { - return parent.name === name; + if (isDeclaration(_parent)) { + return _parent.name === name; } return false; } @@ -8616,9 +3865,10 @@ var ts; ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - if (clauses[i].token === kind) { - return clauses[i]; + for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + var clause = clauses[_i]; + if (clause.token === kind) { + return clause; } } } @@ -8686,7 +3936,9 @@ 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) { @@ -8790,10 +4042,7 @@ 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) { @@ -8812,10 +4061,7 @@ 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); @@ -8863,7 +4109,7 @@ var ts; ts.createSynthesizedNode = createSynthesizedNode; function generateUniqueName(baseName, isExistingName) { if (baseName.charCodeAt(0) !== 95) { - var baseName = "_" + baseName; + baseName = "_" + baseName; if (!isExistingName(baseName)) { return baseName; } @@ -8873,9 +4119,9 @@ var ts; } var i = 1; while (true) { - var name = baseName + i; - if (!isExistingName(name)) { - return name; + var _name = baseName + i; + if (!isExistingName(_name)) { + return _name; } i++; } @@ -8976,9 +4222,9 @@ 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 = {})); @@ -9006,8 +4252,9 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var i = 0, len = nodes.length; i < len; i++) { - var result = cbNode(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + var result = cbNode(node); if (result) { return result; } @@ -9022,9 +4269,12 @@ 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: @@ -9032,13 +4282,22 @@ var ts; 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: @@ -9047,9 +4306,17 @@ 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: @@ -9070,16 +4337,23 @@ 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: @@ -9091,91 +4365,142 @@ 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 221: - return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); + 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) || visitNode(cbNode, node.caseBlock); + 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); + 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); + return visitNode(cbNode, node.tryBlock) || + visitNode(cbNode, node.catchClause) || + visitNode(cbNode, node.finallyBlock); case 217: - return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); + 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); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); case 220: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.body); case 203: - 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.moduleReference); case 204: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.importClause) || + visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.namedBindings); case 206: return visitNode(cbNode, node.name); case 207: case 211: return visitNodes(cbNodes, node.elements); case 210: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.exportClause) || + visitNode(cbNode, node.moduleSpecifier); case 208: case 212: - return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + return visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name); case 209: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: @@ -9222,84 +4547,55 @@ 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; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var parent = sourceFile; + var _parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== parent) { - n.parent = parent; - var saveParent = parent; - parent = n; + if (n.parent !== _parent) { + n.parent = _parent; + var saveParent = _parent; + _parent = n; forEachChild(n, visitNode); - parent = saveParent; + _parent = saveParent; } } } @@ -9337,8 +4633,9 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } } } @@ -9400,8 +4697,9 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } return; } @@ -9515,7 +4813,8 @@ 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) { @@ -9697,8 +4996,8 @@ var ts; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - parseErrorAtPosition(start, length, message, arg0); + var _length = scanner.getTextPos() - start; + parseErrorAtPosition(start, _length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -9737,7 +5036,9 @@ 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; @@ -9788,7 +5089,8 @@ 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); @@ -9865,7 +5167,9 @@ 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) { @@ -9918,7 +5222,10 @@ 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(); @@ -9976,7 +5283,8 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || token === 78) { + if (token === 102 || + token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -10357,7 +5665,9 @@ 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; @@ -10396,7 +5706,9 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 ? parseLiteralNode(true) : parseType(); + return token === 8 + ? parseLiteralNode(true) + : parseType(); } return undefined; } @@ -10511,11 +5823,11 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { var method = createNode(131, fullStart); - method.name = name; + method.name = _name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); @@ -10523,7 +5835,7 @@ var ts; } else { var property = createNode(129, fullStart); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -10554,7 +5866,11 @@ 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) { @@ -10562,7 +5878,9 @@ 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); @@ -10584,7 +5902,9 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; + return isIndexSignature() + ? parseIndexSignatureDeclaration(modifiers) + : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -10690,9 +6010,7 @@ 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()); @@ -10717,7 +6035,9 @@ 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) { @@ -10842,10 +6162,16 @@ var ts; nextToken(); return !scanner.hasPrecedingLineBreak() && isIdentifier(); } + function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && + (isIdentifier() || token === 14 || token === 18); + } 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); @@ -10860,9 +6186,7 @@ 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); @@ -10874,7 +6198,9 @@ 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; } @@ -11096,7 +6422,9 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); + var expression = token === 90 + ? parseSuperExpression() + : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -11150,7 +6478,9 @@ 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; } @@ -11173,10 +6503,10 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(155, expression.pos); - callExpr.expression = expression; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); + var _callExpr = createNode(155, expression.pos); + _callExpr.expression = expression; + _callExpr.arguments = parseArgumentList(); + expression = finishNode(_callExpr); continue; } return expression; @@ -11196,7 +6526,9 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() + ? typeArguments + : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -11271,7 +6603,9 @@ 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); @@ -11826,15 +7160,15 @@ var ts; } function parsePropertyOrMethodDeclaration(fullStart, modifiers) { var asteriskToken = parseOptionalToken(35); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); } else { var property = createNode(130, fullStart); setModifiers(property, modifiers); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); property.initializer = allowInAnd(parseNonParameterInitializer); @@ -11921,7 +7255,11 @@ 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."); @@ -11934,7 +7272,9 @@ 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 { @@ -11944,7 +7284,9 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseHeritageClausesWorker) + : parseHeritageClausesWorker(); } return undefined; } @@ -12023,7 +7365,9 @@ 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) { @@ -12035,17 +7379,21 @@ 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); @@ -12065,7 +7413,9 @@ var ts; } 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); } @@ -12078,13 +7428,16 @@ var ts; if (identifier) { importClause.name = identifier; } - if (!importClause.name || parseOptional(23)) { + 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(213); @@ -12172,7 +7525,7 @@ var ts; return finishNode(node); } function isLetDeclaration() { - return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOnSameLine); + return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart() { switch (token) { @@ -12214,11 +7567,13 @@ 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(); @@ -12272,7 +7627,9 @@ 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); @@ -12287,10 +7644,7 @@ 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) { @@ -12321,10 +7675,7 @@ 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); } } @@ -12336,7 +7687,13 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; + return node.flags & 1 + || node.kind === 203 && node.moduleReference.kind === 213 + || node.kind === 204 + || node.kind === 209 + || node.kind === 210 + ? node + : undefined; }); } } @@ -12424,7 +7781,7 @@ var ts; } ts.bindSourceFile = bindSourceFile; function bindSourceFileWorker(file) { - var parent; + var _parent; var container; var blockScopeContainer; var lastContainer; @@ -12497,19 +7854,22 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (_name !== undefined) { + symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); if (symbol.flags & excludes) { 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))); }); file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, name); + symbol = createSymbol(0, _name); } } else { @@ -12550,7 +7910,9 @@ 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; @@ -12564,10 +7926,10 @@ var ts; if (symbolKind & 255504) { node.locals = {}; } - var saveParent = parent; + var saveParent = _parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; - parent = node; + _parent = node; if (symbolKind & 262128) { container = node; if (lastContainer) { @@ -12580,7 +7942,7 @@ var ts; } ts.forEachChild(node, bind); container = saveContainer; - parent = saveParent; + _parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -12683,7 +8045,7 @@ var ts; return "__" + ts.indexOf(node.parent.parameters, node); } function bind(node) { - node.parent = parent; + node.parent = _parent; switch (node.kind) { case 127: bindDeclaration(node, 262144, 530912, false); @@ -12817,10 +8179,10 @@ var ts; bindChildren(node, 0, true); break; default: - var saveParent = parent; - parent = node; + var saveParent = _parent; + _parent = node; ts.forEachChild(node, bind); - parent = saveParent; + _parent = saveParent; } } function bindParameter(node) { @@ -12830,7 +8192,9 @@ 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); } @@ -12861,25 +8225,15 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); + var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); 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, @@ -12909,8 +8263,6 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfExternalModule: getExportsOfExternalModule }; - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); var anyType = createIntrinsicType(1, "any"); @@ -12975,7 +8327,9 @@ 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) { @@ -13061,7 +8415,8 @@ 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)); }); @@ -13248,18 +8603,18 @@ var ts; } 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; - }); + 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) { + 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) { + else if (variableDeclaration.parent.parent.kind === 183 || + variableDeclaration.parent.parent.kind === 182) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -13280,12 +8635,15 @@ var ts; return false; } function isAliasSymbolDeclaration(node) { - return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; + 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 === 213) { @@ -13311,11 +8669,11 @@ var ts; function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol) { - var name = specifier.propertyName || specifier.name; - if (name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), name.text, 107455 | 793056 | 1536); + var _name = specifier.propertyName || specifier.name; + if (_name.text) { + var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); return; } return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); @@ -13326,7 +8684,9 @@ 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); @@ -13412,8 +8772,9 @@ var ts; if (ts.getFullWidth(name) === 0) { return undefined; } + var symbol; if (name.kind === 64) { - var symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } @@ -13424,7 +8785,7 @@ var ts; return undefined; } var right = name.right; - var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); + symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; @@ -13452,14 +8813,17 @@ var ts; return symbol; } } + var sourceFile; while (true) { var fileName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); - if (sourceFile || isRelative) + sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); + if (sourceFile || isRelative) { break; + } var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) + if (parentPath === searchPath) { break; + } searchPath = parentPath; } if (sourceFile) { @@ -13541,7 +8905,9 @@ 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) { @@ -13557,8 +8923,8 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; + for (var _i = 0, _n = members.length; _i < _n; _i++) { + var member = members[_i]; if (member.kind === 133 && ts.nodeIsPresent(member.body)) { return member; } @@ -13580,7 +8946,10 @@ 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; @@ -13614,25 +8983,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { + for (var _location = enclosingDeclaration; _location; _location = _location.parent) { + if (_location.locals && !isGlobalSourceFile(_location)) { + if (result = callback(_location.locals)) { return result; } } - switch (location.kind) { + switch (_location.kind) { case 221: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalModule(_location)) { break; } case 200: - if (result = callback(getSymbolOfNode(location).exports)) { + if (result = callback(getSymbolOfNode(_location).exports)) { return result; } break; case 196: case 197: - if (result = callback(getSymbolOfNode(location).members)) { + if (result = callback(getSymbolOfNode(_location).members)) { return result; } break; @@ -13654,28 +9023,24 @@ 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); } } } @@ -13740,9 +9105,7 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { - accessibility: 0 - }; + return { accessibility: 0 }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -13752,22 +9115,20 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && 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 === 203 && !(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)) { @@ -13775,9 +9136,7 @@ var ts; } } else { - aliasesToMakeVisible = [ - declaration - ]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -13791,7 +9150,8 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || entityName.parent.kind === 203) { + else if (entityName.kind === 125 || + entityName.parent.kind === 203) { meaning = 1536; } else { @@ -13877,12 +9237,14 @@ 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) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + var accessibleSymbol = accessibleSymbolChain[_i]; + appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } } else { @@ -13909,7 +9271,8 @@ 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); @@ -14002,14 +9365,16 @@ 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 === 221 || 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)); } } } @@ -14061,15 +9426,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + var signature = _a[_i]; + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.constructSignatures.length; i++) { + for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { + var _signature = _c[_b]; writeKeyword(writer, 87); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -14099,17 +9466,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; + for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { + var p = _f[_e]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var j = 0; j < signatures.length; j++) { + for (var _h = 0, _j = signatures.length; _h < _j; _h++) { + var _signature_1 = signatures[_h]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -14247,10 +9615,11 @@ var ts; } function isUsedInExportAssignment(node) { var externalModule = getContainingExternalModule(node); + var exportAssignmentSymbol; + var resolvedExportSymbol; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; + exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; @@ -14290,11 +9659,12 @@ var ts; case 195: case 199: case 203: - var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); + var _parent = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { + return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(parent); + return isDeclarationVisible(_parent); case 130: case 129: case 134: @@ -14346,9 +9716,7 @@ 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); @@ -14366,11 +9734,14 @@ var ts; } return parentType; } + var type; 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 _name = declaration.propertyName || declaration.name; + 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)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); return unknownType; } } @@ -14381,7 +9752,7 @@ var ts; } if (!declaration.dotDotDotToken) { var propName = "" + ts.indexOf(pattern.elements, declaration); - var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { 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); @@ -14393,7 +9764,7 @@ var ts; } } else { - var type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(getIndexTypeOfType(parentType, 1)); } } return type; @@ -14445,8 +9816,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + var _name = e.propertyName || e.name; + var symbol = createSymbol(flags, _name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -14464,7 +9835,9 @@ 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); @@ -14508,7 +9881,9 @@ 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)); } } @@ -14569,8 +9944,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 134); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + var _getter = ts.getDeclarationOfKind(symbol, 134); + error(_getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } } @@ -14642,9 +10017,7 @@ 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); @@ -14749,8 +10122,8 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var _declaration = ts.getDeclarationOfKind(symbol, 198); + error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -14806,23 +10179,23 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = symbol; } return result; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; + for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; } @@ -14830,8 +10203,9 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); + for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + var signature = baseSignatures[_i]; + signatures.push(signature); } } } @@ -14890,15 +10264,14 @@ 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 = {}; @@ -14927,17 +10300,16 @@ 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) { + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; + if (signature.typeParameters) { return emptyArray; } } - for (var i = 1; i < signatureLists.length; i++) { - if (!signatureListsIdentical(signatures, signatureLists[i])) { + for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { return emptyArray; } } @@ -14945,16 +10317,15 @@ 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; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var i = 0; i < types.length; i++) { - var indexType = getIndexTypeOfType(types[i], kind); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + var indexType = getIndexTypeOfType(type, kind); if (!indexType) { return undefined; } @@ -14971,17 +10342,22 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; + var members; + var callSignatures; + var constructSignatures; + var stringIndexType; + var numberIndexType; if (symbol.flags & 2048) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + members = symbol.members; + callSignatures = getSignaturesOfSymbol(members["__call"]); + constructSignatures = getSignaturesOfSymbol(members["__new"]); + stringIndexType = getIndexTypeOfSymbol(symbol, 0); + numberIndexType = getIndexTypeOfSymbol(symbol, 1); } else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; + members = emptySymbols; + callSignatures = emptyArray; + constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } @@ -14999,8 +10375,8 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + stringIndexType = undefined; + numberIndexType = (symbol.flags & 384) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -15083,17 +10459,16 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var i = 0; i < types.length; i++) { - var type = getApparentType(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (!prop) { return undefined; } if (!props) { - props = [ - prop - ]; + props = [prop]; } else { props.push(prop); @@ -15102,12 +10477,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop.declarations) { - declarations.push.apply(declarations, prop.declarations); + for (var _a = 0, _b = props.length; _a < _b; _a++) { + var _prop = props[_a]; + if (_prop.declarations) { + declarations.push.apply(declarations, _prop.declarations); } - propTypes.push(getTypeOfSymbol(prop)); + propTypes.push(getTypeOfSymbol(_prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -15144,9 +10519,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; + var _symbol = getPropertyOfObjectType(globalFunctionType, name); + if (_symbol) + return _symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -15193,7 +10568,8 @@ 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; @@ -15266,14 +10642,15 @@ var ts; function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { signature.resolvedReturnType = resolvingType; + var type; if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -15324,12 +10701,8 @@ 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; @@ -15342,8 +10715,9 @@ var ts; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var node = decl; if (node.parameters.length === 1) { var parameter = node.parameters[0]; if (parameter && parameter.type && parameter.type.kind === syntaxKind) { @@ -15356,7 +10730,9 @@ 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) { @@ -15379,8 +10755,9 @@ var ts; default: var result = ""; for (var i = 0; i < types.length; i++) { - if (i > 0) + if (i > 0) { result += ","; + } result += types[i].id; } return result; @@ -15388,8 +10765,9 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var i = 0; i < types.length; i++) { - result |= types[i].flags; + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + result |= type.flags; } return result & 786432; } @@ -15410,9 +10788,7 @@ 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; @@ -15426,9 +10802,7 @@ 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) { @@ -15446,8 +10820,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = resolveEntityName(node.typeName, 793056); + var type; if (symbol) { - var type; if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } @@ -15485,8 +10859,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; switch (declaration.kind) { case 196: case 197: @@ -15527,9 +10901,7 @@ 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); @@ -15570,13 +10942,15 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var i = 0, len = types.length; i < len; i++) { - addTypeToSortedSet(sortedTypes, types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -15592,8 +10966,9 @@ var ts; } } function containsAnyType(types) { - for (var i = 0; i < types.length; i++) { - if (types[i].flags & 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (type.flags & 1) { return true; } } @@ -15707,59 +11082,51 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); + for (var _i = 0, _n = items.length; _i < _n; _i++) { + var v = items[_i]; + result.push(instantiator(v, mapper)); } return result; } 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++) { - if (t === sources[i]) + if (t === sources[i]) { return targets[i]; + } } return t; }; } 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++) { - if (t === sources[i]) + for (var _i = 0, _n = sources.length; _i < _n; _i++) { + var source = sources[_i]; + if (t === source) { return anyType; + } } return t; }; @@ -15778,9 +11145,7 @@ 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); @@ -15795,8 +11160,9 @@ var ts; return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { + var freshTypeParameters; if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); } var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); @@ -15840,7 +11206,8 @@ 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)); @@ -15865,9 +11232,11 @@ 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)); + return node.operatorToken.kind === 49 && + (isContextSensitive(node.left) || isContextSensitive(node.right)); case 218: return isContextSensitive(node.initializer); case 132: @@ -15879,9 +11248,7 @@ 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) { @@ -15952,7 +11319,7 @@ var ts; } function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { if (elaborateErrors === void 0) { elaborateErrors = false; } - var result; + var _result; if (source === target) return -1; if (relation !== identityRelation) { @@ -15976,53 +11343,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (result = unionTypeRelatedToUnionType(source, target)) { - if (result &= unionTypeRelatedToUnionType(target, source)) { - return result; + if (_result = unionTypeRelatedToUnionType(source, target)) { + if (_result &= unionTypeRelatedToUnionType(target, source)) { + return _result; } } } else if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = unionTypeRelatedToType(target, source, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(target, source, reportErrors)) { + return _result; } } } else { if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = typeRelatedToUnionType(source, target, reportErrors)) { - return result; + if (_result = typeRelatedToUnionType(source, target, reportErrors)) { + return _result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (result = typeParameterRelatedTo(source, target, reportErrors)) { - return result; + if (_result = typeParameterRelatedTo(source, target, reportErrors)) { + return _result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return result; + if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return _result; } } 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; + return _result; } } if (reportErrors) { @@ -16038,16 +11406,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = typeRelatedToUnionType(sourceTypes[i], target, false); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -16060,27 +11429,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = isRelatedTo(sourceTypes[i], target, reportErrors); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var _result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -16146,19 +11516,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; + var _result; if (expandingFlags === 3) { - var result = 1; + _result = 1; } else { - var result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (result) { - result &= numberIndexTypesRelatedTo(source, target, reportErrors); + _result = propertiesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (_result) { + _result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -16166,23 +11537,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result) { + if (_result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return result; + return _result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) { + if (t.flags & 4096 && t.target === _target) { count++; if (count >= 10) return true; @@ -16195,11 +11566,11 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var _result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { @@ -16250,7 +11621,7 @@ var ts; } return 0; } - result &= related; + _result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -16260,7 +11631,7 @@ var ts; } } } - return result; + return _result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -16268,9 +11639,9 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var result = -1; - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; + var _result = -1; + for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -16279,9 +11650,9 @@ var ts; if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -16292,18 +11663,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var _result = -1; var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; + outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; + for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - result &= related; + _result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -16313,7 +11684,7 @@ var ts; return 0; } } - return result; + return _result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -16343,14 +11714,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var _result = -1; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); + var related = isRelatedTo(_s, _t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(_t, _s, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -16359,13 +11730,13 @@ var ts; } errorInfo = saveErrorInfo; } - result &= related; + _result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return result; + return _result; var s = getReturnTypeOfSignature(source); - return result & isRelatedTo(s, t, reportErrors); + return _result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -16373,15 +11744,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var result = -1; + var _result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -16421,11 +11792,12 @@ var ts; } return 0; } + var related; if (sourceStringType && sourceNumberType) { - var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } if (!related) { if (reportErrors) { @@ -16477,7 +11849,9 @@ 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; @@ -16498,14 +11872,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - var related = compareTypes(s, t); - if (!related) { + for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { + var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); + var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); + var _related = compareTypes(s, t); + if (!_related) { return 0; } - result &= related; + result &= _related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -16513,16 +11887,15 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; } 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; @@ -16619,29 +11992,32 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var errorReported = false; + var _errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - errorReported = true; + _errorReported = true; } }); - return errorReported; + return _errorReported; } return false; } function reportImplicitAnyError(declaration, type) { var typeAsString = typeToString(getWidenedType(type)); + var diagnostic; switch (declaration.kind) { case 130: case 129: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; + 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; + 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: @@ -16654,10 +12030,10 @@ var ts; error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } - var diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; + diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } @@ -16696,11 +12072,9 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ - primary: undefined, - secondary: undefined - }); + for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + var unused = typeParameters[_i]; + inferences.push({ primary: undefined, secondary: undefined }); } return { typeParameters: typeParameters, @@ -16718,19 +12092,21 @@ var ts; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) + if (source === sourceStack[i] && target === targetStack[i]) { return true; + } } return false; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) + if (t.flags & 4096 && t.target === _target) { count++; + } } return count < 5; } @@ -16745,7 +12121,9 @@ 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; @@ -16755,16 +12133,16 @@ var ts; else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); + for (var _i = 0; _i < sourceTypes.length; _i++) { + inferFromTypes(sourceTypes[_i], targetTypes[_i]); } } else if (target.flags & 16384) { - var targetTypes = target.types; + var _targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var i = 0; i < targetTypes.length; i++) { - var t = targetTypes[i]; + for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { + var t = _targetTypes[_a]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -16780,12 +12158,14 @@ var ts; } } else if (source.flags & 16384) { - var sourceTypes = source.types; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], target); + var _sourceTypes = source.types; + for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { + var sourceType = _sourceTypes[_b]; + inferFromTypes(sourceType, 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 = []; @@ -16806,8 +12186,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -16895,12 +12275,8 @@ var ts; 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 (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; } @@ -16993,14 +12369,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)) { - containerNodes.unshift(parent); + for (var _parent = node.parent; _parent; _parent = _parent.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); @@ -17129,9 +12504,7 @@ 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; } @@ -17187,7 +12560,9 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { + if (languageVersion >= 2 || + (symbol.flags & 2) === 0 || + symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -17283,21 +12658,33 @@ var ts; var container = ts.getSuperContainer(node, true); if (container) { var canUseSuperExpression = false; + var needToCaptureLexicalThis; if (isCallExpression) { canUseSuperExpression = container.kind === 133; } else { - var needToCaptureLexicalThis = false; + needToCaptureLexicalThis = false; while (container && container.kind === 161) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } 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; } } } @@ -17344,7 +12731,8 @@ 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]); } } @@ -17422,17 +12810,15 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var i = 0; i < types.length; i++) { - var t = mapper(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var t = mapper(current); if (t) { if (!mappedType) { mappedType = t; } else if (!mappedTypes) { - mappedTypes = [ - mappedType, - t - ]; + mappedTypes = [mappedType, t]; } else { mappedTypes.push(t); @@ -17448,17 +12834,13 @@ 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)); @@ -17478,7 +12860,8 @@ 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; } @@ -17487,7 +12870,9 @@ 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; } @@ -17502,8 +12887,8 @@ var ts; if (node.contextualType) { return node.contextualType; } - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -17515,22 +12900,22 @@ var ts; return getContextualTypeForReturnExpression(node); case 155: case 156: - return getContextualTypeForArgument(parent, node); + return getContextualTypeForArgument(_parent, node); case 158: - return getTypeFromTypeNode(parent.type); + return getTypeFromTypeNode(_parent.type); case 167: return getContextualTypeForBinaryOperand(node); case 218: - return getContextualTypeForObjectLiteralElement(parent); + return getContextualTypeForObjectLiteralElement(_parent); case 151: return getContextualTypeForElementExpression(node); case 168: return getContextualTypeForConditionalOperand(node); case 173: - ts.Debug.assert(parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + ts.Debug.assert(_parent.parent.kind === 169); + return getContextualTypeForSubstitutionExpression(_parent.parent, node); case 159: - return getContextualType(parent); + return getContextualType(_parent); } return undefined; } @@ -17551,7 +12936,9 @@ 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; } @@ -17560,16 +12947,16 @@ var ts; } var signatureList; var types = type.types; - for (var i = 0; i < types.length; i++) { - if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (signatureList && + getSignaturesOfObjectOrUnionType(current, 0).length > 1) { return undefined; } - var signature = getNonGenericSignature(types[i]); + var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { - signatureList = [ - signature - ]; + signatureList = [signature]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -17591,15 +12978,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var parent = node.parent; - if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { + var _parent = node.parent; + if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { return true; } - if (parent.kind === 218) { - return isAssignmentTarget(parent.parent); + if (_parent.kind === 218) { + return isAssignmentTarget(_parent.parent); } - if (parent.kind === 151) { - return isAssignmentTarget(parent); + if (_parent.kind === 151) { + return isAssignmentTarget(_parent); } return false; } @@ -17664,19 +13051,24 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var i = 0; i < node.properties.length; i++) { - var memberDecl = node.properties[i]; + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218 || + memberDecl.kind === 219 || + ts.isObjectLiteralMethod(memberDecl)) { + var type = void 0; if (memberDecl.kind === 218) { - var type = checkPropertyAssignment(memberDecl, contextualMapper); + type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { - var type = checkObjectLiteralMethod(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { ts.Debug.assert(memberDecl.kind === 219); - var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); + type = memberDecl.name.kind === 126 + ? unknownType + : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -17709,15 +13101,15 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, type)) { - propTypes.push(type); + var _type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, _type)) { + propTypes.push(_type); } } } - var result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= result.flags; - return result; + var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= _result.flags; + return _result; } return undefined; } @@ -17792,7 +13184,9 @@ 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); @@ -17818,9 +13212,9 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - var start = node.end - "]".length; - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); + var _start = node.end - "]".length; + var _end = node.end; + grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -17829,20 +13223,21 @@ 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; } if (node.argumentExpression) { - var name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name !== undefined) { - var prop = getPropertyOfType(objectType, name); + var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (_name !== undefined) { + var prop = getPropertyOfType(objectType, _name); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); return unknownType; } } @@ -17929,22 +13324,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; + var _parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { + if (lastParent && _parent === lastParent) { index++; } else { - lastParent = parent; + lastParent = _parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent; + lastParent = _parent; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -17996,7 +13391,8 @@ 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; } @@ -18013,7 +13409,8 @@ 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]; } } @@ -18034,30 +13431,31 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + var argType = void 0; if (i === 0 && args[i].parent.kind === 157) { - var argType = globalTemplateStringsArrayType; + argType = globalTemplateStringsArrayType; } else { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - var argType = checkExpressionWithContextualType(arg, paramType, mapper); + argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + for (var _i = 0; _i < args.length; _i++) { + if (excludeArgument[_i] === false) { + var _arg = args[_i]; + var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); + inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); } } } var inferredTypes = getInferredTypes(context); context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var i = 0; i < inferredTypes.length; i++) { - if (inferredTypes[i] === inferenceFailureType) { - inferredTypes[i] = unknownType; + for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { + if (inferredTypes[_i_1] === inferenceFailureType) { + inferredTypes[_i_1] = unknownType; } } return context; @@ -18083,7 +13481,9 @@ 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; } @@ -18095,9 +13495,7 @@ 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); @@ -18179,50 +13577,53 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (hasCorrectArity(node, args, candidates[i])) { - return candidates[i]; + for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + var candidate = candidates[_i]; + if (hasCorrectArity(node, args, candidate)) { + return candidate; } } } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var i = 0; i < candidates.length; i++) { - if (!hasCorrectArity(node, args, candidates[i])) { + for (var _a = 0, _b = candidates.length; _a < _b; _a++) { + var current = candidates[_a]; + if (!hasCorrectArity(node, args, current)) { continue; } - var originalCandidate = candidates[i]; - var inferenceResult; + var originalCandidate = current; + var inferenceResult = void 0; + var _candidate = void 0; + var typeArgumentsAreValid = void 0; while (true) { - var candidate = originalCandidate; - if (candidate.typeParameters) { - var typeArgumentTypes; - var typeArgumentsAreValid; + _candidate = originalCandidate; + if (_candidate.typeParameters) { + var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(_candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; typeArgumentTypes = inferenceResult.inferredTypes; } if (!typeArgumentsAreValid) { break; } - candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return candidate; + return _candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = candidate; + var instantiatedCandidate = _candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } @@ -18234,7 +13635,7 @@ var ts; } } else { - ts.Debug.assert(originalCandidate === candidate); + ts.Debug.assert(originalCandidate === _candidate); candidateForArgumentError = originalCandidate; } } @@ -18349,7 +13750,10 @@ 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); } @@ -18374,9 +13778,13 @@ 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); @@ -18386,9 +13794,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var _parameter = signature.parameters[signature.parameters.length - 1]; + var _links = getSymbolLinks(_parameter); + _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -18396,15 +13804,16 @@ var ts; if (!func.body) { return unknownType; } + var type; if (func.body.kind !== 174) { - var type = checkExpressionCached(func.body, contextualMapper); + type = checkExpressionCached(func.body, contextualMapper); } else { var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } - var type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); + type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; @@ -18524,12 +13933,14 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: + case 64: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; - case 153: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + } + case 153: { + var _symbol = findSymbol(n); + return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + } case 154: return true; case 159: @@ -18541,18 +13952,20 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 64: - case 153: + case 153: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; - case 154: + } + case 154: { var index = n.argumentExpression; - var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { - var name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + var _symbol = findSymbol(n.expression); + if (_symbol && index && index.kind === 8) { + var _name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; + } case 159: return isConstVariableReference(n.expression); default: @@ -18624,8 +14037,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (types[i].flags & kind) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (current.flags & kind) { return true; } } @@ -18639,8 +14053,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (!(types[i].flags & kind)) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (!(current.flags & kind)) { return false; } } @@ -18674,16 +14089,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; 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 _name = p.name; + 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); + checkDestructuringAssignment(p.initializer || _name, type); } else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); } } else { @@ -18703,7 +14121,9 @@ 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); } @@ -18784,7 +14204,9 @@ 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 { @@ -18846,10 +14268,7 @@ var ts; case 48: return rightType; case 49: - return getUnionType([ - leftType, - rightType - ]); + return getUnionType([leftType, rightType]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -18857,7 +14276,9 @@ 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; @@ -18903,10 +14324,7 @@ 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) { @@ -18970,7 +14388,9 @@ 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); } @@ -19080,7 +14500,9 @@ 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); @@ -19114,8 +14536,9 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { case 120: @@ -19173,10 +14596,8 @@ 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) { @@ -19188,13 +14609,14 @@ 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)) { @@ -19303,8 +14725,8 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; + for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; } @@ -19384,16 +14806,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; + var _errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { ts.Debug.assert(node.kind === 132 || node.kind === 131); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); + error(_errorNode, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -19409,8 +14831,9 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; if (inAmbientContextOrInterface) { @@ -19467,9 +14890,10 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + var signature = signatures[_a]; + if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } } @@ -19481,7 +14905,6 @@ var ts; if (!produceDiagnostics) { return; } - var symbol; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); @@ -19516,16 +14939,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 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; @@ -19534,7 +14957,10 @@ 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); @@ -19589,7 +15015,12 @@ 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)) { @@ -19610,8 +15041,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -19631,8 +15062,8 @@ var ts; return; } if (ts.getClassBaseTypeNode(enclosingClass)) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -19647,8 +15078,8 @@ var ts; if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { return; } - var parent = getDeclarationContainer(node); - if (parent.kind === 221 && ts.isExternalModule(parent)) { + var _parent = getDeclarationContainer(node); + 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)); } } @@ -19657,14 +15088,20 @@ 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 === 221); + 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); + 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); } } } @@ -19678,10 +15115,11 @@ var ts; return node.kind === 128; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind === 128) { - var func = ts.getContainingFunction(node); - visit(node.initializer); + if (getRootDeclaration(node).kind !== 128) { + return; } + var func = ts.getContainingFunction(node); + visit(node.initializer); function visit(n) { if (n.kind === 64) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; @@ -19877,15 +15315,17 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, 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; @@ -19949,7 +15389,9 @@ var ts; } 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; + 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; @@ -19959,10 +15401,7 @@ var ts; if (arrayElementType.flags & 258) { return stringType; } - return getUnionType([ - arrayElementType, - stringType - ]); + return getUnionType([arrayElementType, stringType]); } return arrayElementType; } @@ -20110,8 +15549,8 @@ var ts; }); if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { var classDeclaration = type.symbol.valueDeclaration; - for (var i = 0; i < classDeclaration.members.length; i++) { - var member = classDeclaration.members[i]; + for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); @@ -20124,9 +15563,7 @@ 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]; } } @@ -20140,22 +15577,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var errorNode; + var _errorNode; if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + _errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - errorNode = indexDeclaration; + _errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { - return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); - }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + 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; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + 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; + error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -20172,7 +15609,7 @@ var ts; } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { + for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { @@ -20244,8 +15681,9 @@ var ts; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); + for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + var baseProperty = baseProperties[_i]; + var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { continue; } @@ -20262,7 +15700,7 @@ var ts; if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { continue; } - var errorMessage; + var errorMessage = void 0; if (base.flags & 8192) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; @@ -20318,23 +15756,15 @@ 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]; + for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; + for (var _b = 0, _c = properties.length; _b < _c; _b++) { + var prop = properties[_b]; 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]; @@ -20387,8 +15817,8 @@ var ts; checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128)) { + var _nodeLinks = getNodeLinks(node); + if (!(_nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; @@ -20425,7 +15855,7 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + _nodeLinks.flags |= 128; } function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { return evalConstant(initializer); @@ -20437,12 +15867,9 @@ 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: @@ -20458,28 +15885,17 @@ 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: @@ -20494,32 +15910,33 @@ var ts; } var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var enumType; + var _enumType; var propertyName; if (e.kind === 64) { - enumType = currentType; + _enumType = currentType; propertyName = e.text; } 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); + _enumType = getTypeOfNode(e.expression); propertyName = e.argumentExpression.text; } else { - var enumType = getTypeOfNode(e.expression); + _enumType = getTypeOfNode(e.expression); propertyName = e.name.text; } - if (enumType !== currentType) { + if (_enumType !== currentType) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(enumType, propertyName); + var property = getPropertyOfObjectType(_enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -20579,8 +15996,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -20598,7 +16015,10 @@ 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)) { @@ -20634,7 +16054,9 @@ var ts; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; 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); + 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)) { @@ -20647,9 +16069,13 @@ 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 === 212 ? 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)); } } @@ -20747,18 +16173,19 @@ var ts; } function hasExportedMembers(moduleSymbol) { var declarations = moduleSymbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var statements = getModuleStatements(declarations[i]); - for (var j = 0; j < statements.length; j++) { - var node = statements[j]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var statements = getModuleStatements(current); + for (var _a = 0, _b = statements.length; _a < _b; _a++) { + var node = statements[_a]; if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; } var specifiers = exportClause.elements; - for (var k = 0; k < specifiers.length; k++) { - var specifier = specifiers[k]; + for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { + var specifier = specifiers[_c]; if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { return true; } @@ -21082,7 +16509,9 @@ 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) { @@ -21121,21 +16550,21 @@ var ts; } case 125: ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 142) { + var _parent = node.parent; + if (_parent.kind === 142) { return false; } - if (139 <= parent.kind && parent.kind <= 147) { + if (139 <= _parent.kind && _parent.kind <= 147) { return true; } - switch (parent.kind) { + switch (_parent.kind) { case 127: - return node === parent.constraint; + return node === _parent.constraint; case 130: case 129: case 128: case 193: - return node === parent.type; + return node === _parent.type; case 195: case 160: case 161: @@ -21144,16 +16573,16 @@ var ts; case 131: case 134: case 135: - return node === parent.type; + return node === _parent.type; case 136: case 137: case 138: - return node === parent.type; + return node === _parent.type; case 158: - return node === parent.type; + return node === _parent.type; case 155: case 156: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; case 157: return false; } @@ -21176,7 +16605,8 @@ 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)) { @@ -21209,17 +16639,17 @@ var ts; return getNodeLinks(entityName).resolvedSymbol; } else if (entityName.kind === 125) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { + var _symbol = getNodeLinks(entityName).resolvedSymbol; + if (!_symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 139 ? 793056 : 1536; - meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; + _meaning |= 8388608; + return resolveEntityName(entityName, _meaning); } return undefined; } @@ -21231,7 +16661,9 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 + ? getSymbolOfEntityNameOrPropertyAccessExpression(node) + : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -21250,7 +16682,10 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && 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: @@ -21288,21 +16723,21 @@ var ts; return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); + var _symbol = getSymbolInfo(node); + return _symbol && getDeclaredTypeOfSymbol(_symbol); } if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); + var _symbol_1 = getSymbolOfNode(node); + return getTypeOfSymbol(_symbol_1); } if (ts.isDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); + var _symbol_2 = getSymbolInfo(node); + return _symbol_2 && getTypeOfSymbol(_symbol_2); } if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + var _symbol_3 = getSymbolInfo(node); + var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); } return unknownType; } @@ -21313,7 +16748,7 @@ var ts; return checkExpression(expr); } function getAugmentedPropertiesOfType(type) { - var type = getApparentType(type); + type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { @@ -21327,23 +16762,19 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name = symbol.name; + var _name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, name)); + symbols.push(getPropertyOfType(t, _name)); }); return symbols; } 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 === 221; @@ -21406,8 +16837,8 @@ var ts; return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); } function makeUniqueName(baseName) { - var name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[name] = name; + var _name = ts.generateUniqueName(baseName, isExistingName); + return generatedNames[_name] = _name; } function assignGeneratedName(node, name) { getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); @@ -21419,13 +16850,14 @@ var ts; } function generateNameForModuleOrEnum(node) { if (node.name.kind === 64) { - var name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); + var _name = node.name.text; + assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); } } 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) { @@ -21523,7 +16955,8 @@ 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; } @@ -21550,7 +16983,9 @@ 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) { @@ -21559,19 +16994,29 @@ var ts; } 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); + 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 !== 217; + 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, 107455 | 8388608, undefined, undefined); + var isLetOrConst = symbol && + (symbol.flags & 2) && + symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -21662,13 +17107,13 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var i = 0, n = node.modifiers.length; i < n; i++) { - var modifier = node.modifiers[i]; + for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + var modifier = _a[_i]; switch (modifier.kind) { case 108: case 107: case 106: - var text; + var text = void 0; if (modifier.kind === 108) { text = "public"; } @@ -21861,13 +17306,14 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || + checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var i = 0, n = arguments.length; i < n; i++) { - var arg = arguments[i]; + for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + var arg = arguments[_i]; if (arg.kind === 172) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } @@ -21875,7 +17321,8 @@ 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; @@ -21892,9 +17339,8 @@ var ts; var seenExtendsClause = false; var seenImplementsClause = false; if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21921,9 +17367,8 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21968,18 +17413,19 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - 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) { - checkGrammarComputedPropertyName(name); + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var prop = _a[_i]; + var _name = prop.name; + if (prop.kind === 172 || + _name.kind === 126) { + checkGrammarComputedPropertyName(_name); continue; } - var currentKind; + var currentKind = void 0; 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); + if (_name.kind === 7) { + checkGrammarNumbericLiteral(_name); } currentKind = Property; } @@ -21995,26 +17441,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name.text)) { - seen[name.text] = currentKind; + if (!ts.hasProperty(seen, _name.text)) { + seen[_name.text] = currentKind; } else { - var existingKind = seen[name.text]; + var existingKind = seen[_name.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; + seen[_name.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -22027,17 +17473,23 @@ 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; - return grammarErrorOnNode(firstDeclaration.name, diagnostic); + 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; - return grammarErrorOnNode(firstDeclaration, diagnostic); + var _diagnostic_1 = 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_1); } } } @@ -22090,7 +17542,9 @@ 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) { @@ -22141,7 +17595,8 @@ 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); } @@ -22162,12 +17617,16 @@ 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; - return grammarErrorOnNode(node, message); + 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); } } function checkGrammarBindingElement(node) { @@ -22203,7 +17662,8 @@ 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) { @@ -22213,8 +17673,9 @@ var ts; } else { var elements = name.elements; - for (var i = 0; i < elements.length; ++i) { - checkGrammarNameInLetOrConstDeclarations(elements[i].name); + for (var _i = 0, _n = elements.length; _i < _n; _i++) { + var element = elements[_i]; + checkGrammarNameInLetOrConstDeclarations(element.name); } } } @@ -22270,8 +17731,8 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var i = 0, n = enumDecl.members.length; i < n; i++) { - var node = enumDecl.members[i]; + for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + var node = _a[_i]; if (node.name.kind === 126) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } @@ -22335,7 +17796,8 @@ 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; } } @@ -22354,14 +17816,19 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (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); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var i = 0, n = file.statements.length; i < n; i++) { - var decl = file.statements[i]; + for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; if (ts.isDeclaration(decl) || decl.kind === 175) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; @@ -22382,9 +17849,9 @@ var ts; 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 === 221) { - var links = getNodeLinks(node.parent); - if (!links.hasReportedStatementInAmbientContext) { - return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + var _links = getNodeLinks(node.parent); + if (!_links.hasReportedStatementInAmbientContext) { + return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } } else { @@ -22416,10 +17883,7 @@ 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]; @@ -22494,34 +17958,21 @@ 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(); } } @@ -22550,7 +18001,9 @@ 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); @@ -22628,7 +18081,8 @@ 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) { @@ -22658,11 +18112,12 @@ var ts; } function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); } else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); } return emitOutputFilePathWithoutExtension + extension; } @@ -22684,8 +18139,7 @@ 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 = ""; @@ -22694,7 +18148,9 @@ 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; @@ -22711,7 +18167,8 @@ 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); } @@ -22742,17 +18199,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var writer = createTextWriter(newLine); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - setWriter(writer); - return writer; + var _writer = createTextWriter(newLine); + _writer.trackSymbol = trackSymbol; + _writer.writeKeyword = _writer.write; + _writer.writeOperator = _writer.write; + _writer.writePunctuation = _writer.write; + _writer.writeSpace = _writer.write; + _writer.writeStringLiteral = _writer.writeLiteral; + _writer.writeParameter = _writer.write; + _writer.writeSymbol = _writer.write; + setWriter(_writer); + return _writer; } function setWriter(newWriter) { writer = newWriter; @@ -22765,9 +18222,7 @@ 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--) { @@ -22822,18 +18277,20 @@ var ts; } } function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emit(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (currentWriterPos !== writer.getTextPos()) { write(separator); } currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); + eachNodeEmitFn(node); } } function emitCommaList(nodes, eachNodeEmitFn) { @@ -23092,8 +18549,15 @@ 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 { @@ -23156,7 +18620,9 @@ 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; @@ -23189,9 +18655,7 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([ - baseTypeNode - ], false); + emitHeritageClause([baseTypeNode], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -23251,17 +18715,31 @@ 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 ? { @@ -23278,9 +18756,7 @@ 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); @@ -23303,13 +18779,14 @@ var ts; return; } var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); if (!(node.flags & 32)) { - var accessorWithTypeAnnotation = node; + accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; @@ -23325,17 +18802,25 @@ 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, @@ -23345,10 +18830,18 @@ 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, @@ -23362,7 +18855,8 @@ 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); @@ -23429,28 +18923,48 @@ 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); @@ -23477,7 +18991,9 @@ 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)) { @@ -23487,28 +19003,50 @@ 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); @@ -23560,7 +19098,11 @@ var ts; } } 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; } @@ -23624,28 +19166,20 @@ 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 emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; var emit = emitNodeWithoutSourceMap; var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; - var emitStart = function (node) { - }; - var emitEnd = function (node) { - }; + 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(); @@ -23671,10 +19205,7 @@ var ts; var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { - names: names, - previous: lastFrame - }; + lastFrame = { names: names, previous: lastFrame }; return true; } return false; @@ -23689,16 +19220,14 @@ var ts; } } function generateUniqueNameForLocation(location, baseName) { - var name; + var _name; if (!isExistingName(location, baseName)) { - name = baseName; + _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); + return recordNameInCurrentScope(_name); } function recordNameInCurrentScope(name) { if (!currentScopeNames) { @@ -23796,7 +19325,12 @@ 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, @@ -23841,8 +19375,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name = node.name; - if (!name || name.kind !== 126) { + var _name = node.name; + if (!_name || _name.kind !== 126) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -23859,10 +19393,20 @@ 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; + var _name = node.name; + scopeName = _name.kind === 126 + ? ts.getTextOfNode(_name) + : node.name.text; } recordScopeNameStart(scopeName); } @@ -23976,14 +19520,18 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, forLoopVariable) { - var name = forLoopVariable ? "_i" : undefined; - while (true) { - if (name && !isExistingName(location, name)) { - break; + function createTempVariable(location, preferredName) { + for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { + var char = 97 + tempCount; + if (char === 105 || char === 110) { + continue; + } + if (tempCount < 26) { + name = "_" + String.fromCharCode(char); + } + else { + name = "_" + (tempCount - 26); } - name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); - tempCount++; } recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); @@ -23996,8 +19544,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location) { - var temp = createTempVariable(location, false); + function createAndRecordTempVariable(location, preferredName) { + var temp = createTempVariable(location, preferredName); recordTempDeclaration(temp); return temp; } @@ -24205,7 +19753,8 @@ 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); }); } @@ -24216,7 +19765,8 @@ 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("("); } @@ -24225,9 +19775,10 @@ var ts; emitLiteral(node.head); headEmitted = true; } - for (var i = 0; i < node.templateSpans.length; i++) { + for (var i = 0, n = node.templateSpans.length; i < n; 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(" + "); } @@ -24301,8 +19852,8 @@ var ts; } } function isNotExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 128: case 193: case 150: @@ -24322,7 +19873,7 @@ var ts; case 199: case 200: case 203: - return parent.name === node; + return _parent.name === node; case 185: case 184: case 209: @@ -24429,8 +19980,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var length = elements.length; - while (pos < length) { + var _length = elements.length; + while (pos < _length) { if (group === 1) { write(".concat("); } @@ -24445,14 +19996,14 @@ var ts; } else { var i = pos; - while (i < length && elements[i].kind !== 171) { + while (i < _length && elements[i].kind !== 171) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); if (multiLine) { decreaseIndent(); } @@ -24528,8 +20079,8 @@ var ts; var propertyDescriptor = ts.createSynthesizedNode(152); var descriptorProperties = []; if (getAccessor) { - var getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(_getProperty); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); @@ -24642,7 +20193,6 @@ var ts; } } write("{"); - var properties = node.properties; if (properties.length) { emitLinePreservingList(node, properties, languageVersion >= 1, true); } @@ -24725,9 +20275,7 @@ 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) { @@ -24840,7 +20388,14 @@ 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; } @@ -24883,7 +20438,8 @@ 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)) { + if (languageVersion < 2 && node.operatorToken.kind === 52 && + (node.left.kind === 152 || node.left.kind === 151)) { emitDestructuring(node, node.parent.kind === 177); } else { @@ -25081,8 +20637,9 @@ var ts; write(" "); endPos = emitToken(16, endPos); var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, true); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + var counter = createTempVariable(node, "_i"); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); + var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -25096,12 +20653,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } + if (cachedLength) { + write(", "); + emitNodeWithoutSourceMap(cachedLength); + write(" = "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); + if (cachedLength) { + emitNodeWithoutSourceMap(cachedLength); + } + else { + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -25129,7 +20698,7 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node, false)); + emitNodeWithoutSourceMap(createTempVariable(node)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -25190,13 +20759,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 === 214) { @@ -25294,7 +20866,7 @@ var ts; } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; + var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } @@ -25319,7 +20891,7 @@ var ts; function ensureIdentifier(expr) { if (expr.kind !== 64) { var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!isDeclaration) { + if (!_isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -25374,8 +20946,8 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); @@ -25420,18 +20992,18 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var value = root.right; + var _value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, _value); } else { if (root.parent.kind !== 159) { write("("); } - value = ensureIdentifier(value); - emitDestructuringAssignment(target, value); + _value = ensureIdentifier(_value); + emitDestructuringAssignment(target, _value); write(", "); - emit(value); + emit(_value); if (root.parent.kind !== 159) { write(")"); } @@ -25490,8 +21062,11 @@ var ts; 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(); } } @@ -25499,12 +21074,12 @@ var ts; } } function emitExportVariableAssignments(node) { - var name = node.name; - if (name.kind === 64) { - emitExportMemberAssignments(name); + var _name = node.name; + if (_name.kind === 64) { + emitExportMemberAssignments(_name); } - else if (ts.isBindingPattern(name)) { - ts.forEach(name.elements, emitExportVariableAssignments); + else if (ts.isBindingPattern(_name)) { + ts.forEach(_name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { @@ -25514,7 +21089,10 @@ 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); @@ -25526,8 +21104,10 @@ var ts; return; } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(parent, node.text); + var _parent = blockScopeContainer.kind === 221 + ? blockScopeContainer + : blockScopeContainer.parent; + var generatedName = generateUniqueNameForLocation(_parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { generatedBlockScopeNames = []; @@ -25547,12 +21127,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name = createTempVariable(node); + var _name = createTempVariable(node); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name); - emit(name); + tempParameters.push(_name); + emit(_name); } else { emit(node.name); @@ -25599,7 +21179,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, true).text; + var tempName = createTempVariable(node, "_i").text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -25798,9 +21378,10 @@ var ts; decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var i = 0, n = body.statements.length; i < n; i++) { + for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { + var statement = _a[_i]; write(" "); - emit(body.statements[i]); + emit(statement); } emitTempDeclarations(false); write(" "); @@ -26038,11 +21619,12 @@ var ts; emitDetachedComments(ctor.body.statements); } emitCaptureThisForNodeIfNecessary(node); + var superCall; if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); if (baseTypeNode) { - var superCall = findInitialSuperCall(ctor); + superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); emit(superCall); @@ -26287,7 +21869,8 @@ 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)) @@ -26389,8 +21972,8 @@ var ts; if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; } - var name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); + var _name = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); }); } else if (node.kind === 209) { @@ -26413,8 +21996,8 @@ var ts; } function getExternalImportInfo(node) { if (externalImports) { - for (var i = 0; i < externalImports.length; i++) { - var info = externalImports[i]; + for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { + var info = externalImports[_i]; if (info.rootNode === node) { return info; } @@ -26575,12 +22158,12 @@ var ts; if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = shouldEmitLeadingAndTrailingComments(node); - if (emitComments) { + var _emitComments = shouldEmitLeadingAndTrailingComments(node); + if (_emitComments) { emitLeadingComments(node); } emitJavaScriptWorker(node); - if (emitComments) { + if (_emitComments) { emitTrailingComments(node); } } @@ -26809,10 +22392,7 @@ 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) { @@ -26837,17 +22417,12 @@ 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]; } } } @@ -26859,7 +22434,10 @@ var ts; 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; } } @@ -26905,14 +22483,17 @@ var ts; } var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { + var text; try { var start = new Date().getTime(); - var text = ts.sys.readFile(fileName, options.charset); + text = ts.sys.readFile(fileName, options.charset); ts.ioReadTime += new Date().getTime() - start; } 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 = ""; } @@ -26948,20 +22529,12 @@ 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; @@ -27001,9 +22574,7 @@ 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); } @@ -27012,35 +22583,21 @@ 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) { @@ -27067,11 +22624,7 @@ 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(); @@ -27124,9 +22677,11 @@ var ts; processSourceFile(ts.normalizePath(fileName), isDefaultLib); } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { + var start; + var _length; if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; + start = refPos; + _length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -27151,7 +22706,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -27192,17 +22747,17 @@ var ts; files.push(file); } } + return file; } - return file; function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; + var _file = filesByName[canonicalName]; + if (_file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return file; + return _file; } } function processReferencedFiles(file, basePath) { @@ -27235,14 +22790,15 @@ 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) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); + findModuleSourceFile(_searchName + ".d.ts", nameLiteral); } } } @@ -27263,17 +22819,19 @@ 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) { @@ -27457,14 +23015,16 @@ var ts; description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, experimental: true }, + { + name: "cacheDownlevelForOfLength", + type: "boolean", + description: "Cache length access when downlevel emitting for-of statements", + 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 @@ -27644,9 +23204,7 @@ 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 { @@ -27693,17 +23251,24 @@ var ts; switch (n.kind) { case 174: if (!ts.isFunctionBlock(n)) { - var parent = n.parent; + 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 === 217) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + 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; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -27723,20 +23288,22 @@ var ts; }); break; } - case 201: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + case 201: { + var _openBrace = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); break; + } case 196: case 197: case 199: case 152: - case 202: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + case 202: { + var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); break; + } case 151: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); @@ -27763,8 +23330,8 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); @@ -27783,13 +23350,7 @@ 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 }); } } }); @@ -27801,8 +23362,9 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var i = 0, n = matches.length; i < n; i++) { - if (!matches[i].isCaseSensitive) { + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + if (!match.isCaseSensitive) { return false; } } @@ -27823,7 +23385,9 @@ 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; @@ -27878,20 +23442,21 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var bestMatchKind = 3; - for (var i = 0, n = matches.length; i < n; i++) { - var kind = matches[i].kind; - if (kind < bestMatchKind) { - bestMatchKind = kind; + var _bestMatchKind = 3; + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + var kind = match.kind; + if (kind < _bestMatchKind) { + _bestMatchKind = kind; } } - return bestMatchKind; + 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; @@ -28015,8 +23580,8 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; switch (node.kind) { case 196: case 199: @@ -28041,9 +23606,7 @@ 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)) { @@ -28056,19 +23619,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var i = 0, n = nodes.length; i < n; i++) { - var child = nodes[i]; - var item = createItem(child); - if (item !== undefined) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind + "-" + item.indent; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + var _item = createItem(child); + if (_item !== undefined) { + if (_item.text.length > 0) { + var key = _item.text + "-" + _item.kind + "-" + _item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item); + merge(itemWithSameName, _item); } else { - keyToItem[key] = item; - items.push(item); + keyToItem[key] = _item; + items.push(_item); } } } @@ -28081,10 +23644,10 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var i = 0, n = source.childItems.length; i < n; i++) { - var sourceChild = source.childItems[i]; - for (var j = 0, m = target.childItems.length; j < m; j++) { - var targetChild = target.childItems[j]; + outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + var sourceChild = _a[_i]; + for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); continue outer; @@ -28127,9 +23690,9 @@ var ts; case 193: case 150: var variableDeclarationNode; - var name; + var _name; if (node.kind === 150) { - name = node.name; + _name = node.name; variableDeclarationNode = node; while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { variableDeclarationNode = variableDeclarationNode.parent; @@ -28139,16 +23702,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name = node.name; + _name = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -28161,9 +23724,7 @@ var ts; } 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) { @@ -28217,16 +23778,12 @@ 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; } @@ -28236,10 +23793,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) { @@ -28252,38 +23809,26 @@ 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); + 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) { @@ -28292,7 +23837,9 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 221 ? 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); @@ -28322,9 +23869,7 @@ 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, @@ -28384,8 +23929,8 @@ var ts; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var i = 0, n = wordSpans.length; i < n; i++) { - var span = wordSpans[i]; + for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } @@ -28432,15 +23977,13 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [ - match - ]; + return [match]; } } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var i = 0, n = subWordTextChunks.length; i < n; i++) { - var subWordTextChunk = subWordTextChunks[i]; + for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { return undefined; @@ -28466,10 +24009,10 @@ var ts; } } else { - for (var i = 0; i < patternPartLength; i++) { - var ch1 = pattern.charCodeAt(patternPartStart + i); - var ch2 = candidate.charCodeAt(candidateSpan.start + i); - if (ch1 !== ch2) { + for (var _i = 0; _i < patternPartLength; _i++) { + var _ch1 = pattern.charCodeAt(patternPartStart + _i); + var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); + if (_ch1 !== _ch2) { return false; } } @@ -28501,7 +24044,8 @@ 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; } } @@ -28522,7 +24066,10 @@ 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) { @@ -28671,7 +24218,11 @@ 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)); } @@ -28723,7 +24274,8 @@ 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) { @@ -28741,7 +24293,9 @@ 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 = {})); @@ -28777,7 +24331,8 @@ 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); @@ -28791,15 +24346,15 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var list = listItemInfo.list; - var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = getArgumentIndex(list, node); - var argumentCount = getArgumentCount(list); + var _list = listItemInfo.list; + var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; + 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, + kind: _isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(list), + argumentsSpan: getApplicableSpanForArguments(_list), argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -28814,28 +24369,28 @@ var ts; var templateExpression = node.parent; var tagExpression = templateExpression.parent; ts.Debug.assert(templateExpression.kind === 169); - var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); } else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { var templateSpan = node.parent; - var templateExpression = templateSpan.parent; - var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); + var _templateExpression = templateSpan.parent; + var _tagExpression = _templateExpression.parent; + ts.Debug.assert(_templateExpression.kind === 169); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); - var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); + var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); } return undefined; } 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]; + for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + var child = listChildren[_i]; if (child === node) { break; } @@ -28847,9 +24402,7 @@ var ts; } function getArgumentCount(argumentsList) { var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { - return arg.kind !== 23; - }); + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23; }); if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { argumentCount++; } @@ -28866,7 +24419,9 @@ 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, @@ -28901,9 +24456,9 @@ var ts; if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (argumentInfo) { - return argumentInfo; + var _argumentInfo = getImmediatelyContainingArgumentInfo(n); + if (_argumentInfo) { + return _argumentInfo; } } return undefined; @@ -28971,10 +24526,7 @@ 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() }; @@ -29083,9 +24635,7 @@ 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) { @@ -29099,15 +24649,11 @@ var ts; } 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) { @@ -29159,9 +24705,10 @@ var ts; return n; } 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); + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || + (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -29185,7 +24732,7 @@ var ts; return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; ++i) { + for (var i = 0, len = children.length; i < len; i++) { var child = children[i]; if (nodeHasTokens(child)) { if (position <= child.end) { @@ -29201,8 +24748,8 @@ var ts; } ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); + var _candidate = findRightmostChildNodeWithTokens(children, children.length); + return _candidate && findRightmostToken(_candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -29264,7 +24811,8 @@ 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) { @@ -29297,38 +24845,19 @@ 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) { @@ -29489,9 +25018,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { - return wasNewLine; - }, + lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -29517,21 +25044,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var t = scanner.getToken(); - if (!ts.isTrivia(t)) { + var _t = scanner.getToken(); + if (!ts.isTrivia(_t)) { break; } scanner.scan(); - var item = { + var _item = { pos: pos, end: scanner.getStartPos(), - kind: t + kind: _t }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item); + leadingTrivia.push(_item); } savedPos = scanner.getStartPos(); } @@ -29552,7 +25079,8 @@ 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; @@ -29565,7 +25093,13 @@ 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); } @@ -29628,8 +25162,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return startPos < endPos && current !== 1 && !ts.isTrivia(current); + var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return _startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -29745,7 +25279,9 @@ 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; })(); @@ -29775,7 +25311,8 @@ 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)); @@ -29815,7 +25352,8 @@ 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); @@ -29850,8 +25388,9 @@ var ts; if (this.IsAny()) { return true; } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { + for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + var check = _a[_i]; + if (!check(context)) { return false; } } @@ -29881,12 +25420,7 @@ 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)); @@ -29895,19 +25429,9 @@ 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)); @@ -29926,151 +25450,79 @@ 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)); @@ -30094,9 +25546,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; + for (var _name in o) { + if (o[_name] === rule) { + return _name; } } throw new Error("Unknown rule"); @@ -30244,7 +25696,8 @@ 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; @@ -30278,7 +25731,8 @@ 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; @@ -30321,7 +25775,8 @@ 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); @@ -30337,10 +25792,11 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) + for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + var rule = _a[_i]; + if (rule.Operation.Context.InContext(context)) { return rule; + } } } return null; @@ -30395,13 +25851,19 @@ 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) { @@ -30458,9 +25920,7 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [ - this.token - ]; + return [this.token]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -30514,68 +25974,18 @@ 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; @@ -30712,23 +26122,28 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!parent) { + var _parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!_parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), - end: parent.end + pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), + end: _parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } 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; @@ -30753,9 +26168,7 @@ 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) { @@ -30769,11 +26182,9 @@ 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; } @@ -30854,10 +26265,10 @@ var ts; } } else { - var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (startLine !== parentStartLine || startPos === column) { + if (_startLine !== parentStartLine || startPos === column) { return column; } } @@ -30867,7 +26278,10 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { + if (isSomeBlock(parent.kind) || + parent.kind === 221 || + parent.kind === 214 || + parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -30916,12 +26330,8 @@ 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) { @@ -30975,19 +26385,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > childStartPos) { + var _tokenInfo = formattingScanner.readTokenInfo(node); + if (_tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var tokenInfo = formattingScanner.readTokenInfo(child); - ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(child); + ts.Debug.assert(_tokenInfo_1.token.end === child.end); + consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -30999,33 +26409,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var startLine = parentStartLine; + var _startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.end > nodes.pos) { + var _tokenInfo = formattingScanner.readTokenInfo(parent); + if (_tokenInfo.token.end > nodes.pos) { break; } - else if (tokenInfo.token.kind === listStartToken) { - startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + else if (_tokenInfo.token.kind === listStartToken) { + _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; + var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var i = 0, len = nodes.length; i < len; ++i) { - inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, true); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); + if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { + consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); } } } @@ -31062,8 +26473,8 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { - var triviaItem = currentTokenInfo.leadingTrivia[i]; + for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } @@ -31076,8 +26487,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, commentIndentation, false); + var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, _commentIndentation, false); indentNextTokenOrTrivia = false; } break; @@ -31097,8 +26508,8 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var i = 0, len = trivia.length; i < len; ++i) { - var triviaItem = trivia[i]; + for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); @@ -31114,7 +26525,8 @@ 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; @@ -31142,7 +26554,9 @@ 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; @@ -31166,31 +26580,26 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - if (startLine === endLine) { + var parts; + if (_startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } return; } else { - var parts = []; + parts = []; var startPos = commentRange.pos; - for (var line = startLine; line < endLine; ++line) { + 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 startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -31198,19 +26607,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - startLine++; + _startLine++; } - 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 newIndentation = nonWhitespaceCharacterAndColumn.column + delta; + 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 newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); } } } @@ -31232,10 +26643,7 @@ 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) { @@ -31389,7 +26797,12 @@ 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; } @@ -31415,9 +26828,9 @@ var ts; } break; } - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation; + var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation; } previous = current; current = current.parent; @@ -31434,9 +26847,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var parent = current.parent; + var _parent = current.parent; var parentStart; - while (parent) { + while (_parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -31448,20 +26861,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + parentStart = getParentStart(_parent, current, 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) { - return actualIndentation + indentationDelta; + var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = parent; + current = _parent; currentStart = parentStart; - parent = current.parent; + _parent = current.parent; } return indentationDelta; } @@ -31482,7 +26896,8 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && + (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -31522,7 +26937,8 @@ 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; @@ -31536,25 +26952,30 @@ var ts; case 132: case 131: case 136: - case 137: + 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())) { return node.parent.parameters; } break; + } case 156: - case 155: - var start = node.getStart(sourceFile); - if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + case 155: { + var _start = node.getStart(sourceFile); + 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; + } } } return undefined; @@ -31603,10 +27024,7 @@ var ts; } character++; } - return { - column: column, - character: character - }; + return { column: column, character: character }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -31823,8 +27241,8 @@ var ts; 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++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -31838,9 +27256,10 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; + var children; if (this.kind >= 125) { scanner.setText((sourceFile || this.getSourceFile()).text); - var children = []; + children = []; var pos = this.pos; var processNode = function (node) { if (pos < node.pos) { @@ -31881,8 +27300,8 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (child.kind < 125) { return child; } @@ -31989,7 +27408,10 @@ 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); @@ -32001,7 +27423,7 @@ var ts; } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var docComments = []; + var _docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -32036,14 +27458,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && docComments.length) { + else if (!isInParamTag && _docComments.length) { blankLineCount++; } } - return docComments; + return _docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -32144,8 +27566,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42) { + var _ch = sourceFile.text.charCodeAt(pos); + if (_ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -32205,9 +27627,7 @@ 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; }; @@ -32241,7 +27661,9 @@ 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; @@ -32455,9 +27877,7 @@ 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 ""; } @@ -32473,8 +27893,8 @@ var ts; if (declaration.kind !== 193 && declaration.kind !== 195) { return false; } - for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 221 || parent.kind === 201) { + for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { + if (_parent.kind === 221 || _parent.kind === 201) { return false; } } @@ -32515,8 +27935,9 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var i = 0, n = rootFileNames.length; i < n; i++) { - this.createEntry(rootFileNames[i]); + for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + var fileName = rootFileNames[_i]; + this.createEntry(fileName); } this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); } @@ -32575,17 +27996,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var version = this.host.getScriptVersion(fileName); + var _version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); } - else if (this.currentFileVersion !== version) { + else if (this.currentFileVersion !== _version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); } if (sourceFile) { - this.currentFileVersion = version; + this.currentFileVersion = _version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -32634,9 +28055,7 @@ 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) { @@ -32647,9 +28066,7 @@ 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 @@ -32838,11 +28255,7 @@ 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) { @@ -32855,10 +28268,14 @@ 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) { @@ -32893,10 +28310,12 @@ 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 === 218 || node.parent.kind === 219) && 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) { @@ -32919,12 +28338,15 @@ 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) { @@ -32937,7 +28359,8 @@ 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; @@ -32992,44 +28415,33 @@ 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 220: - return ScriptElementKind.variableElement; - case 128: - return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + 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: @@ -33085,31 +28497,19 @@ 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(); - for (var i = 0, n = oldSourceFiles.length; i < n; i++) { - var fileName = oldSourceFiles[i].fileName; + for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + var oldSourceFile = oldSourceFiles[_i]; + var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { documentRegistry.releaseDocument(fileName, oldSettings); } @@ -33124,8 +28524,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var oldSourceFile = program && program.getSourceFile(fileName); - if (oldSourceFile) { + var _oldSourceFile = program && program.getSourceFile(fileName); + if (_oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -33142,8 +28542,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var i = 0, n = rootFileNames.length; i < n; i++) { - if (!sourceFileUpToDate(program.getSourceFile(rootFileNames[i]))) { + for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { + var _fileName = rootFileNames[_a]; + if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { return false; } } @@ -33191,12 +28592,13 @@ 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); - for (var i = 1, n = displayName.length; isValid && i < n; i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); + for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { + isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); } if (isValid) { return ts.unescapeIdentifier(displayName); @@ -33222,20 +28624,20 @@ var ts; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } - var start = new Date().getTime(); + start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var start = new Date().getTime(); + var _start = new Date().getTime(); previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); } if (previousToken && isCompletionListBlocker(previousToken)) { log("Returning an empty list because completion was requested in an invalid position."); @@ -33263,12 +28665,14 @@ var ts; typeChecker: typeInfoResolver }; log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var location = ts.getTouchingPropertyName(sourceFile, position); + var _location = ts.getTouchingPropertyName(sourceFile, position); var semanticStart = new Date().getTime(); + var isMemberCompletion; + var isNewIdentifierLocation; if (isRightOfDot) { var symbols = []; - var isMemberCompletion = true; - var isNewIdentifierLocation = false; + isMemberCompletion = true; + isNewIdentifierLocation = false; if (node.kind === 64 || node.kind === 125 || node.kind === 153) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { @@ -33322,8 +28726,8 @@ var ts; isMemberCompletion = false; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); } } if (!isMemberCompletion) { @@ -33337,9 +28741,9 @@ var ts; entries: activeCompletionSession.entries }; function getCompletionEntriesFromSymbols(symbols, session) { - var start = new Date().getTime(); + var _start_1 = new Date().getTime(); ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, location); + var entry = createCompletionEntry(symbol, session.typeChecker, _location); if (entry) { var id = ts.escapeIdentifier(entry.name); if (!ts.lookUp(session.symbols, id)) { @@ -33348,12 +28752,14 @@ var ts; } } }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); } function isCompletionListBlocker(previousToken) { - var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + var _start_1 = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); return result; } function showCompletionsInImportsClause(node) { @@ -33369,9 +28775,16 @@ 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: @@ -33381,7 +28794,8 @@ 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: @@ -33401,10 +28815,12 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var start = previousToken.getStart(); + if (previousToken.kind === 8 + || previousToken.kind === 9 + || ts.isTemplateLiteralKind(previousToken.kind)) { + var _start_1 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start < position && position < end) { + if (_start_1 < position && position < end) { return true; } else if (position === end) { @@ -33415,12 +28831,12 @@ var ts; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { if (previousToken) { - var parent = previousToken.parent; + var _parent = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (parent && parent.kind === 152) { - return parent; + if (_parent && _parent.kind === 152) { + return _parent; } break; } @@ -33448,23 +28864,43 @@ 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 === 217 || 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: @@ -33509,18 +28945,17 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { + 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; + var _name = el.propertyName || el.name; + exisingImports[_name.text] = true; }); } 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) { @@ -33536,13 +28971,13 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var filteredMembers = []; + var _filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - filteredMembers.push(s); + _filteredMembers.push(s); } }); - return filteredMembers; + return _filteredMembers; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -33553,10 +28988,10 @@ var ts; } var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); if (symbol) { - var location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, session.typeChecker, location, 7); + var _location = ts.getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); + ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -33570,9 +29005,7 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ - ts.displayPart(entryName, 5) - ], + displayParts: [ts.displayPart(entryName, 5)], documentation: undefined }; } @@ -33670,7 +29103,9 @@ 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); } @@ -33679,11 +29114,13 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); var hasAddedSymbolInfo; + var type; if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } - var type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + var signature; + type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { if (location.parent && location.parent.kind === 153) { var right = location.parent.name; @@ -33753,24 +29190,25 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { - var signature; + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || + (location.kind === 113 && location.parent.kind === 133)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = allSignatures[0]; + signature = _allSignatures[0]; } if (functionDeclaration.kind === 133) { symbolKind = ScriptElementKind.constructorImplementationElement; 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); + addSignatureDisplayParts(signature, _allSignatures); hasAddedSymbolInfo = true; } } @@ -33830,7 +29268,7 @@ var ts; } else { var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); if (signatureDeclaration.kind === 137) { displayParts.push(ts.keywordPart(87)); displayParts.push(ts.spacePart()); @@ -33838,7 +29276,7 @@ var ts; else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); } } if (symbolFlags & 8) { @@ -33888,7 +29326,9 @@ 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) { @@ -33901,9 +29341,14 @@ 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) { - var allSignatures = type.getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + else if (symbolFlags & 16 || + symbolFlags & 8192 || + symbolFlags & 16384 || + symbolFlags & 131072 || + symbolFlags & 98304 || + symbolKind === ScriptElementKind.memberFunctionElement) { + var _allSignatures_1 = type.getCallSignatures(); + addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); } } } @@ -33914,11 +29359,7 @@ 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()); @@ -33952,10 +29393,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { + var _typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, typeParameterParts); + displayParts.push.apply(displayParts, _typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -34005,26 +29446,20 @@ 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; } @@ -34055,7 +29490,8 @@ 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)); }); @@ -34072,11 +29508,12 @@ var ts; }; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; + var _declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - declarations.push(d); + if ((selectConstructors && d.kind === 133) || + (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + _declarations.push(d); if (d.body) definition = d; } @@ -34085,8 +29522,8 @@ var ts; result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); return true; } - else if (declarations.length) { - result.push(getDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); + else if (_declarations.length) { + result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); return true; } return false; @@ -34115,10 +29552,9 @@ 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: @@ -34166,7 +29602,9 @@ 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; @@ -34187,7 +29625,8 @@ 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); } } @@ -34200,8 +29639,8 @@ var ts; while (ifStatement) { var children = ifStatement.getChildren(); pushKeywordIf(keywords, children[0], 83); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 75)) { + for (var _i = children.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, children[_i], 75)) { break; } } @@ -34211,10 +29650,10 @@ var ts; ifStatement = ifStatement.elseStatement; } var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 75 && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; + for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { + if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { + var elseKeyword = keywords[_i_1]; + var ifKeyword = keywords[_i_1 + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -34228,11 +29667,11 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - i++; + _i_1++; continue; } } - result.push(getReferenceEntryFromNode(keywords[i])); + result.push(getReferenceEntryFromNode(keywords[_i_1])); } return result; } @@ -34295,17 +29734,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 221) { - return parent; + var _parent = child.parent; + if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { + return _parent; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent; + child = _parent; } return undefined; } @@ -34326,8 +29765,8 @@ var ts; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { if (loopNode.kind === 179) { var loopTokens = loopNode.getChildren(); - for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 99)) { + for (var _i = loopTokens.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, loopTokens[_i], 99)) { break; } } @@ -34390,8 +29829,8 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var node = statement.parent; node; node = node.parent) { - switch (node.kind) { + for (var _node = statement.parent; _node; _node = _node.parent) { + switch (_node.kind) { case 188: if (statement.kind === 184) { continue; @@ -34401,12 +29840,12 @@ var ts; case 183: case 180: case 179: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; + if (!statement.label || isLabeledBy(_node, statement.label.text)) { + return _node; } break; default: - if (ts.isFunctionLike(node)) { + if (ts.isFunctionLike(_node)) { return undefined; } break; @@ -34432,16 +29871,15 @@ 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; } } @@ -34485,9 +29923,7 @@ 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); @@ -34541,7 +29977,9 @@ 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); @@ -34551,9 +29989,7 @@ 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); @@ -34567,9 +30003,7 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [ - getReferenceEntryFromNode(node) - ]; + return [getReferenceEntryFromNode(node)]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -34603,7 +30037,9 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && 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) { @@ -34611,46 +30047,38 @@ var ts; }); } 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; }); + var _name; if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; + _name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(name); + _name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(_name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { - return d.kind === 160 ? d : undefined; - }); - if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; - } - else { - var name = symbol.name; - } - return stripQuotes(name); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var _name = functionExpression && functionExpression.name + ? functionExpression.name.text + : symbol.name; + return stripQuotes(_name); } function stripQuotes(name) { - var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { - return name.substring(1, length - 1); + var _length = name.length; + if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { + return name.substring(1, _length - 1); } ; return name; } 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); } @@ -34661,24 +30089,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var scope = undefined; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var i = 0, n = declarations.length; i < n; i++) { - var container = getContainerNode(declarations[i]); + var _scope = undefined; + var _declarations = symbol.getDeclarations(); + if (_declarations) { + for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { + var declaration = _declarations[_i]; + var container = getContainerNode(declaration); if (!container) { return undefined; } - if (scope && scope !== container) { + if (_scope && _scope !== container) { return undefined; } if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } - scope = container; + _scope = container; } } - return scope; + return _scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -34694,7 +30123,8 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -34702,21 +30132,22 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var result = []; + var _result = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - result.push(getReferenceEntryFromNode(node)); + if (_node === targetLabel || + (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function isValidReferencePosition(node, searchSymbolName) { if (node) { @@ -34724,7 +30155,8 @@ 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; @@ -34747,7 +30179,8 @@ 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), @@ -34812,21 +30245,21 @@ var ts; default: return undefined; } - var result = []; + var _result = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 90) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 90) { return; } - var container = ts.getSuperContainer(node, false); + var container = ts.getSuperContainer(_node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - result.push(getReferenceEntryFromNode(node)); + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); @@ -34855,48 +30288,49 @@ var ts; default: return undefined; } - var result = []; + var _result = []; + var possiblePositions; if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); } - return result; + return _result; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 92) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 92) { return; } - var container = ts.getThisContainer(node, false); + var container = ts.getThisContainer(_node, false); switch (searchSpaceNode.kind) { case 160: case 195: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 132: case 131: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 196: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 221: if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; } @@ -34904,30 +30338,28 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [ - symbol - ]; + var _result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + _result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - result.push(shorthandValueSymbol); + _result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - result.push(rootSymbol); + _result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); } }); - return result; + return _result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { @@ -34959,14 +30391,13 @@ 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) { @@ -34974,11 +30405,9 @@ var ts; return true; } 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; - }); + var _result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); } return false; }); @@ -34987,32 +30416,28 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name = node.text; + var _name = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name); + var unionProperty = contextualType.getProperty(_name); if (unionProperty) { - return [ - unionProperty - ]; + return [unionProperty]; } else { - var result = []; + var _result = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result.push(symbol); + var _symbol = t.getProperty(_name); + if (_symbol) { + _result.push(_symbol); } }); - return result; + return _result; } } else { - var symbol = contextualType.getProperty(name); - if (symbol) { - return [ - symbol - ]; + var _symbol = contextualType.getProperty(_name); + if (_symbol) { + return [_symbol]; } } } @@ -35021,10 +30446,12 @@ var ts; } function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { + var lastIterationMeaning; do { - var lastIterationMeaning = meaning; - for (var i = 0, n = declarations.length; i < n; i++) { - var declarationMeaning = getMeaningFromDeclaration(declarations[i]); + lastIterationMeaning = meaning; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; + var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; } @@ -35051,13 +30478,13 @@ var ts; if (node.kind === 64 && ts.isDeclarationName(node)) { return true; } - var parent = node.parent; - if (parent) { - if (parent.kind === 166 || parent.kind === 165) { + var _parent = node.parent; + if (_parent) { + if (_parent.kind === 166 || _parent.kind === 165) { return true; } - else if (parent.kind === 167 && parent.left === node) { - var operator = parent.operatorToken.kind; + else if (_parent.kind === 167 && _parent.left === node) { + var operator = _parent.operatorToken.kind; return 52 <= operator && operator <= 63; } } @@ -35068,9 +30495,7 @@ 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(); @@ -35164,7 +30589,9 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { + if (node.parent.kind === 125 && + node.parent.right === node && + node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; @@ -35223,7 +30650,8 @@ 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 { @@ -35270,7 +30698,8 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || + (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -35395,11 +30824,16 @@ 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; } } @@ -35453,8 +30887,8 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); } @@ -35478,8 +30912,8 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var i = 0, n = childNodes.length; i < n; i++) { - var current = childNodes[i]; + for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); @@ -35497,22 +30931,14 @@ 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; } @@ -35521,7 +30947,7 @@ var ts; var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); return result; @@ -35567,9 +30993,9 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; + for (var _i = 0, n = descriptors.length; _i < n; _i++) { + if (matchArray[_i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[_i]; } } ts.Debug.assert(descriptor !== undefined); @@ -35592,18 +31018,18 @@ var ts; var singleLineCommentStart = /(?:\/\/+\s*)/.source; 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 _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; 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) { @@ -35617,9 +31043,10 @@ var ts; if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var i = 0; i < declarations.length; i++) { - var sourceFile = declarations[i].getSourceFile(); - if (sourceFile && getCanonicalFileName(ts.normalizePath(sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var _sourceFile = current.getSourceFile(); + if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -35704,7 +31131,9 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || + node.parent.kind === 213 || + isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -35714,10 +31143,13 @@ 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); + var _scanner = ts.createScanner(2, false); var noRegexTable = []; noRegexTable[64] = true; noRegexTable[8] = true; @@ -35743,7 +31175,10 @@ 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; @@ -35781,17 +31216,17 @@ var ts; templateStack.push(11); break; } - scanner.setText(text); + _scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = scanner.scan(); + token = _scanner.scan(); if (!ts.isTrivia(token)) { if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9) { + if (_scanner.reScanSlashToken() === 9) { token = 9; } } @@ -35801,13 +31236,18 @@ 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; } @@ -35824,7 +31264,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = scanner.reScanTemplateToken(); + token = _scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -35844,13 +31284,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = scanner.getTokenPos(); - var end = scanner.getTextPos(); + var start = _scanner.getTokenPos(); + var end = _scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = scanner.getTokenText(); - if (scanner.isUnterminated()) { + var tokenText = _scanner.getTokenText(); + if (_scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -35858,17 +31298,19 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 ? 3 : 2; + result.finalLexState = quoteChar === 34 + ? 3 + : 2; } } } else if (token === 3) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -35890,10 +31332,7 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ - length: length, - classification: classification - }); + result.entries.push({ length: length, classification: classification }); } } } @@ -35988,9 +31427,7 @@ var ts; return 5; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -36014,15 +31451,9 @@ 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(); @@ -36196,12 +31627,17 @@ 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) { @@ -36222,7 +31658,8 @@ 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)) { @@ -36240,7 +31677,8 @@ 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) { @@ -36492,21 +31930,15 @@ 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 () { @@ -36556,9 +31988,7 @@ 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 c0800ecbd77..a557e814a79 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -1200,8 +1200,6 @@ declare module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1443,7 +1441,7 @@ declare module ts { } declare module ts { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; @@ -1451,7 +1449,7 @@ declare module ts { } declare module ts { /** The version of the language service API */ - var servicesVersion: string; + let servicesVersion: string; interface Node { getSourceFile(): SourceFile; getChildCount(sourceFile?: SourceFile): number; @@ -1938,7 +1936,7 @@ declare module ts { throwIfCancellationRequested(): void; } function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - var disableIncrementalParsing: boolean; + let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; function createDocumentRegistry(): DocumentRegistry; function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 0fb345eea1b..9e939631006 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -625,8 +625,9 @@ var ts; ts.forEach = forEach; function contains(array, value) { if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (v === value) { return true; } } @@ -648,8 +649,9 @@ var ts; function countWhere(array, predicate) { var count = 0; if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + if (predicate(v)) { count++; } } @@ -658,12 +660,13 @@ var ts; } ts.countWhere = countWhere; function filter(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (f(_item)) { + result.push(_item); } } } @@ -671,10 +674,12 @@ var ts; } ts.filter = filter; function map(array, f) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result.push(f(v)); } } return result; @@ -689,12 +694,14 @@ var ts; } ts.concatenate = concatenate; function deduplicate(array) { + var result; if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); + result = []; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var _item = array[_i]; + if (!contains(result, _item)) { + result.push(_item); + } } } return result; @@ -702,15 +709,17 @@ var ts; ts.deduplicate = deduplicate; function sum(array, prop) { var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var v = array[_i]; + result += v[prop]; } return result; } ts.sum = sum; function addRange(to, from) { - for (var i = 0, n = from.length; i < n; i++) { - to.push(from[i]); + for (var _i = 0, _n = from.length; _i < _n; _i++) { + var v = from[_i]; + to.push(v); } } ts.addRange = addRange; @@ -771,9 +780,9 @@ var ts; for (var id in first) { result[id] = first[id]; } - for (var id in second) { - if (!hasProperty(result, id)) { - result[id] = second[id]; + for (var _id in second) { + if (!hasProperty(result, _id)) { + result[_id] = second[_id]; } } return result; @@ -825,13 +834,13 @@ 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) { @@ -902,7 +911,12 @@ 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) { @@ -929,9 +943,7 @@ 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]; @@ -972,8 +984,8 @@ var ts; function getNormalizedParts(normalizedSlashedPath, rootLength) { var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; + for (var _i = 0, _n = parts.length; _i < _n; _i++) { + var part = parts[_i]; if (part !== ".") { if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { normalized.pop(); @@ -988,7 +1000,7 @@ var ts; return normalized; } function normalizePath(path) { - var path = normalizeSlashes(path); + path = normalizeSlashes(path); var rootLength = getRootLength(path); var normalized = getNormalizedParts(path, rootLength); return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); @@ -1008,12 +1020,10 @@ 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); + path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { path = combinePaths(normalizeSlashes(currentDirectory), path); @@ -1044,9 +1054,7 @@ var ts; } } if (rootLength === urlLength) { - return [ - url - ]; + return [url]; } var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { @@ -1054,9 +1062,7 @@ var ts; return normalizedPathComponents(url, rootLength); } else { - return [ - url + ts.directorySeparator - ]; + return [url + ts.directorySeparator]; } } function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { @@ -1118,14 +1124,10 @@ 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]; + for (var _i = 0, _n = supportedExtensions.length; _i < _n; _i++) { + var ext = supportedExtensions[_i]; if (fileExtensionIs(path, ext)) { return path.substr(0, path.length - ext.length); } @@ -1176,15 +1178,9 @@ 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"; @@ -1289,15 +1285,16 @@ var ts; function visitDirectory(path) { var folder = fso.GetFolder(path || "."); var files = getNames(folder.files); - for (var i = 0; i < files.length; i++) { - var name = files[i]; - if (!extension || ts.fileExtensionIs(name, extension)) { - result.push(ts.combinePaths(path, name)); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var _name = files[_i]; + if (!extension || ts.fileExtensionIs(_name, extension)) { + result.push(ts.combinePaths(path, _name)); } } var subfolders = getNames(folder.subfolders); - for (var i = 0; i < subfolders.length; i++) { - visitDirectory(ts.combinePaths(path, subfolders[i])); + for (var _a = 0, _b = subfolders.length; _a < _b; _a++) { + var current = subfolders[_a]; + visitDirectory(ts.combinePaths(path, current)); } } } @@ -1382,8 +1379,9 @@ var ts; function visitDirectory(path) { var files = _fs.readdirSync(path || ".").sort(); var directories = []; - for (var i = 0; i < files.length; i++) { - var name = ts.combinePaths(path, files[i]); + for (var _i = 0, _n = files.length; _i < _n; _i++) { + var current = files[_i]; + var name = ts.combinePaths(path, current); var stat = _fs.lstatSync(name); if (stat.isFile()) { if (!extension || ts.fileExtensionIs(name, extension)) { @@ -1394,8 +1392,9 @@ var ts; directories.push(name); } } - for (var i = 0; i < directories.length; i++) { - visitDirectory(directories[i]); + for (var _a = 0, _b = directories.length; _a < _b; _a++) { + var _current = directories[_a]; + visitDirectory(_current); } } } @@ -1409,14 +1408,9 @@ 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) { @@ -1472,2431 +1466,491 @@ var 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." - } + 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; @@ -4013,2806 +2067,10 @@ 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; @@ -6836,17 +2094,21 @@ 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 = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; + for (var _name in source) { + if (source.hasOwnProperty(_name)) { + result[source[_name]] = _name; } } return result; @@ -6913,7 +2175,9 @@ 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) { @@ -7000,7 +2264,8 @@ var ts; return false; } } - return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 || + text.charCodeAt(pos + mergeConflictMarkerLength) === 32; } } return false; @@ -7019,8 +2284,8 @@ var ts; else { ts.Debug.assert(ch === 61); while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 62 && isConflictMarkerTrivia(text, pos)) { + var _ch = text.charCodeAt(pos); + if (_ch === 62 && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -7080,11 +2345,7 @@ var ts; if (collecting) { if (!result) result = []; - result.push({ - pos: startPos, - end: pos, - hasTrailingNewLine: hasTrailingNewLine - }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); } continue; } @@ -7111,11 +2372,15 @@ 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) { @@ -7134,10 +2399,14 @@ 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; @@ -7414,8 +2683,8 @@ var ts; return result; } function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { + var _len = tokenValue.length; + if (_len >= 2 && _len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; @@ -7567,13 +2836,13 @@ var ts; pos += 2; var commentClosed = false; while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 && text.charCodeAt(pos + 1) === 47) { + var _ch = text.charCodeAt(pos); + if (_ch === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } - if (isLineBreak(ch)) { + if (isLineBreak(_ch)) { precedingLineBreak = true; } pos++; @@ -7606,22 +2875,22 @@ var ts; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; - var value = scanBinaryOrOctalDigits(2); - if (value < 0) { + var _value = scanBinaryOrOctalDigits(2); + if (_value < 0) { error(ts.Diagnostics.Binary_digit_expected); - value = 0; + _value = 0; } - tokenValue = "" + value; + tokenValue = "" + _value; return token = 7; } else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; - var value = scanBinaryOrOctalDigits(8); - if (value < 0) { + var _value_1 = scanBinaryOrOctalDigits(8); + if (_value_1 < 0) { error(ts.Diagnostics.Octal_digit_expected); - value = 0; + _value_1 = 0; } - tokenValue = "" + value; + tokenValue = "" + _value_1; return token = 7; } if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { @@ -7720,10 +2989,10 @@ var ts; case 126: return pos++, token = 47; case 92: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); @@ -7860,39 +3129,17 @@ 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, @@ -7909,8 +3156,8 @@ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if (declaration.kind === kind) { return declaration; } @@ -7922,13 +3169,9 @@ 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, @@ -7936,18 +3179,11 @@ 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(); @@ -7969,7 +3205,8 @@ 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; } @@ -8048,7 +3285,8 @@ 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) { @@ -8076,7 +3314,10 @@ var ts; } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { - return declaration && declaration.kind === 193 && declaration.parent && declaration.parent.kind === 217; + return declaration && + declaration.kind === 193 && + declaration.parent && + declaration.parent.kind === 217; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; function declarationNameToString(name) { @@ -8128,7 +3369,9 @@ 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; @@ -8191,7 +3434,9 @@ 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; @@ -8394,8 +3639,8 @@ var ts; } case 7: case 8: - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -8403,7 +3648,7 @@ var ts; case 220: case 218: case 150: - return parent.initializer === node; + return _parent.initializer === node; case 177: case 178: case 179: @@ -8414,22 +3659,25 @@ var ts; case 214: case 190: case 188: - return parent.expression === node; + return _parent.expression === node; case 181: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 194) || forStatement.condition === node || forStatement.iterator === node; + var forStatement = _parent; + 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; + var forInStatement = _parent; + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 194) || + forInStatement.expression === node; case 158: - return node === parent.expression; + return node === _parent.expression; case 173: - return node === parent.expression; + return node === _parent.expression; case 126: - return node === parent.expression; + return node === _parent.expression; default: - if (isExpression(parent)) { + if (isExpression(_parent)) { return true; } } @@ -8439,7 +3687,8 @@ 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) { @@ -8587,14 +3836,14 @@ var ts; if (name.kind !== 64 && name.kind !== 8 && name.kind !== 7) { return false; } - var parent = name.parent; - if (parent.kind === 208 || parent.kind === 212) { - if (parent.propertyName) { + var _parent = name.parent; + if (_parent.kind === 208 || _parent.kind === 212) { + if (_parent.propertyName) { return true; } } - if (isDeclaration(parent)) { - return parent.name === name; + if (isDeclaration(_parent)) { + return _parent.name === name; } return false; } @@ -8616,9 +3865,10 @@ var ts; ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; function getHeritageClause(clauses, kind) { if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - if (clauses[i].token === kind) { - return clauses[i]; + for (var _i = 0, _n = clauses.length; _i < _n; _i++) { + var clause = clauses[_i]; + if (clause.token === kind) { + return clause; } } } @@ -8686,7 +3936,9 @@ 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) { @@ -8790,10 +4042,7 @@ 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) { @@ -8812,10 +4061,7 @@ 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); @@ -8863,7 +4109,7 @@ var ts; ts.createSynthesizedNode = createSynthesizedNode; function generateUniqueName(baseName, isExistingName) { if (baseName.charCodeAt(0) !== 95) { - var baseName = "_" + baseName; + baseName = "_" + baseName; if (!isExistingName(baseName)) { return baseName; } @@ -8873,9 +4119,9 @@ var ts; } var i = 1; while (true) { - var name = baseName + i; - if (!isExistingName(name)) { - return name; + var _name = baseName + i; + if (!isExistingName(_name)) { + return _name; } i++; } @@ -8976,9 +4222,9 @@ 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 = {})); @@ -9006,8 +4252,9 @@ var ts; } function visitEachNode(cbNode, nodes) { if (nodes) { - for (var i = 0, len = nodes.length; i < len; i++) { - var result = cbNode(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + var result = cbNode(node); if (result) { return result; } @@ -9022,9 +4269,12 @@ 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: @@ -9032,13 +4282,22 @@ var ts; 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: @@ -9047,9 +4306,17 @@ 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: @@ -9070,16 +4337,23 @@ 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: @@ -9091,91 +4365,142 @@ 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 221: - return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); + 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) || visitNode(cbNode, node.caseBlock); + 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); + 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); + return visitNode(cbNode, node.tryBlock) || + visitNode(cbNode, node.catchClause) || + visitNode(cbNode, node.finallyBlock); case 217: - return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); + 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); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNodes, node.members); case 220: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 200: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.body); case 203: - 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.moduleReference); case 204: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.importClause) || + visitNode(cbNode, node.moduleSpecifier); case 205: - return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.namedBindings); case 206: return visitNode(cbNode, node.name); case 207: case 211: return visitNodes(cbNodes, node.elements); case 210: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.exportClause) || + visitNode(cbNode, node.moduleSpecifier); case 208: case 212: - return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + return visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name); case 209: - return visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.expression); + return visitNodes(cbNodes, node.modifiers) || + visitNode(cbNode, node.expression); case 169: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 173: @@ -9222,84 +4547,55 @@ 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; } ts.modifierToFlag = modifierToFlag; function fixupParentReferences(sourceFile) { - var parent = sourceFile; + var _parent = sourceFile; forEachChild(sourceFile, visitNode); return; function visitNode(n) { - if (n.parent !== parent) { - n.parent = parent; - var saveParent = parent; - parent = n; + if (n.parent !== _parent) { + n.parent = _parent; + var saveParent = _parent; + _parent = n; forEachChild(n, visitNode); - parent = saveParent; + _parent = saveParent; } } } @@ -9337,8 +4633,9 @@ var ts; array._children = undefined; array.pos += delta; array.end += delta; - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } } } @@ -9400,8 +4697,9 @@ var ts; array.intersectsChange = true; array._children = undefined; adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var i = 0, n = array.length; i < n; i++) { - visitNode(array[i]); + for (var _i = 0, _n = array.length; _i < _n; _i++) { + var node = array[_i]; + visitNode(node); } return; } @@ -9515,7 +4813,8 @@ 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) { @@ -9697,8 +4996,8 @@ var ts; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - parseErrorAtPosition(start, length, message, arg0); + var _length = scanner.getTextPos() - start; + parseErrorAtPosition(start, _length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); @@ -9737,7 +5036,9 @@ 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; @@ -9788,7 +5089,8 @@ 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); @@ -9865,7 +5167,9 @@ 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) { @@ -9918,7 +5222,10 @@ 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(); @@ -9976,7 +5283,8 @@ var ts; return isIdentifier(); } function isNotHeritageClauseTypeName() { - if (token === 102 || token === 78) { + if (token === 102 || + token === 78) { return lookAhead(nextTokenIsIdentifier); } return false; @@ -10357,7 +5665,9 @@ 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; @@ -10396,7 +5706,9 @@ var ts; } function parseParameterType() { if (parseOptional(51)) { - return token === 8 ? parseLiteralNode(true) : parseType(); + return token === 8 + ? parseLiteralNode(true) + : parseType(); } return undefined; } @@ -10511,11 +5823,11 @@ var ts; } function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (token === 16 || token === 24) { var method = createNode(131, fullStart); - method.name = name; + method.name = _name; method.questionToken = questionToken; fillSignature(51, false, false, method); parseTypeMemberSemicolon(); @@ -10523,7 +5835,7 @@ var ts; } else { var property = createNode(129, fullStart); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -10554,7 +5866,11 @@ 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) { @@ -10562,7 +5878,9 @@ 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); @@ -10584,7 +5902,9 @@ var ts; } function parseIndexSignatureWithModifiers() { var modifiers = parseModifiers(); - return isIndexSignature() ? parseIndexSignatureDeclaration(modifiers) : undefined; + return isIndexSignature() + ? parseIndexSignatureDeclaration(modifiers) + : undefined; } function isStartOfConstructSignature() { nextToken(); @@ -10690,9 +6010,7 @@ 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()); @@ -10717,7 +6035,9 @@ 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) { @@ -10842,10 +6162,16 @@ var ts; nextToken(); return !scanner.hasPrecedingLineBreak() && isIdentifier(); } + function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && + (isIdentifier() || token === 14 || token === 18); + } 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); @@ -10860,9 +6186,7 @@ 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); @@ -10874,7 +6198,9 @@ 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; } @@ -11096,7 +6422,9 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 90 ? parseSuperExpression() : parseMemberExpressionOrHigher(); + var expression = token === 90 + ? parseSuperExpression() + : parseMemberExpressionOrHigher(); return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { @@ -11150,7 +6478,9 @@ 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; } @@ -11173,10 +6503,10 @@ var ts; continue; } else if (token === 16) { - var callExpr = createNode(155, expression.pos); - callExpr.expression = expression; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); + var _callExpr = createNode(155, expression.pos); + _callExpr.expression = expression; + _callExpr.arguments = parseArgumentList(); + expression = finishNode(_callExpr); continue; } return expression; @@ -11196,7 +6526,9 @@ var ts; if (!parseExpected(25)) { return undefined; } - return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; + return typeArguments && canFollowTypeArgumentsInExpression() + ? typeArguments + : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { @@ -11271,7 +6603,9 @@ 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); @@ -11826,15 +7160,15 @@ var ts; } function parsePropertyOrMethodDeclaration(fullStart, modifiers) { var asteriskToken = parseOptionalToken(35); - var name = parsePropertyName(); + var _name = parsePropertyName(); var questionToken = parseOptionalToken(50); if (asteriskToken || token === 16 || token === 24) { - return parseMethodDeclaration(fullStart, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); + return parseMethodDeclaration(fullStart, modifiers, asteriskToken, _name, questionToken, ts.Diagnostics.or_expected); } else { var property = createNode(130, fullStart); setModifiers(property, modifiers); - property.name = name; + property.name = _name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); property.initializer = allowInAnd(parseNonParameterInitializer); @@ -11921,7 +7255,11 @@ 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."); @@ -11934,7 +7272,9 @@ 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 { @@ -11944,7 +7284,9 @@ var ts; } function parseHeritageClauses(isClassHeritageClause) { if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() ? doOutsideOfYieldContext(parseHeritageClausesWorker) : parseHeritageClausesWorker(); + return isClassHeritageClause && inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseHeritageClausesWorker) + : parseHeritageClausesWorker(); } return undefined; } @@ -12023,7 +7365,9 @@ 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) { @@ -12035,17 +7379,21 @@ 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); @@ -12065,7 +7413,9 @@ var ts; } 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); } @@ -12078,13 +7428,16 @@ var ts; if (identifier) { importClause.name = identifier; } - if (!importClause.name || parseOptional(23)) { + 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(213); @@ -12172,7 +7525,7 @@ var ts; return finishNode(node); } function isLetDeclaration() { - return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOnSameLine); + return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart() { switch (token) { @@ -12214,11 +7567,13 @@ 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(); @@ -12272,7 +7627,9 @@ 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); @@ -12287,10 +7644,7 @@ 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) { @@ -12321,10 +7675,7 @@ 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); } } @@ -12336,7 +7687,13 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 || node.kind === 203 && node.moduleReference.kind === 213 || node.kind === 204 || node.kind === 209 || node.kind === 210 ? node : undefined; + return node.flags & 1 + || node.kind === 203 && node.moduleReference.kind === 213 + || node.kind === 204 + || node.kind === 209 + || node.kind === 210 + ? node + : undefined; }); } } @@ -12424,7 +7781,7 @@ var ts; } ts.bindSourceFile = bindSourceFile; function bindSourceFileWorker(file) { - var parent; + var _parent; var container; var blockScopeContainer; var lastContainer; @@ -12497,19 +7854,22 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); + var _name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + var symbol; + if (_name !== undefined) { + symbol = ts.hasProperty(symbols, _name) ? symbols[_name] : (symbols[_name] = createSymbol(0, _name)); if (symbol.flags & excludes) { 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))); }); file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0, name); + symbol = createSymbol(0, _name); } } else { @@ -12550,7 +7910,9 @@ 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; @@ -12564,10 +7926,10 @@ var ts; if (symbolKind & 255504) { node.locals = {}; } - var saveParent = parent; + var saveParent = _parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; - parent = node; + _parent = node; if (symbolKind & 262128) { container = node; if (lastContainer) { @@ -12580,7 +7942,7 @@ var ts; } ts.forEachChild(node, bind); container = saveContainer; - parent = saveParent; + _parent = saveParent; blockScopeContainer = savedBlockScopeContainer; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -12683,7 +8045,7 @@ var ts; return "__" + ts.indexOf(node.parent.parameters, node); } function bind(node) { - node.parent = parent; + node.parent = _parent; switch (node.kind) { case 127: bindDeclaration(node, 262144, 530912, false); @@ -12817,10 +8179,10 @@ var ts; bindChildren(node, 0, true); break; default: - var saveParent = parent; - parent = node; + var saveParent = _parent; + _parent = node; ts.forEachChild(node, bind); - parent = saveParent; + _parent = saveParent; } } function bindParameter(node) { @@ -12830,7 +8192,9 @@ 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); } @@ -12861,25 +8225,15 @@ var ts; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var emitResolver = createResolver(); + var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); + var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); 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, @@ -12909,8 +8263,6 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfExternalModule: getExportsOfExternalModule }; - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); var anyType = createIntrinsicType(1, "any"); @@ -12975,7 +8327,9 @@ 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) { @@ -13061,7 +8415,8 @@ 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)); }); @@ -13248,18 +8603,18 @@ var ts; } 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; - }); + 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) { + 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) { + else if (variableDeclaration.parent.parent.kind === 183 || + variableDeclaration.parent.parent.kind === 182) { var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -13280,12 +8635,15 @@ var ts; return false; } function isAliasSymbolDeclaration(node) { - return node.kind === 203 || node.kind === 205 && !!node.name || node.kind === 206 || node.kind === 208 || node.kind === 212 || node.kind === 209; + 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 === 213) { @@ -13311,11 +8669,11 @@ var ts; function getExternalModuleMember(node, specifier) { var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol) { - var name = specifier.propertyName || specifier.name; - if (name.text) { - var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), name.text, 107455 | 793056 | 1536); + var _name = specifier.propertyName || specifier.name; + if (_name.text) { + var symbol = getSymbol(getExportsOfSymbol(moduleSymbol), _name.text, 107455 | 793056 | 1536); if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(_name)); return; } return symbol.flags & (107455 | 793056 | 1536) ? symbol : resolveAlias(symbol); @@ -13326,7 +8684,9 @@ 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); @@ -13412,8 +8772,9 @@ var ts; if (ts.getFullWidth(name) === 0) { return undefined; } + var symbol; if (name.kind === 64) { - var symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); + symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } @@ -13424,7 +8785,7 @@ var ts; return undefined; } var right = name.right; - var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); + symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); return undefined; @@ -13452,14 +8813,17 @@ var ts; return symbol; } } + var sourceFile; while (true) { var fileName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); - if (sourceFile || isRelative) + sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); + if (sourceFile || isRelative) { break; + } var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) + if (parentPath === searchPath) { break; + } searchPath = parentPath; } if (sourceFile) { @@ -13541,7 +8905,9 @@ 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) { @@ -13557,8 +8923,8 @@ var ts; } function findConstructorDeclaration(node) { var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; + for (var _i = 0, _n = members.length; _i < _n; _i++) { + var member = members[_i]; if (member.kind === 133 && ts.nodeIsPresent(member.body)) { return member; } @@ -13580,7 +8946,10 @@ 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; @@ -13614,25 +8983,25 @@ var ts; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { + for (var _location = enclosingDeclaration; _location; _location = _location.parent) { + if (_location.locals && !isGlobalSourceFile(_location)) { + if (result = callback(_location.locals)) { return result; } } - switch (location.kind) { + switch (_location.kind) { case 221: - if (!ts.isExternalModule(location)) { + if (!ts.isExternalModule(_location)) { break; } case 200: - if (result = callback(getSymbolOfNode(location).exports)) { + if (result = callback(getSymbolOfNode(_location).exports)) { return result; } break; case 196: case 197: - if (result = callback(getSymbolOfNode(location).members)) { + if (result = callback(getSymbolOfNode(_location).members)) { return result; } break; @@ -13654,28 +9023,24 @@ 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); } } } @@ -13740,9 +9105,7 @@ var ts; errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { - accessibility: 0 - }; + return { accessibility: 0 }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -13752,22 +9115,20 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 200 && declaration.name.kind === 8) || (declaration.kind === 221 && 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 === 203 && !(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)) { @@ -13775,9 +9136,7 @@ var ts; } } else { - aliasesToMakeVisible = [ - declaration - ]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -13791,7 +9150,8 @@ var ts; if (entityName.parent.kind === 142) { meaning = 107455 | 1048576; } - else if (entityName.kind === 125 || entityName.parent.kind === 203) { + else if (entityName.kind === 125 || + entityName.parent.kind === 203) { meaning = 1536; } else { @@ -13877,12 +9237,14 @@ 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) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]); + for (var _i = 0, _n = accessibleSymbolChain.length; _i < _n; _i++) { + var accessibleSymbol = accessibleSymbolChain[_i]; + appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } } else { @@ -13909,7 +9271,8 @@ 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); @@ -14002,14 +9365,16 @@ 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 === 221 || 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)); } } } @@ -14061,15 +9426,17 @@ var ts; writePunctuation(writer, 14); writer.writeLine(); writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + for (var _i = 0, _a = resolved.callSignatures, _n = _a.length; _i < _n; _i++) { + var signature = _a[_i]; + buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.constructSignatures.length; i++) { + for (var _b = 0, _c = resolved.constructSignatures, _d = _c.length; _b < _d; _b++) { + var _signature = _c[_b]; writeKeyword(writer, 87); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -14099,17 +9466,18 @@ var ts; writePunctuation(writer, 22); writer.writeLine(); } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; + for (var _e = 0, _f = resolved.properties, _g = _f.length; _e < _g; _e++) { + var p = _f[_e]; var t = getTypeOfSymbol(p); if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0); - for (var j = 0; j < signatures.length; j++) { + for (var _h = 0, _j = signatures.length; _h < _j; _h++) { + var _signature_1 = signatures[_h]; buildSymbolDisplay(p, writer); if (p.flags & 536870912) { writePunctuation(writer, 50); } - buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); + buildSignatureDisplay(_signature_1, writer, enclosingDeclaration, globalFlagsToPass, typeStack); writePunctuation(writer, 22); writer.writeLine(); } @@ -14247,10 +9615,11 @@ var ts; } function isUsedInExportAssignment(node) { var externalModule = getContainingExternalModule(node); + var exportAssignmentSymbol; + var resolvedExportSymbol; if (externalModule) { var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; + exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; @@ -14290,11 +9659,12 @@ var ts; case 195: case 199: case 203: - var parent = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && !(node.kind !== 203 && parent.kind !== 221 && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); + var _parent = getDeclarationContainer(node); + if (!(ts.getCombinedNodeFlags(node) & 1) && + !(node.kind !== 203 && _parent.kind !== 221 && ts.isInAmbientContext(_parent))) { + return isGlobalSourceFile(_parent) || isUsedInExportAssignment(node); } - return isDeclarationVisible(parent); + return isDeclarationVisible(_parent); case 130: case 129: case 134: @@ -14346,9 +9716,7 @@ 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); @@ -14366,11 +9734,14 @@ var ts; } return parentType; } + var type; 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 _name = declaration.propertyName || declaration.name; + 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)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(_name)); return unknownType; } } @@ -14381,7 +9752,7 @@ var ts; } if (!declaration.dotDotDotToken) { var propName = "" + ts.indexOf(pattern.elements, declaration); - var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); if (!type) { 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); @@ -14393,7 +9764,7 @@ var ts; } } else { - var type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(getIndexTypeOfType(parentType, 1)); } } return type; @@ -14445,8 +9816,8 @@ var ts; var members = {}; ts.forEach(pattern.elements, function (e) { var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); - var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); + var _name = e.propertyName || e.name; + var symbol = createSymbol(flags, _name.text); symbol.type = getTypeFromBindingElement(e); members[symbol.name] = symbol; }); @@ -14464,7 +9835,9 @@ 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); @@ -14508,7 +9881,9 @@ 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)); } } @@ -14569,8 +9944,8 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 134); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + var _getter = ts.getDeclarationOfKind(symbol, 134); + error(_getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } } @@ -14642,9 +10017,7 @@ 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); @@ -14749,8 +10122,8 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 198); - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); + var _declaration = ts.getDeclarationOfKind(symbol, 198); + error(_declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; } @@ -14806,23 +10179,23 @@ var ts; } function createSymbolTable(symbols) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = symbol; } return result; } function createInstantiatedSymbolTable(symbols, mapper) { var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; + for (var _i = 0, _n = symbols.length; _i < _n; _i++) { + var symbol = symbols[_i]; result[symbol.name] = instantiateSymbol(symbol, mapper); } return result; } function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; + for (var _i = 0, _n = baseSymbols.length; _i < _n; _i++) { + var s = baseSymbols[_i]; if (!ts.hasProperty(symbols, s.name)) { symbols[s.name] = s; } @@ -14830,8 +10203,9 @@ var ts; } function addInheritedSignatures(signatures, baseSignatures) { if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); + for (var _i = 0, _n = baseSignatures.length; _i < _n; _i++) { + var signature = baseSignatures[_i]; + signatures.push(signature); } } } @@ -14890,15 +10264,14 @@ 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 = {}; @@ -14927,17 +10300,16 @@ 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) { + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; + if (signature.typeParameters) { return emptyArray; } } - for (var i = 1; i < signatureLists.length; i++) { - if (!signatureListsIdentical(signatures, signatureLists[i])) { + for (var _i_1 = 1; _i_1 < signatureLists.length; _i_1++) { + if (!signatureListsIdentical(signatures, signatureLists[_i_1])) { return emptyArray; } } @@ -14945,16 +10317,15 @@ 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; } function getUnionIndexType(types, kind) { var indexTypes = []; - for (var i = 0; i < types.length; i++) { - var indexType = getIndexTypeOfType(types[i], kind); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + var indexType = getIndexTypeOfType(type, kind); if (!indexType) { return undefined; } @@ -14971,17 +10342,22 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; + var members; + var callSignatures; + var constructSignatures; + var stringIndexType; + var numberIndexType; if (symbol.flags & 2048) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1); + members = symbol.members; + callSignatures = getSignaturesOfSymbol(members["__call"]); + constructSignatures = getSignaturesOfSymbol(members["__new"]); + stringIndexType = getIndexTypeOfSymbol(symbol, 0); + numberIndexType = getIndexTypeOfSymbol(symbol, 1); } else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; + members = emptySymbols; + callSignatures = emptyArray; + constructSignatures = emptyArray; if (symbol.flags & 1952) { members = getExportsOfSymbol(symbol); } @@ -14999,8 +10375,8 @@ var ts; addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 384) ? stringType : undefined; + stringIndexType = undefined; + numberIndexType = (symbol.flags & 384) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -15083,17 +10459,16 @@ var ts; function createUnionProperty(unionType, name) { var types = unionType.types; var props; - for (var i = 0; i < types.length; i++) { - var type = getApparentType(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); if (!prop) { return undefined; } if (!props) { - props = [ - prop - ]; + props = [prop]; } else { props.push(prop); @@ -15102,12 +10477,12 @@ var ts; } var propTypes = []; var declarations = []; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (prop.declarations) { - declarations.push.apply(declarations, prop.declarations); + for (var _a = 0, _b = props.length; _a < _b; _a++) { + var _prop = props[_a]; + if (_prop.declarations) { + declarations.push.apply(declarations, _prop.declarations); } - propTypes.push(getTypeOfSymbol(prop)); + propTypes.push(getTypeOfSymbol(_prop)); } var result = createSymbol(4 | 67108864 | 268435456, name); result.unionType = unionType; @@ -15144,9 +10519,9 @@ var ts; } } if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; + var _symbol = getPropertyOfObjectType(globalFunctionType, name); + if (_symbol) + return _symbol; } return getPropertyOfObjectType(globalObjectType, name); } @@ -15193,7 +10568,8 @@ 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; @@ -15266,14 +10642,15 @@ var ts; function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { signature.resolvedReturnType = resolvingType; + var type; if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -15324,12 +10701,8 @@ 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; @@ -15342,8 +10715,9 @@ var ts; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var node = decl; if (node.parameters.length === 1) { var parameter = node.parameters[0]; if (parameter && parameter.type && parameter.type.kind === syntaxKind) { @@ -15356,7 +10730,9 @@ 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) { @@ -15379,8 +10755,9 @@ var ts; default: var result = ""; for (var i = 0; i < types.length; i++) { - if (i > 0) + if (i > 0) { result += ","; + } result += types[i].id; } return result; @@ -15388,8 +10765,9 @@ var ts; } function getWideningFlagsOfTypes(types) { var result = 0; - for (var i = 0; i < types.length; i++) { - result |= types[i].flags; + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + result |= type.flags; } return result & 786432; } @@ -15410,9 +10788,7 @@ 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; @@ -15426,9 +10802,7 @@ 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) { @@ -15446,8 +10820,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var symbol = resolveEntityName(node.typeName, 793056); + var type; if (symbol) { - var type; if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } @@ -15485,8 +10859,8 @@ var ts; function getTypeOfGlobalSymbol(symbol, arity) { function getTypeDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; switch (declaration.kind) { case 196: case 197: @@ -15527,9 +10901,7 @@ 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); @@ -15570,13 +10942,15 @@ var ts; } } function addTypesToSortedSet(sortedTypes, types) { - for (var i = 0, len = types.length; i < len; i++) { - addTypeToSortedSet(sortedTypes, types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + addTypeToSortedSet(sortedTypes, type); } } function isSubtypeOfAny(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && isTypeSubtypeOf(candidate, type)) { return true; } } @@ -15592,8 +10966,9 @@ var ts; } } function containsAnyType(types) { - for (var i = 0; i < types.length; i++) { - if (types[i].flags & 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (type.flags & 1) { return true; } } @@ -15707,59 +11082,51 @@ var ts; function instantiateList(items, mapper, instantiator) { if (items && items.length) { var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); + for (var _i = 0, _n = items.length; _i < _n; _i++) { + var v = items[_i]; + result.push(instantiator(v, mapper)); } return result; } 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++) { - if (t === sources[i]) + if (t === sources[i]) { return targets[i]; + } } return t; }; } 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++) { - if (t === sources[i]) + for (var _i = 0, _n = sources.length; _i < _n; _i++) { + var source = sources[_i]; + if (t === source) { return anyType; + } } return t; }; @@ -15778,9 +11145,7 @@ 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); @@ -15795,8 +11160,9 @@ var ts; return result; } function instantiateSignature(signature, mapper, eraseTypeParameters) { + var freshTypeParameters; if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); } var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); @@ -15840,7 +11206,8 @@ 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)); @@ -15865,9 +11232,11 @@ 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)); + return node.operatorToken.kind === 49 && + (isContextSensitive(node.left) || isContextSensitive(node.right)); case 218: return isContextSensitive(node.initializer); case 132: @@ -15879,9 +11248,7 @@ 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) { @@ -15952,7 +11319,7 @@ var ts; } function isRelatedTo(source, target, reportErrors, headMessage, elaborateErrors) { if (elaborateErrors === void 0) { elaborateErrors = false; } - var result; + var _result; if (source === target) return -1; if (relation !== identityRelation) { @@ -15976,53 +11343,54 @@ var ts; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { - if (result = unionTypeRelatedToUnionType(source, target)) { - if (result &= unionTypeRelatedToUnionType(target, source)) { - return result; + if (_result = unionTypeRelatedToUnionType(source, target)) { + if (_result &= unionTypeRelatedToUnionType(target, source)) { + return _result; } } } else if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = unionTypeRelatedToType(target, source, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(target, source, reportErrors)) { + return _result; } } } else { if (source.flags & 16384) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; + if (_result = unionTypeRelatedToType(source, target, reportErrors)) { + return _result; } } else { - if (result = typeRelatedToUnionType(source, target, reportErrors)) { - return result; + if (_result = typeRelatedToUnionType(source, target, reportErrors)) { + return _result; } } } } else if (source.flags & 512 && target.flags & 512) { - if (result = typeParameterRelatedTo(source, target, reportErrors)) { - return result; + if (_result = typeParameterRelatedTo(source, target, reportErrors)) { + return _result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { - if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return result; + if (_result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return _result; } } 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; + return _result; } } if (reportErrors) { @@ -16038,16 +11406,17 @@ var ts; return 0; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = typeRelatedToUnionType(sourceTypes[i], target, false); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; @@ -16060,27 +11429,28 @@ var ts; return 0; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var _result = -1; var sourceTypes = source.types; - for (var i = 0, len = sourceTypes.length; i < len; i++) { - var related = isRelatedTo(sourceTypes[i], target, reportErrors); + for (var _i = 0, _n = sourceTypes.length; _i < _n; _i++) { + var sourceType = sourceTypes[_i]; + var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var _result = -1; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -16146,19 +11516,20 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; + var _result; if (expandingFlags === 3) { - var result = 1; + _result = 1; } else { - var result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); - if (result) { - result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (result) { - result &= numberIndexTypesRelatedTo(source, target, reportErrors); + _result = propertiesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 0, reportErrors); + if (_result) { + _result &= signaturesRelatedTo(source, target, 1, reportErrors); + if (_result) { + _result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (_result) { + _result &= numberIndexTypesRelatedTo(source, target, reportErrors); } } } @@ -16166,23 +11537,23 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result) { + if (_result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + var destinationCache = (_result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { relation[id] = reportErrors ? 3 : 2; } - return result; + return _result; } function isDeeplyNestedGeneric(type, stack) { if (type.flags & 4096 && depth >= 10) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) { + if (t.flags & 4096 && t.target === _target) { count++; if (count >= 10) return true; @@ -16195,11 +11566,11 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var _result = -1; var properties = getPropertiesOfObjectType(target); var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { @@ -16250,7 +11621,7 @@ var ts; } return 0; } - result &= related; + _result &= related; if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); @@ -16260,7 +11631,7 @@ var ts; } } } - return result; + return _result; } function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); @@ -16268,9 +11639,9 @@ var ts; if (sourceProperties.length !== targetProperties.length) { return 0; } - var result = -1; - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; + var _result = -1; + for (var _i = 0, _n = sourceProperties.length; _i < _n; _i++) { + var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { return 0; @@ -16279,9 +11650,9 @@ var ts; if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { @@ -16292,18 +11663,18 @@ var ts; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var _result = -1; var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; + outer: for (var _i = 0, _n = targetSignatures.length; _i < _n; _i++) { + var t = targetSignatures[_i]; if (!t.hasStringLiterals || target.flags & 65536) { var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; + for (var _a = 0, _b = sourceSignatures.length; _a < _b; _a++) { + var s = sourceSignatures[_a]; if (!s.hasStringLiterals || source.flags & 65536) { var related = signatureRelatedTo(s, t, localErrors); if (related) { - result &= related; + _result &= related; errorInfo = saveErrorInfo; continue outer; } @@ -16313,7 +11684,7 @@ var ts; return 0; } } - return result; + return _result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { @@ -16343,14 +11714,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var _result = -1; for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); + var _s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); + var _t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - var related = isRelatedTo(s, t, reportErrors); + var related = isRelatedTo(_s, _t, reportErrors); if (!related) { - related = isRelatedTo(t, s, false); + related = isRelatedTo(_t, _s, false); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); @@ -16359,13 +11730,13 @@ var ts; } errorInfo = saveErrorInfo; } - result &= related; + _result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return result; + return _result; var s = getReturnTypeOfSignature(source); - return result & isRelatedTo(s, t, reportErrors); + return _result & isRelatedTo(s, t, reportErrors); } function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); @@ -16373,15 +11744,15 @@ var ts; if (sourceSignatures.length !== targetSignatures.length) { return 0; } - var result = -1; + var _result = -1; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { return 0; } - result &= related; + _result &= related; } - return result; + return _result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { @@ -16421,11 +11792,12 @@ var ts; } return 0; } + var related; if (sourceStringType && sourceNumberType) { - var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } if (!related) { if (reportErrors) { @@ -16477,7 +11849,9 @@ 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; @@ -16498,14 +11872,14 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - var related = compareTypes(s, t); - if (!related) { + for (var _i = 0, _len = source.parameters.length; _i < _len; _i++) { + var s = source.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[_i]); + var t = target.hasRestParameter && _i === _len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[_i]); + var _related = compareTypes(s, t); + if (!_related) { return 0; } - result &= related; + result &= _related; } if (compareReturnTypes) { result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -16513,16 +11887,15 @@ var ts; return result; } function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var type = types[_i]; + if (candidate !== type && !isTypeSubtypeOf(type, candidate)) return false; } 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; @@ -16619,29 +11992,32 @@ var ts; return reportWideningErrorsInType(type.typeArguments[0]); } if (type.flags & 131072) { - var errorReported = false; + var _errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); if (t.flags & 262144) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } - errorReported = true; + _errorReported = true; } }); - return errorReported; + return _errorReported; } return false; } function reportImplicitAnyError(declaration, type) { var typeAsString = typeToString(getWidenedType(type)); + var diagnostic; switch (declaration.kind) { case 130: case 129: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; + 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; + 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: @@ -16654,10 +12030,10 @@ var ts; error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } - var diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; + diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } @@ -16696,11 +12072,9 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) { - inferences.push({ - primary: undefined, - secondary: undefined - }); + for (var _i = 0, _n = typeParameters.length; _i < _n; _i++) { + var unused = typeParameters[_i]; + inferences.push({ primary: undefined, secondary: undefined }); } return { typeParameters: typeParameters, @@ -16718,19 +12092,21 @@ var ts; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) + if (source === sourceStack[i] && target === targetStack[i]) { return true; + } } return false; } function isWithinDepthLimit(type, stack) { if (depth >= 5) { - var target = type.target; + var _target = type.target; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target) + if (t.flags & 4096 && t.target === _target) { count++; + } } return count < 5; } @@ -16745,7 +12121,9 @@ 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; @@ -16755,16 +12133,16 @@ var ts; else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); + for (var _i = 0; _i < sourceTypes.length; _i++) { + inferFromTypes(sourceTypes[_i], targetTypes[_i]); } } else if (target.flags & 16384) { - var targetTypes = target.types; + var _targetTypes = target.types; var typeParameterCount = 0; var typeParameter; - for (var i = 0; i < targetTypes.length; i++) { - var t = targetTypes[i]; + for (var _a = 0, _n = _targetTypes.length; _a < _n; _a++) { + var t = _targetTypes[_a]; if (t.flags & 512 && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; @@ -16780,12 +12158,14 @@ var ts; } } else if (source.flags & 16384) { - var sourceTypes = source.types; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], target); + var _sourceTypes = source.types; + for (var _b = 0, _c = _sourceTypes.length; _b < _c; _b++) { + var sourceType = _sourceTypes[_b]; + inferFromTypes(sourceType, 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 = []; @@ -16806,8 +12186,8 @@ var ts; } function inferFromProperties(source, target) { var properties = getPropertiesOfObjectType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var targetProp = properties[_i]; var sourceProp = getPropertyOfObjectType(source, targetProp.name); if (sourceProp) { inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); @@ -16895,12 +12275,8 @@ var ts; 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 (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; } @@ -16993,14 +12369,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)) { - containerNodes.unshift(parent); + for (var _parent = node.parent; _parent; _parent = _parent.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); @@ -17129,9 +12504,7 @@ 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; } @@ -17187,7 +12560,9 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || (symbol.flags & 2) === 0 || symbol.valueDeclaration.parent.kind === 217) { + if (languageVersion >= 2 || + (symbol.flags & 2) === 0 || + symbol.valueDeclaration.parent.kind === 217) { return; } var container = symbol.valueDeclaration; @@ -17283,21 +12658,33 @@ var ts; var container = ts.getSuperContainer(node, true); if (container) { var canUseSuperExpression = false; + var needToCaptureLexicalThis; if (isCallExpression) { canUseSuperExpression = container.kind === 133; } else { - var needToCaptureLexicalThis = false; + needToCaptureLexicalThis = false; while (container && container.kind === 161) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = true; } 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; } } } @@ -17344,7 +12731,8 @@ 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]); } } @@ -17422,17 +12810,15 @@ var ts; var types = type.types; var mappedType; var mappedTypes; - for (var i = 0; i < types.length; i++) { - var t = mapper(types[i]); + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + var t = mapper(current); if (t) { if (!mappedType) { mappedType = t; } else if (!mappedTypes) { - mappedTypes = [ - mappedType, - t - ]; + mappedTypes = [mappedType, t]; } else { mappedTypes.push(t); @@ -17448,17 +12834,13 @@ 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)); @@ -17478,7 +12860,8 @@ 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; } @@ -17487,7 +12870,9 @@ 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; } @@ -17502,8 +12887,8 @@ var ts; if (node.contextualType) { return node.contextualType; } - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 193: case 128: case 130: @@ -17515,22 +12900,22 @@ var ts; return getContextualTypeForReturnExpression(node); case 155: case 156: - return getContextualTypeForArgument(parent, node); + return getContextualTypeForArgument(_parent, node); case 158: - return getTypeFromTypeNode(parent.type); + return getTypeFromTypeNode(_parent.type); case 167: return getContextualTypeForBinaryOperand(node); case 218: - return getContextualTypeForObjectLiteralElement(parent); + return getContextualTypeForObjectLiteralElement(_parent); case 151: return getContextualTypeForElementExpression(node); case 168: return getContextualTypeForConditionalOperand(node); case 173: - ts.Debug.assert(parent.parent.kind === 169); - return getContextualTypeForSubstitutionExpression(parent.parent, node); + ts.Debug.assert(_parent.parent.kind === 169); + return getContextualTypeForSubstitutionExpression(_parent.parent, node); case 159: - return getContextualType(parent); + return getContextualType(_parent); } return undefined; } @@ -17551,7 +12936,9 @@ 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; } @@ -17560,16 +12947,16 @@ var ts; } var signatureList; var types = type.types; - for (var i = 0; i < types.length; i++) { - if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0).length > 1) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (signatureList && + getSignaturesOfObjectOrUnionType(current, 0).length > 1) { return undefined; } - var signature = getNonGenericSignature(types[i]); + var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { - signatureList = [ - signature - ]; + signatureList = [signature]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; @@ -17591,15 +12978,15 @@ var ts; return mapper && mapper !== identityMapper; } function isAssignmentTarget(node) { - var parent = node.parent; - if (parent.kind === 167 && parent.operatorToken.kind === 52 && parent.left === node) { + var _parent = node.parent; + if (_parent.kind === 167 && _parent.operatorToken.kind === 52 && _parent.left === node) { return true; } - if (parent.kind === 218) { - return isAssignmentTarget(parent.parent); + if (_parent.kind === 218) { + return isAssignmentTarget(_parent.parent); } - if (parent.kind === 151) { - return isAssignmentTarget(parent); + if (_parent.kind === 151) { + return isAssignmentTarget(_parent); } return false; } @@ -17664,19 +13051,24 @@ var ts; var propertiesArray = []; var contextualType = getContextualType(node); var typeFlags; - for (var i = 0; i < node.properties.length; i++) { - var memberDecl = node.properties[i]; + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 218 || memberDecl.kind === 219 || ts.isObjectLiteralMethod(memberDecl)) { + if (memberDecl.kind === 218 || + memberDecl.kind === 219 || + ts.isObjectLiteralMethod(memberDecl)) { + var type = void 0; if (memberDecl.kind === 218) { - var type = checkPropertyAssignment(memberDecl, contextualMapper); + type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === 132) { - var type = checkObjectLiteralMethod(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { ts.Debug.assert(memberDecl.kind === 219); - var type = memberDecl.name.kind === 126 ? unknownType : checkExpression(memberDecl.name, contextualMapper); + type = memberDecl.name.kind === 126 + ? unknownType + : checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -17709,15 +13101,15 @@ var ts; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; if (kind === 0 || isNumericName(propertyDecl.name)) { - var type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, type)) { - propTypes.push(type); + var _type = getTypeOfSymbol(propertiesArray[i]); + if (!ts.contains(propTypes, _type)) { + propTypes.push(_type); } } } - var result = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= result.flags; - return result; + var _result = propTypes.length ? getUnionType(propTypes) : undefinedType; + typeFlags |= _result.flags; + return _result; } return undefined; } @@ -17792,7 +13184,9 @@ 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); @@ -17818,9 +13212,9 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - var start = node.end - "]".length; - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); + var _start = node.end - "]".length; + var _end = node.end; + grammarErrorAtPos(sourceFile, _start, _end - _start, ts.Diagnostics.Expression_expected); } } var objectType = getApparentType(checkExpression(node.expression)); @@ -17829,20 +13223,21 @@ 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; } if (node.argumentExpression) { - var name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name !== undefined) { - var prop = getPropertyOfType(objectType, name); + var _name = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); + if (_name !== undefined) { + var prop = getPropertyOfType(objectType, _name); if (prop) { getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name, symbolToString(objectType.symbol)); + error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, _name, symbolToString(objectType.symbol)); return unknownType; } } @@ -17929,22 +13324,22 @@ var ts; var specializedIndex = -1; var spliceIndex; ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; + for (var _i = 0, _n = signatures.length; _i < _n; _i++) { + var signature = signatures[_i]; var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; + var _parent = signature.declaration && signature.declaration.parent; if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { + if (lastParent && _parent === lastParent) { index++; } else { - lastParent = parent; + lastParent = _parent; index = cutoffIndex; } } else { index = cutoffIndex = result.length; - lastParent = parent; + lastParent = _parent; } lastSymbol = symbol; if (signature.hasStringLiterals) { @@ -17996,7 +13391,8 @@ 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; } @@ -18013,7 +13409,8 @@ 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]; } } @@ -18034,30 +13431,31 @@ var ts; var arg = args[i]; if (arg.kind !== 172) { var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); + var argType = void 0; if (i === 0 && args[i].parent.kind === 157) { - var argType = globalTemplateStringsArrayType; + argType = globalTemplateStringsArrayType; } else { var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - var argType = checkExpressionWithContextualType(arg, paramType, mapper); + argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (excludeArgument[i] === false) { - var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 171 ? -1 : i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); + for (var _i = 0; _i < args.length; _i++) { + if (excludeArgument[_i] === false) { + var _arg = args[_i]; + var _paramType = getTypeAtPosition(signature, _arg.kind === 171 ? -1 : _i); + inferTypes(context, checkExpressionWithContextualType(_arg, _paramType, inferenceMapper), _paramType); } } } var inferredTypes = getInferredTypes(context); context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType); - for (var i = 0; i < inferredTypes.length; i++) { - if (inferredTypes[i] === inferenceFailureType) { - inferredTypes[i] = unknownType; + for (var _i_1 = 0; _i_1 < inferredTypes.length; _i_1++) { + if (inferredTypes[_i_1] === inferenceFailureType) { + inferredTypes[_i_1] = unknownType; } } return context; @@ -18083,7 +13481,9 @@ 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; } @@ -18095,9 +13495,7 @@ 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); @@ -18179,50 +13577,53 @@ var ts; error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } if (!produceDiagnostics) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (hasCorrectArity(node, args, candidates[i])) { - return candidates[i]; + for (var _i = 0, _n = candidates.length; _i < _n; _i++) { + var candidate = candidates[_i]; + if (hasCorrectArity(node, args, candidate)) { + return candidate; } } } return resolveErrorCall(node); function chooseOverload(candidates, relation) { - for (var i = 0; i < candidates.length; i++) { - if (!hasCorrectArity(node, args, candidates[i])) { + for (var _a = 0, _b = candidates.length; _a < _b; _a++) { + var current = candidates[_a]; + if (!hasCorrectArity(node, args, current)) { continue; } - var originalCandidate = candidates[i]; - var inferenceResult; + var originalCandidate = current; + var inferenceResult = void 0; + var _candidate = void 0; + var typeArgumentsAreValid = void 0; while (true) { - var candidate = originalCandidate; - if (candidate.typeParameters) { - var typeArgumentTypes; - var typeArgumentsAreValid; + _candidate = originalCandidate; + if (_candidate.typeParameters) { + var typeArgumentTypes = void 0; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); + typeArgumentTypes = new Array(_candidate.typeParameters.length); + typeArgumentsAreValid = checkTypeArguments(_candidate, typeArguments, typeArgumentTypes, false); } else { - inferenceResult = inferTypeArguments(candidate, args, excludeArgument); + inferenceResult = inferTypeArguments(_candidate, args, excludeArgument); typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0; typeArgumentTypes = inferenceResult.inferredTypes; } if (!typeArgumentsAreValid) { break; } - candidate = getSignatureInstantiation(candidate, typeArgumentTypes); + _candidate = getSignatureInstantiation(_candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, _candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; if (index < 0) { - return candidate; + return _candidate; } excludeArgument[index] = false; } if (originalCandidate.typeParameters) { - var instantiatedCandidate = candidate; + var instantiatedCandidate = _candidate; if (typeArgumentsAreValid) { candidateForArgumentError = instantiatedCandidate; } @@ -18234,7 +13635,7 @@ var ts; } } else { - ts.Debug.assert(originalCandidate === candidate); + ts.Debug.assert(originalCandidate === _candidate); candidateForArgumentError = originalCandidate; } } @@ -18349,7 +13750,10 @@ 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); } @@ -18374,9 +13778,13 @@ 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); @@ -18386,9 +13794,9 @@ var ts; links.type = instantiateType(getTypeAtPosition(context, i), mapper); } if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); + var _parameter = signature.parameters[signature.parameters.length - 1]; + var _links = getSymbolLinks(_parameter); + _links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); } } function getReturnTypeFromBody(func, contextualMapper) { @@ -18396,15 +13804,16 @@ var ts; if (!func.body) { return unknownType; } + var type; if (func.body.kind !== 174) { - var type = checkExpressionCached(func.body, contextualMapper); + type = checkExpressionCached(func.body, contextualMapper); } else { var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } - var type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); + type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; @@ -18524,12 +13933,14 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 64: + case 64: { var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; - case 153: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + } + case 153: { + var _symbol = findSymbol(n); + return !_symbol || _symbol === unknownSymbol || (_symbol.flags & ~8) !== 0; + } case 154: return true; case 159: @@ -18541,18 +13952,20 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 64: - case 153: + case 153: { var symbol = findSymbol(n); return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; - case 154: + } + case 154: { var index = n.argumentExpression; - var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { - var name = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); + var _symbol = findSymbol(n.expression); + if (_symbol && index && index.kind === 8) { + var _name = index.text; + var prop = getPropertyOfType(getTypeOfSymbol(_symbol), _name); return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; } return false; + } case 159: return isConstVariableReference(n.expression); default: @@ -18624,8 +14037,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (types[i].flags & kind) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (current.flags & kind) { return true; } } @@ -18639,8 +14053,9 @@ var ts; } if (type.flags & 16384) { var types = type.types; - for (var i = 0; i < types.length; i++) { - if (!(types[i].flags & kind)) { + for (var _i = 0, _n = types.length; _i < _n; _i++) { + var current = types[_i]; + if (!(current.flags & kind)) { return false; } } @@ -18674,16 +14089,19 @@ var ts; } function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { var properties = node.properties; - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; 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 _name = p.name; + 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); + checkDestructuringAssignment(p.initializer || _name, type); } else { - error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name)); + error(_name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(_name)); } } else { @@ -18703,7 +14121,9 @@ 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); } @@ -18784,7 +14204,9 @@ 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 { @@ -18846,10 +14268,7 @@ var ts; case 48: return rightType; case 49: - return getUnionType([ - leftType, - rightType - ]); + return getUnionType([leftType, rightType]); case 52: checkAssignmentOperator(rightType); return rightType; @@ -18857,7 +14276,9 @@ 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; @@ -18903,10 +14324,7 @@ 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) { @@ -18970,7 +14388,9 @@ 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); } @@ -19080,7 +14500,9 @@ 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); @@ -19114,8 +14536,9 @@ var ts; if (indexSymbol) { var seenNumericIndexer = false; var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; + for (var _i = 0, _a = indexSymbol.declarations, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; + var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { case 120: @@ -19173,10 +14596,8 @@ 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) { @@ -19188,13 +14609,14 @@ 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)) { @@ -19303,8 +14725,8 @@ var ts; else { signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; + for (var _i = 0, _n = signaturesToCheck.length; _i < _n; _i++) { + var otherSignature = signaturesToCheck[_i]; if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { return; } @@ -19384,16 +14806,16 @@ var ts; }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; + var _errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { ts.Debug.assert(node.kind === 132 || node.kind === 131); ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128)); var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); + error(_errorNode, diagnostic); return; } else if (ts.nodeIsPresent(subsequentNode.body)) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); + error(_errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -19409,8 +14831,9 @@ var ts; var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var node = current; var inAmbientContext = ts.isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === 197 || node.parent.kind === 143 || inAmbientContext; if (inAmbientContextOrInterface) { @@ -19467,9 +14890,10 @@ var ts; var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); + for (var _a = 0, _b = signatures.length; _a < _b; _a++) { + var signature = signatures[_a]; + if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { + error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); break; } } @@ -19481,7 +14905,6 @@ var ts; if (!produceDiagnostics) { return; } - var symbol; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); @@ -19516,16 +14939,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 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; @@ -19534,7 +14957,10 @@ 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); @@ -19589,7 +15015,12 @@ 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)) { @@ -19610,8 +15041,8 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } else { @@ -19631,8 +15062,8 @@ var ts; return; } if (ts.getClassBaseTypeNode(enclosingClass)) { - var isDeclaration = node.kind !== 64; - if (isDeclaration) { + var _isDeclaration = node.kind !== 64; + if (_isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } else { @@ -19647,8 +15078,8 @@ var ts; if (node.kind === 200 && ts.getModuleInstanceState(node) !== 1) { return; } - var parent = getDeclarationContainer(node); - if (parent.kind === 221 && ts.isExternalModule(parent)) { + var _parent = getDeclarationContainer(node); + 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)); } } @@ -19657,14 +15088,20 @@ 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 === 221); + 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); + 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); } } } @@ -19678,10 +15115,11 @@ var ts; return node.kind === 128; } function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind === 128) { - var func = ts.getContainingFunction(node); - visit(node.initializer); + if (getRootDeclaration(node).kind !== 128) { + return; } + var func = ts.getContainingFunction(node); + visit(node.initializer); function visit(n) { if (n.kind === 64) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; @@ -19877,15 +15315,17 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 ? checkIteratedType(expressionType, rhsExpression) : checkElementTypeOfArrayOrString(expressionType, 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; @@ -19949,7 +15389,9 @@ var ts; } 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; + 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; @@ -19959,10 +15401,7 @@ var ts; if (arrayElementType.flags & 258) { return stringType; } - return getUnionType([ - arrayElementType, - stringType - ]); + return getUnionType([arrayElementType, stringType]); } return arrayElementType; } @@ -20110,8 +15549,8 @@ var ts; }); if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 196) { var classDeclaration = type.symbol.valueDeclaration; - for (var i = 0; i < classDeclaration.members.length; i++) { - var member = classDeclaration.members[i]; + for (var _i = 0, _a = classDeclaration.members, _n = _a.length; _i < _n; _i++) { + var member = _a[_i]; if (!(member.flags & 128) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); @@ -20124,9 +15563,7 @@ 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]; } } @@ -20140,22 +15577,22 @@ var ts; if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { return; } - var errorNode; + var _errorNode; if (prop.valueDeclaration.name.kind === 126 || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; + _errorNode = prop.valueDeclaration; } else if (indexDeclaration) { - errorNode = indexDeclaration; + _errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { - return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); - }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; + 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; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); + 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; + error(_errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); } } } @@ -20172,7 +15609,7 @@ var ts; } function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { + for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { var node = typeParameterDeclarations[i]; checkTypeParameter(node); if (produceDiagnostics) { @@ -20244,8 +15681,9 @@ var ts; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); + for (var _i = 0, _n = baseProperties.length; _i < _n; _i++) { + var baseProperty = baseProperties[_i]; + var base = getTargetSymbol(baseProperty); if (base.flags & 134217728) { continue; } @@ -20262,7 +15700,7 @@ var ts; if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { continue; } - var errorMessage; + var errorMessage = void 0; if (base.flags & 8192) { if (derived.flags & 98304) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; @@ -20318,23 +15756,15 @@ 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]; + for (var _i = 0, _a = type.baseTypes, _n = _a.length; _i < _n; _i++) { + var base = _a[_i]; var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; + for (var _b = 0, _c = properties.length; _b < _c; _b++) { + var prop = properties[_b]; 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]; @@ -20387,8 +15817,8 @@ var ts; checkSourceElement(node.type); } function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128)) { + var _nodeLinks = getNodeLinks(node); + if (!(_nodeLinks.flags & 128)) { var enumSymbol = getSymbolOfNode(node); var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; @@ -20425,7 +15855,7 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + _nodeLinks.flags |= 128; } function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { return evalConstant(initializer); @@ -20437,12 +15867,9 @@ 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: @@ -20458,28 +15885,17 @@ 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: @@ -20494,32 +15910,33 @@ var ts; } var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var enumType; + var _enumType; var propertyName; if (e.kind === 64) { - enumType = currentType; + _enumType = currentType; propertyName = e.text; } 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); + _enumType = getTypeOfNode(e.expression); propertyName = e.argumentExpression.text; } else { - var enumType = getTypeOfNode(e.expression); + _enumType = getTypeOfNode(e.expression); propertyName = e.name.text; } - if (enumType !== currentType) { + if (_enumType !== currentType) { return undefined; } } if (propertyName === undefined) { return undefined; } - var property = getPropertyOfObjectType(enumType, propertyName); + var property = getPropertyOfObjectType(_enumType, propertyName); if (!property || !(property.flags & 8)) { return undefined; } @@ -20579,8 +15996,8 @@ var ts; } function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; if ((declaration.kind === 196 || (declaration.kind === 195 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { return declaration; } @@ -20598,7 +16015,10 @@ 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)) { @@ -20634,7 +16054,9 @@ var ts; } var inAmbientExternalModule = node.parent.kind === 201 && node.parent.parent.name.kind === 8; 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); + 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)) { @@ -20647,9 +16069,13 @@ 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 === 212 ? 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)); } } @@ -20747,18 +16173,19 @@ var ts; } function hasExportedMembers(moduleSymbol) { var declarations = moduleSymbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var statements = getModuleStatements(declarations[i]); - for (var j = 0; j < statements.length; j++) { - var node = statements[j]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var statements = getModuleStatements(current); + for (var _a = 0, _b = statements.length; _a < _b; _a++) { + var node = statements[_a]; if (node.kind === 210) { var exportClause = node.exportClause; if (!exportClause) { return true; } var specifiers = exportClause.elements; - for (var k = 0; k < specifiers.length; k++) { - var specifier = specifiers[k]; + for (var _c = 0, _d = specifiers.length; _c < _d; _c++) { + var specifier = specifiers[_c]; if (!(specifier.propertyName && specifier.name && specifier.name.text === "default")) { return true; } @@ -21082,7 +16509,9 @@ 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) { @@ -21121,21 +16550,21 @@ var ts; } case 125: ts.Debug.assert(node.kind === 64 || node.kind === 125, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 142) { + var _parent = node.parent; + if (_parent.kind === 142) { return false; } - if (139 <= parent.kind && parent.kind <= 147) { + if (139 <= _parent.kind && _parent.kind <= 147) { return true; } - switch (parent.kind) { + switch (_parent.kind) { case 127: - return node === parent.constraint; + return node === _parent.constraint; case 130: case 129: case 128: case 193: - return node === parent.type; + return node === _parent.type; case 195: case 160: case 161: @@ -21144,16 +16573,16 @@ var ts; case 131: case 134: case 135: - return node === parent.type; + return node === _parent.type; case 136: case 137: case 138: - return node === parent.type; + return node === _parent.type; case 158: - return node === parent.type; + return node === _parent.type; case 155: case 156: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; + return _parent.typeArguments && ts.indexOf(_parent.typeArguments, node) >= 0; case 157: return false; } @@ -21176,7 +16605,8 @@ 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)) { @@ -21209,17 +16639,17 @@ var ts; return getNodeLinks(entityName).resolvedSymbol; } else if (entityName.kind === 125) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { + var _symbol = getNodeLinks(entityName).resolvedSymbol; + if (!_symbol) { checkQualifiedName(entityName); } return getNodeLinks(entityName).resolvedSymbol; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 139 ? 793056 : 1536; - meaning |= 8388608; - return resolveEntityName(entityName, meaning); + var _meaning = entityName.parent.kind === 139 ? 793056 : 1536; + _meaning |= 8388608; + return resolveEntityName(entityName, _meaning); } return undefined; } @@ -21231,7 +16661,9 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 64 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 209 ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); + return node.parent.kind === 209 + ? getSymbolOfEntityNameOrPropertyAccessExpression(node) + : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { case 64: @@ -21250,7 +16682,10 @@ var ts; return undefined; case 8: var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === 204 || node.parent.kind === 210) && 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: @@ -21288,21 +16723,21 @@ var ts; return getDeclaredTypeOfSymbol(symbol); } if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); + var _symbol = getSymbolInfo(node); + return _symbol && getDeclaredTypeOfSymbol(_symbol); } if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); + var _symbol_1 = getSymbolOfNode(node); + return getTypeOfSymbol(_symbol_1); } if (ts.isDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); + var _symbol_2 = getSymbolInfo(node); + return _symbol_2 && getTypeOfSymbol(_symbol_2); } if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + var _symbol_3 = getSymbolInfo(node); + var declaredType = _symbol_3 && getDeclaredTypeOfSymbol(_symbol_3); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(_symbol_3); } return unknownType; } @@ -21313,7 +16748,7 @@ var ts; return checkExpression(expr); } function getAugmentedPropertiesOfType(type) { - var type = getApparentType(type); + type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { @@ -21327,23 +16762,19 @@ var ts; function getRootSymbols(symbol) { if (symbol.flags & 268435456) { var symbols = []; - var name = symbol.name; + var _name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, name)); + symbols.push(getPropertyOfType(t, _name)); }); return symbols; } 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 === 221; @@ -21406,8 +16837,8 @@ var ts; return ts.hasProperty(globals, name) || ts.hasProperty(sourceFile.identifiers, name) || ts.hasProperty(generatedNames, name); } function makeUniqueName(baseName) { - var name = ts.generateUniqueName(baseName, isExistingName); - return generatedNames[name] = name; + var _name = ts.generateUniqueName(baseName, isExistingName); + return generatedNames[_name] = _name; } function assignGeneratedName(node, name) { getNodeLinks(node).generatedName = ts.unescapeIdentifier(name); @@ -21419,13 +16850,14 @@ var ts; } function generateNameForModuleOrEnum(node) { if (node.name.kind === 64) { - var name = node.name.text; - assignGeneratedName(node, isUniqueLocalName(name, node) ? name : makeUniqueName(name)); + var _name = node.name.text; + assignGeneratedName(node, isUniqueLocalName(_name, node) ? _name : makeUniqueName(_name)); } } 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) { @@ -21523,7 +16955,8 @@ 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; } @@ -21550,7 +16983,9 @@ 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) { @@ -21559,19 +16994,29 @@ var ts; } 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); + 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 !== 217; + 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, 107455 | 8388608, undefined, undefined); + var isLetOrConst = symbol && + (symbol.flags & 2) && + symbol.valueDeclaration.parent.kind !== 217; if (isLetOrConst) { getSymbolLinks(symbol); return symbol.id; @@ -21662,13 +17107,13 @@ var ts; } var lastStatic, lastPrivate, lastProtected, lastDeclare; var flags = 0; - for (var i = 0, n = node.modifiers.length; i < n; i++) { - var modifier = node.modifiers[i]; + for (var _i = 0, _a = node.modifiers, _n = _a.length; _i < _n; _i++) { + var modifier = _a[_i]; switch (modifier.kind) { case 108: case 107: case 106: - var text; + var text = void 0; if (modifier.kind === 108) { text = "public"; } @@ -21861,13 +17306,14 @@ var ts; } } function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + return checkGrammarForDisallowedTrailingComma(typeArguments) || + checkGrammarForAtLeastOneTypeArgument(node, typeArguments); } function checkGrammarForOmittedArgument(node, arguments) { if (arguments) { var sourceFile = ts.getSourceFileOfNode(node); - for (var i = 0, n = arguments.length; i < n; i++) { - var arg = arguments[i]; + for (var _i = 0, _n = arguments.length; _i < _n; _i++) { + var arg = arguments[_i]; if (arg.kind === 172) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } @@ -21875,7 +17321,8 @@ 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; @@ -21892,9 +17339,8 @@ var ts; var seenExtendsClause = false; var seenImplementsClause = false; if (!checkGrammarModifiers(node) && node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21921,9 +17367,8 @@ var ts; function checkGrammarInterfaceDeclaration(node) { var seenExtendsClause = false; if (node.heritageClauses) { - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - ts.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; + for (var _i = 0, _a = node.heritageClauses, _n = _a.length; _i < _n; _i++) { + var heritageClause = _a[_i]; if (heritageClause.token === 78) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); @@ -21968,18 +17413,19 @@ var ts; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; var inStrictMode = (node.parserContextFlags & 1) !== 0; - 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) { - checkGrammarComputedPropertyName(name); + for (var _i = 0, _a = node.properties, _n = _a.length; _i < _n; _i++) { + var prop = _a[_i]; + var _name = prop.name; + if (prop.kind === 172 || + _name.kind === 126) { + checkGrammarComputedPropertyName(_name); continue; } - var currentKind; + var currentKind = void 0; 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); + if (_name.kind === 7) { + checkGrammarNumbericLiteral(_name); } currentKind = Property; } @@ -21995,26 +17441,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name.text)) { - seen[name.text] = currentKind; + if (!ts.hasProperty(seen, _name.text)) { + seen[_name.text] = currentKind; } else { - var existingKind = seen[name.text]; + var existingKind = seen[_name.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); } } else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; + seen[_name.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(_name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -22027,17 +17473,23 @@ 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; - return grammarErrorOnNode(firstDeclaration.name, diagnostic); + 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; - return grammarErrorOnNode(firstDeclaration, diagnostic); + var _diagnostic_1 = 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_1); } } } @@ -22090,7 +17542,9 @@ 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) { @@ -22141,7 +17595,8 @@ 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); } @@ -22162,12 +17617,16 @@ 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; - return grammarErrorOnNode(node, message); + 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); } } function checkGrammarBindingElement(node) { @@ -22203,7 +17662,8 @@ 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) { @@ -22213,8 +17673,9 @@ var ts; } else { var elements = name.elements; - for (var i = 0; i < elements.length; ++i) { - checkGrammarNameInLetOrConstDeclarations(elements[i].name); + for (var _i = 0, _n = elements.length; _i < _n; _i++) { + var element = elements[_i]; + checkGrammarNameInLetOrConstDeclarations(element.name); } } } @@ -22270,8 +17731,8 @@ var ts; if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var i = 0, n = enumDecl.members.length; i < n; i++) { - var node = enumDecl.members[i]; + for (var _i = 0, _a = enumDecl.members, _n = _a.length; _i < _n; _i++) { + var node = _a[_i]; if (node.name.kind === 126) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } @@ -22335,7 +17796,8 @@ 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; } } @@ -22354,14 +17816,19 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 197 || node.kind === 204 || node.kind === 203 || node.kind === 210 || node.kind === 209 || (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); } function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var i = 0, n = file.statements.length; i < n; i++) { - var decl = file.statements[i]; + for (var _i = 0, _a = file.statements, _n = _a.length; _i < _n; _i++) { + var decl = _a[_i]; if (ts.isDeclaration(decl) || decl.kind === 175) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; @@ -22382,9 +17849,9 @@ var ts; 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 === 221) { - var links = getNodeLinks(node.parent); - if (!links.hasReportedStatementInAmbientContext) { - return links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + var _links = getNodeLinks(node.parent); + if (!_links.hasReportedStatementInAmbientContext) { + return _links.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } } else { @@ -22416,10 +17883,7 @@ 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]; @@ -22494,34 +17958,21 @@ 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(); } } @@ -22550,7 +18001,9 @@ 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); @@ -22628,7 +18081,8 @@ 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) { @@ -22658,11 +18112,12 @@ var ts; } function getOwnEmitOutputFilePath(sourceFile, host, extension) { var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); } else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); + emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); } return emitOutputFilePathWithoutExtension + extension; } @@ -22684,8 +18139,7 @@ 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 = ""; @@ -22694,7 +18148,9 @@ 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; @@ -22711,7 +18167,8 @@ 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); } @@ -22742,17 +18199,17 @@ var ts; } } function createAndSetNewTextWriterWithSymbolWriter() { - var writer = createTextWriter(newLine); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - setWriter(writer); - return writer; + var _writer = createTextWriter(newLine); + _writer.trackSymbol = trackSymbol; + _writer.writeKeyword = _writer.write; + _writer.writeOperator = _writer.write; + _writer.writePunctuation = _writer.write; + _writer.writeSpace = _writer.write; + _writer.writeStringLiteral = _writer.writeLiteral; + _writer.writeParameter = _writer.write; + _writer.writeSymbol = _writer.write; + setWriter(_writer); + return _writer; } function setWriter(newWriter) { writer = newWriter; @@ -22765,9 +18222,7 @@ 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--) { @@ -22822,18 +18277,20 @@ var ts; } } function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emit(nodes[i]); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; + emit(node); } } function emitSeparatedList(nodes, separator, eachNodeEmitFn) { var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (currentWriterPos !== writer.getTextPos()) { write(separator); } currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); + eachNodeEmitFn(node); } } function emitCommaList(nodes, eachNodeEmitFn) { @@ -23092,8 +18549,15 @@ 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 { @@ -23156,7 +18620,9 @@ 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; @@ -23189,9 +18655,7 @@ var ts; emitTypeParameters(node.typeParameters); var baseTypeNode = ts.getClassBaseTypeNode(node); if (baseTypeNode) { - emitHeritageClause([ - baseTypeNode - ], false); + emitHeritageClause([baseTypeNode], false); } emitHeritageClause(ts.getClassImplementedTypeNodes(node), true); write(" {"); @@ -23251,17 +18715,31 @@ 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 ? { @@ -23278,9 +18756,7 @@ 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); @@ -23303,13 +18779,14 @@ var ts; return; } var accessors = getAllAccessorDeclarations(node.parent.members, node); + var accessorWithTypeAnnotation; if (node === accessors.firstAccessor) { emitJsDocComments(accessors.getAccessor); emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); if (!(node.flags & 32)) { - var accessorWithTypeAnnotation = node; + accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { var anotherAccessor = node.kind === 134 ? accessors.setAccessor : accessors.getAccessor; @@ -23325,17 +18802,25 @@ 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, @@ -23345,10 +18830,18 @@ 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, @@ -23362,7 +18855,8 @@ 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); @@ -23429,28 +18923,48 @@ 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); @@ -23477,7 +18991,9 @@ 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)) { @@ -23487,28 +19003,50 @@ 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); @@ -23560,7 +19098,11 @@ var ts; } } 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; } @@ -23624,28 +19166,20 @@ 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 emitDetachedComments = compilerOptions.removeComments ? function (node) { } : emitDetachedCommentsAtPosition; var writeComment = writeCommentRange; var emitNodeWithoutSourceMap = compilerOptions.removeComments ? emitNodeWithoutSourceMapWithoutComments : emitNodeWithoutSourceMapWithComments; var emit = emitNodeWithoutSourceMap; var emitWithoutComments = emitNodeWithoutSourceMapWithoutComments; - var emitStart = function (node) { - }; - var emitEnd = function (node) { - }; + 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(); @@ -23671,10 +19205,7 @@ var ts; var names = currentScopeNames; currentScopeNames = undefined; if (names) { - lastFrame = { - names: names, - previous: lastFrame - }; + lastFrame = { names: names, previous: lastFrame }; return true; } return false; @@ -23689,16 +19220,14 @@ var ts; } } function generateUniqueNameForLocation(location, baseName) { - var name; + var _name; if (!isExistingName(location, baseName)) { - name = baseName; + _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); + return recordNameInCurrentScope(_name); } function recordNameInCurrentScope(name) { if (!currentScopeNames) { @@ -23796,7 +19325,12 @@ 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, @@ -23841,8 +19375,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name = node.name; - if (!name || name.kind !== 126) { + var _name = node.name; + if (!_name || _name.kind !== 126) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -23859,10 +19393,20 @@ 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; + var _name = node.name; + scopeName = _name.kind === 126 + ? ts.getTextOfNode(_name) + : node.name.text; } recordScopeNameStart(scopeName); } @@ -23976,14 +19520,18 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } - function createTempVariable(location, forLoopVariable) { - var name = forLoopVariable ? "_i" : undefined; - while (true) { - if (name && !isExistingName(location, name)) { - break; + function createTempVariable(location, preferredName) { + for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { + var char = 97 + tempCount; + if (char === 105 || char === 110) { + continue; + } + if (tempCount < 26) { + name = "_" + String.fromCharCode(char); + } + else { + name = "_" + (tempCount - 26); } - name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25); - tempCount++; } recordNameInCurrentScope(name); var result = ts.createSynthesizedNode(64); @@ -23996,8 +19544,8 @@ var ts; } tempVariables.push(name); } - function createAndRecordTempVariable(location) { - var temp = createTempVariable(location, false); + function createAndRecordTempVariable(location, preferredName) { + var temp = createTempVariable(location, preferredName); recordTempDeclaration(temp); return temp; } @@ -24205,7 +19753,8 @@ 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); }); } @@ -24216,7 +19765,8 @@ 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("("); } @@ -24225,9 +19775,10 @@ var ts; emitLiteral(node.head); headEmitted = true; } - for (var i = 0; i < node.templateSpans.length; i++) { + for (var i = 0, n = node.templateSpans.length; i < n; 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(" + "); } @@ -24301,8 +19852,8 @@ var ts; } } function isNotExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { + var _parent = node.parent; + switch (_parent.kind) { case 128: case 193: case 150: @@ -24322,7 +19873,7 @@ var ts; case 199: case 200: case 203: - return parent.name === node; + return _parent.name === node; case 185: case 184: case 209: @@ -24429,8 +19980,8 @@ var ts; function emitListWithSpread(elements, multiLine, trailingComma) { var pos = 0; var group = 0; - var length = elements.length; - while (pos < length) { + var _length = elements.length; + while (pos < _length) { if (group === 1) { write(".concat("); } @@ -24445,14 +19996,14 @@ var ts; } else { var i = pos; - while (i < length && elements[i].kind !== 171) { + while (i < _length && elements[i].kind !== 171) { i++; } write("["); if (multiLine) { increaseIndent(); } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); + emitList(elements, pos, i - pos, multiLine, trailingComma && i === _length); if (multiLine) { decreaseIndent(); } @@ -24528,8 +20079,8 @@ var ts; var propertyDescriptor = ts.createSynthesizedNode(152); var descriptorProperties = []; if (getAccessor) { - var getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty); + var _getProperty = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); + descriptorProperties.push(_getProperty); } if (setAccessor) { var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); @@ -24642,7 +20193,6 @@ var ts; } } write("{"); - var properties = node.properties; if (properties.length) { emitLinePreservingList(node, properties, languageVersion >= 1, true); } @@ -24725,9 +20275,7 @@ 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) { @@ -24840,7 +20388,14 @@ 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; } @@ -24883,7 +20438,8 @@ 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)) { + if (languageVersion < 2 && node.operatorToken.kind === 52 && + (node.left.kind === 152 || node.left.kind === 151)) { emitDestructuring(node, node.parent.kind === 177); } else { @@ -25081,8 +20637,9 @@ var ts; write(" "); endPos = emitToken(16, endPos); var rhsIsIdentifier = node.expression.kind === 64; - var counter = createTempVariable(node, true); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false); + var counter = createTempVariable(node, "_i"); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); + var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n") : undefined; emitStart(node.expression); write("var "); emitNodeWithoutSourceMap(counter); @@ -25096,12 +20653,24 @@ var ts; emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } + if (cachedLength) { + write(", "); + emitNodeWithoutSourceMap(cachedLength); + write(" = "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } write("; "); emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); + if (cachedLength) { + emitNodeWithoutSourceMap(cachedLength); + } + else { + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } emitEnd(node.initializer); write("; "); emitStart(node.initializer); @@ -25129,7 +20698,7 @@ var ts; } } else { - emitNodeWithoutSourceMap(createTempVariable(node, false)); + emitNodeWithoutSourceMap(createTempVariable(node)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -25190,13 +20759,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 === 214) { @@ -25294,7 +20866,7 @@ var ts; } function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { var emitCount = 0; - var isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; + var _isDeclaration = (root.kind === 193 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 128; if (root.kind === 167) { emitAssignmentExpression(root); } @@ -25319,7 +20891,7 @@ var ts; function ensureIdentifier(expr) { if (expr.kind !== 64) { var identifier = createTempVariable(lowestNonSynthesizedAncestor || root); - if (!isDeclaration) { + if (!_isDeclaration) { recordTempDeclaration(identifier); } emitAssignment(identifier, expr); @@ -25374,8 +20946,8 @@ var ts; if (properties.length !== 1) { value = ensureIdentifier(value); } - for (var i = 0; i < properties.length; i++) { - var p = properties[i]; + for (var _i = 0, _n = properties.length; _i < _n; _i++) { + var p = properties[_i]; if (p.kind === 218 || p.kind === 219) { var propName = (p.name); emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); @@ -25420,18 +20992,18 @@ var ts; } function emitAssignmentExpression(root) { var target = root.left; - var value = root.right; + var _value = root.right; if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); + emitDestructuringAssignment(target, _value); } else { if (root.parent.kind !== 159) { write("("); } - value = ensureIdentifier(value); - emitDestructuringAssignment(target, value); + _value = ensureIdentifier(_value); + emitDestructuringAssignment(target, _value); write(", "); - emit(value); + emit(_value); if (root.parent.kind !== 159) { write(")"); } @@ -25490,8 +21062,11 @@ var ts; 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(); } } @@ -25499,12 +21074,12 @@ var ts; } } function emitExportVariableAssignments(node) { - var name = node.name; - if (name.kind === 64) { - emitExportMemberAssignments(name); + var _name = node.name; + if (_name.kind === 64) { + emitExportMemberAssignments(_name); } - else if (ts.isBindingPattern(name)) { - ts.forEach(name.elements, emitExportVariableAssignments); + else if (ts.isBindingPattern(_name)) { + ts.forEach(_name.elements, emitExportVariableAssignments); } } function getCombinedFlagsForIdentifier(node) { @@ -25514,7 +21089,10 @@ 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); @@ -25526,8 +21104,10 @@ var ts; return; } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 221 ? blockScopeContainer : blockScopeContainer.parent; - var generatedName = generateUniqueNameForLocation(parent, node.text); + var _parent = blockScopeContainer.kind === 221 + ? blockScopeContainer + : blockScopeContainer.parent; + var generatedName = generateUniqueNameForLocation(_parent, node.text); var variableId = resolver.getBlockScopedVariableId(node); if (!generatedBlockScopeNames) { generatedBlockScopeNames = []; @@ -25547,12 +21127,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name = createTempVariable(node); + var _name = createTempVariable(node); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name); - emit(name); + tempParameters.push(_name); + emit(_name); } else { emit(node.name); @@ -25599,7 +21179,7 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(node, true).text; + var tempName = createTempVariable(node, "_i").text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -25798,9 +21378,10 @@ var ts; decreaseIndent(); var preambleEmitted = writer.getTextPos() !== initialTextPos; if (preserveNewLines && !preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var i = 0, n = body.statements.length; i < n; i++) { + for (var _i = 0, _a = body.statements, _n = _a.length; _i < _n; _i++) { + var statement = _a[_i]; write(" "); - emit(body.statements[i]); + emit(statement); } emitTempDeclarations(false); write(" "); @@ -26038,11 +21619,12 @@ var ts; emitDetachedComments(ctor.body.statements); } emitCaptureThisForNodeIfNecessary(node); + var superCall; if (ctor) { emitDefaultValueAssignments(ctor); emitRestParameter(ctor); if (baseTypeNode) { - var superCall = findInitialSuperCall(ctor); + superCall = findInitialSuperCall(ctor); if (superCall) { writeLine(); emit(superCall); @@ -26287,7 +21869,8 @@ 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)) @@ -26389,8 +21972,8 @@ var ts; if (specifier.name.text === "default") { exportDefault = exportDefault || specifier; } - var name = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name] || (exportSpecifiers[name] = [])).push(specifier); + var _name = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[_name] || (exportSpecifiers[_name] = [])).push(specifier); }); } else if (node.kind === 209) { @@ -26413,8 +21996,8 @@ var ts; } function getExternalImportInfo(node) { if (externalImports) { - for (var i = 0; i < externalImports.length; i++) { - var info = externalImports[i]; + for (var _i = 0, _n = externalImports.length; _i < _n; _i++) { + var info = externalImports[_i]; if (info.rootNode === node) { return info; } @@ -26575,12 +22158,12 @@ var ts; if (node.flags & 2) { return emitPinnedOrTripleSlashComments(node); } - var emitComments = shouldEmitLeadingAndTrailingComments(node); - if (emitComments) { + var _emitComments = shouldEmitLeadingAndTrailingComments(node); + if (_emitComments) { emitLeadingComments(node); } emitJavaScriptWorker(node); - if (emitComments) { + if (_emitComments) { emitTrailingComments(node); } } @@ -26809,10 +22392,7 @@ 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) { @@ -26837,17 +22417,12 @@ 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]; } } } @@ -26859,7 +22434,10 @@ var ts; 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; } } @@ -26905,14 +22483,17 @@ var ts; } var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { + var text; try { var start = new Date().getTime(); - var text = ts.sys.readFile(fileName, options.charset); + text = ts.sys.readFile(fileName, options.charset); ts.ioReadTime += new Date().getTime() - start; } 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 = ""; } @@ -26948,20 +22529,12 @@ 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; @@ -27001,9 +22574,7 @@ 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); } @@ -27012,35 +22583,21 @@ 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) { @@ -27067,11 +22624,7 @@ 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(); @@ -27124,9 +22677,11 @@ var ts; processSourceFile(ts.normalizePath(fileName), isDefaultLib); } function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { + var start; + var _length; if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; + start = refPos; + _length = refEnd - refPos; } var diagnostic; if (hasExtension(fileName)) { @@ -27151,7 +22706,7 @@ var ts; } if (diagnostic) { if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, start, length, diagnostic, fileName)); + diagnostics.add(ts.createFileDiagnostic(refFile, start, _length, diagnostic, fileName)); } else { diagnostics.add(ts.createCompilerDiagnostic(diagnostic, fileName)); @@ -27192,17 +22747,17 @@ var ts; files.push(file); } } + return file; } - return file; function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; + var _file = filesByName[canonicalName]; + if (_file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(_file.fileName, host.getCurrentDirectory()) : _file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); } } - return file; + return _file; } } function processReferencedFiles(file, basePath) { @@ -27235,14 +22790,15 @@ 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) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + var _searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); + var tsFile = findModuleSourceFile(_searchName + ".ts", nameLiteral); if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); + findModuleSourceFile(_searchName + ".d.ts", nameLiteral); } } } @@ -27263,17 +22819,19 @@ 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) { @@ -27457,14 +23015,16 @@ var ts; description: ts.Diagnostics.Preserve_new_lines_when_emitting_code, experimental: true }, + { + name: "cacheDownlevelForOfLength", + type: "boolean", + description: "Cache length access when downlevel emitting for-of statements", + 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 @@ -27644,9 +23204,7 @@ 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 { @@ -27693,17 +23251,24 @@ var ts; switch (n.kind) { case 174: if (!ts.isFunctionBlock(n)) { - var parent = n.parent; + 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 === 217) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + 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; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === n) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); + addOutliningSpan(_parent, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { @@ -27723,20 +23288,22 @@ var ts; }); break; } - case 201: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); + case 201: { + var _openBrace = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n.parent, _openBrace, _closeBrace, autoCollapse(n)); break; + } case 196: case 197: case 199: case 152: - case 202: - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); + case 202: { + var _openBrace_1 = ts.findChildOfKind(n, 14, sourceFile); + var _closeBrace_1 = ts.findChildOfKind(n, 15, sourceFile); + addOutliningSpan(n, _openBrace_1, _closeBrace_1, autoCollapse(n)); break; + } case 151: var openBracket = ts.findChildOfKind(n, 18, sourceFile); var closeBracket = ts.findChildOfKind(n, 19, sourceFile); @@ -27763,8 +23330,8 @@ var ts; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); var declarations = sourceFile.getNamedDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; var name = getDeclarationName(declaration); if (name !== undefined) { var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); @@ -27783,13 +23350,7 @@ 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 }); } } }); @@ -27801,8 +23362,9 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var i = 0, n = matches.length; i < n; i++) { - if (!matches[i].isCaseSensitive) { + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + if (!match.isCaseSensitive) { return false; } } @@ -27823,7 +23385,9 @@ 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; @@ -27878,20 +23442,21 @@ var ts; } function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); - var bestMatchKind = 3; - for (var i = 0, n = matches.length; i < n; i++) { - var kind = matches[i].kind; - if (kind < bestMatchKind) { - bestMatchKind = kind; + var _bestMatchKind = 3; + for (var _i = 0, _n = matches.length; _i < _n; _i++) { + var match = matches[_i]; + var kind = match.kind; + if (kind < _bestMatchKind) { + _bestMatchKind = kind; } } - return bestMatchKind; + 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; @@ -28015,8 +23580,8 @@ var ts; } function addTopLevelNodes(nodes, topLevelNodes) { nodes = sortNodes(nodes); - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; switch (node.kind) { case 196: case 199: @@ -28041,9 +23606,7 @@ 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)) { @@ -28056,19 +23619,19 @@ var ts; function getItemsWorker(nodes, createItem) { var items = []; var keyToItem = {}; - for (var i = 0, n = nodes.length; i < n; i++) { - var child = nodes[i]; - var item = createItem(child); - if (item !== undefined) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind + "-" + item.indent; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + var _item = createItem(child); + if (_item !== undefined) { + if (_item.text.length > 0) { + var key = _item.text + "-" + _item.kind + "-" + _item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item); + merge(itemWithSameName, _item); } else { - keyToItem[key] = item; - items.push(item); + keyToItem[key] = _item; + items.push(_item); } } } @@ -28081,10 +23644,10 @@ var ts; if (!target.childItems) { target.childItems = []; } - outer: for (var i = 0, n = source.childItems.length; i < n; i++) { - var sourceChild = source.childItems[i]; - for (var j = 0, m = target.childItems.length; j < m; j++) { - var targetChild = target.childItems[j]; + outer: for (var _i = 0, _a = source.childItems, _n = _a.length; _i < _n; _i++) { + var sourceChild = _a[_i]; + for (var _b = 0, _c = target.childItems, _d = _c.length; _b < _d; _b++) { + var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { merge(targetChild, sourceChild); continue outer; @@ -28127,9 +23690,9 @@ var ts; case 193: case 150: var variableDeclarationNode; - var name; + var _name; if (node.kind === 150) { - name = node.name; + _name = node.name; variableDeclarationNode = node; while (variableDeclarationNode && variableDeclarationNode.kind !== 193) { variableDeclarationNode = variableDeclarationNode.parent; @@ -28139,16 +23702,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name = node.name; + _name = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(_name), ts.ScriptElementKind.variableElement); } case 133: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -28161,9 +23724,7 @@ var ts; } 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) { @@ -28217,16 +23778,12 @@ 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; } @@ -28236,10 +23793,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) { @@ -28252,38 +23809,26 @@ 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); + 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) { @@ -28292,7 +23837,9 @@ var ts; return node; } function getNodeSpan(node) { - return node.kind === 221 ? 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); @@ -28322,9 +23869,7 @@ 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, @@ -28384,8 +23929,8 @@ var ts; if (isLowercase) { if (index > 0) { var wordSpans = getWordSpans(candidate); - for (var i = 0, n = wordSpans.length; i < n; i++) { - var span = wordSpans[i]; + for (var _i = 0, _n = wordSpans.length; _i < _n; _i++) { + var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { return createPatternMatch(2, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); } @@ -28432,15 +23977,13 @@ var ts; if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { - return [ - match - ]; + return [match]; } } var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; - for (var i = 0, n = subWordTextChunks.length; i < n; i++) { - var subWordTextChunk = subWordTextChunks[i]; + for (var _i = 0, _n = subWordTextChunks.length; _i < _n; _i++) { + var subWordTextChunk = subWordTextChunks[_i]; var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { return undefined; @@ -28466,10 +24009,10 @@ var ts; } } else { - for (var i = 0; i < patternPartLength; i++) { - var ch1 = pattern.charCodeAt(patternPartStart + i); - var ch2 = candidate.charCodeAt(candidateSpan.start + i); - if (ch1 !== ch2) { + for (var _i = 0; _i < patternPartLength; _i++) { + var _ch1 = pattern.charCodeAt(patternPartStart + _i); + var _ch2 = candidate.charCodeAt(candidateSpan.start + _i); + if (_ch1 !== _ch2) { return false; } } @@ -28501,7 +24044,8 @@ 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; } } @@ -28522,7 +24066,10 @@ 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) { @@ -28671,7 +24218,11 @@ 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)); } @@ -28723,7 +24274,8 @@ 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) { @@ -28741,7 +24293,9 @@ 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 = {})); @@ -28777,7 +24331,8 @@ 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); @@ -28791,15 +24346,15 @@ var ts; } var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { - var list = listItemInfo.list; - var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = getArgumentIndex(list, node); - var argumentCount = getArgumentCount(list); + var _list = listItemInfo.list; + var _isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === _list.pos; + 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, + kind: _isTypeArgList ? 0 : 1, invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(list), + argumentsSpan: getApplicableSpanForArguments(_list), argumentIndex: argumentIndex, argumentCount: argumentCount }; @@ -28814,28 +24369,28 @@ var ts; var templateExpression = node.parent; var tagExpression = templateExpression.parent; ts.Debug.assert(templateExpression.kind === 169); - var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var _argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, _argumentIndex); } else if (node.parent.kind === 173 && node.parent.parent.parent.kind === 157) { var templateSpan = node.parent; - var templateExpression = templateSpan.parent; - var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 169); + var _templateExpression = templateSpan.parent; + var _tagExpression = _templateExpression.parent; + ts.Debug.assert(_templateExpression.kind === 169); if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } - var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); - var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + var spanIndex = _templateExpression.templateSpans.indexOf(templateSpan); + var _argumentIndex_1 = getArgumentIndexForTemplatePiece(spanIndex, node); + return getArgumentListInfoForTemplate(_tagExpression, _argumentIndex_1); } return undefined; } 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]; + for (var _i = 0, _n = listChildren.length; _i < _n; _i++) { + var child = listChildren[_i]; if (child === node) { break; } @@ -28847,9 +24402,7 @@ var ts; } function getArgumentCount(argumentsList) { var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { - return arg.kind !== 23; - }); + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23; }); if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { argumentCount++; } @@ -28866,7 +24419,9 @@ 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, @@ -28901,9 +24456,9 @@ var ts; if (n.pos < n.parent.pos || n.end > n.parent.end) { ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } - var argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (argumentInfo) { - return argumentInfo; + var _argumentInfo = getImmediatelyContainingArgumentInfo(n); + if (_argumentInfo) { + return _argumentInfo; } } return undefined; @@ -28971,10 +24526,7 @@ 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() }; @@ -29083,9 +24635,7 @@ 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) { @@ -29099,15 +24649,11 @@ var ts; } 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) { @@ -29159,9 +24705,10 @@ var ts; return n; } 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); + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; + var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || + (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); } @@ -29185,7 +24732,7 @@ var ts; return n; } var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; ++i) { + for (var i = 0, len = children.length; i < len; i++) { var child = children[i]; if (nodeHasTokens(child)) { if (position <= child.end) { @@ -29201,8 +24748,8 @@ var ts; } ts.Debug.assert(startNode !== undefined || n.kind === 221); if (children.length) { - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); + var _candidate = findRightmostChildNodeWithTokens(children, children.length); + return _candidate && findRightmostToken(_candidate); } } function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { @@ -29264,7 +24811,8 @@ 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) { @@ -29297,38 +24845,19 @@ 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) { @@ -29489,9 +25018,7 @@ var ts; advance: advance, readTokenInfo: readTokenInfo, isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { - return wasNewLine; - }, + lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, close: function () { lastTokenInfo = undefined; scanner.setText(undefined); @@ -29517,21 +25044,21 @@ var ts; var t; var pos = scanner.getStartPos(); while (pos < endPos) { - var t = scanner.getToken(); - if (!ts.isTrivia(t)) { + var _t = scanner.getToken(); + if (!ts.isTrivia(_t)) { break; } scanner.scan(); - var item = { + var _item = { pos: pos, end: scanner.getStartPos(), - kind: t + kind: _t }; pos = scanner.getStartPos(); if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item); + leadingTrivia.push(_item); } savedPos = scanner.getStartPos(); } @@ -29552,7 +25079,8 @@ 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; @@ -29565,7 +25093,13 @@ 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); } @@ -29628,8 +25162,8 @@ var ts; } function isOnToken() { var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return startPos < endPos && current !== 1 && !ts.isTrivia(current); + var _startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return _startPos < endPos && current !== 1 && !ts.isTrivia(current); } function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { @@ -29745,7 +25279,9 @@ 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; })(); @@ -29775,7 +25311,8 @@ 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)); @@ -29815,7 +25352,8 @@ 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); @@ -29850,8 +25388,9 @@ var ts; if (this.IsAny()) { return true; } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { + for (var _i = 0, _a = this.customContextChecks, _n = _a.length; _i < _n; _i++) { + var check = _a[_i]; + if (!check(context)) { return false; } } @@ -29881,12 +25420,7 @@ 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)); @@ -29895,19 +25429,9 @@ 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)); @@ -29926,151 +25450,79 @@ 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)); @@ -30094,9 +25546,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; + for (var _name in o) { + if (o[_name] === rule) { + return _name; } } throw new Error("Unknown rule"); @@ -30244,7 +25696,8 @@ 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; @@ -30278,7 +25731,8 @@ 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; @@ -30321,7 +25775,8 @@ 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); @@ -30337,10 +25792,11 @@ var ts; var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); var bucket = this.map[bucketIndex]; if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) + for (var _i = 0, _a = bucket.Rules(), _n = _a.length; _i < _n; _i++) { + var rule = _a[_i]; + if (rule.Operation.Context.InContext(context)) { return rule; + } } } return null; @@ -30395,13 +25851,19 @@ 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) { @@ -30458,9 +25920,7 @@ var ts; this.token = token; } TokenSingleValueAccess.prototype.GetTokens = function () { - return [ - this.token - ]; + return [this.token]; }; TokenSingleValueAccess.prototype.Contains = function (tokenValue) { return tokenValue == this.token; @@ -30514,68 +25974,18 @@ 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; @@ -30712,23 +26122,28 @@ var ts; } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!parent) { + var _parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!_parent) { return []; } var span = { - pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), - end: parent.end + pos: ts.getLineStartPositionForPosition(_parent.getStart(sourceFile), sourceFile), + end: _parent.end }; return formatSpan(span, sourceFile, options, rulesProvider, requestKind); } 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; @@ -30753,9 +26168,7 @@ 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) { @@ -30769,11 +26182,9 @@ 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; } @@ -30854,10 +26265,10 @@ var ts; } } else { - var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (startLine !== parentStartLine || startPos === column) { + if (_startLine !== parentStartLine || startPos === column) { return column; } } @@ -30867,7 +26278,10 @@ var ts; var indentation = inheritedIndentation; if (indentation === -1) { if (isSomeBlock(node.kind)) { - if (isSomeBlock(parent.kind) || parent.kind === 221 || parent.kind === 214 || parent.kind === 215) { + if (isSomeBlock(parent.kind) || + parent.kind === 221 || + parent.kind === 214 || + parent.kind === 215) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -30916,12 +26330,8 @@ 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) { @@ -30975,19 +26385,19 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > childStartPos) { + var _tokenInfo = formattingScanner.readTokenInfo(node); + if (_tokenInfo.token.end > childStartPos) { break; } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, node, parentDynamicIndentation); } if (!formattingScanner.isOnToken()) { return inheritedIndentation; } if (ts.isToken(child)) { - var tokenInfo = formattingScanner.readTokenInfo(child); - ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(child); + ts.Debug.assert(_tokenInfo_1.token.end === child.end); + consumeTokenAndAdvanceScanner(_tokenInfo_1, node, parentDynamicIndentation); return inheritedIndentation; } var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); @@ -30999,33 +26409,34 @@ var ts; var listStartToken = getOpenTokenForList(parent, nodes); var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; - var startLine = parentStartLine; + var _startLine = parentStartLine; if (listStartToken !== 0) { while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.end > nodes.pos) { + var _tokenInfo = formattingScanner.readTokenInfo(parent); + if (_tokenInfo.token.end > nodes.pos) { break; } - else if (tokenInfo.token.kind === listStartToken) { - startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + else if (_tokenInfo.token.kind === listStartToken) { + _startLine = sourceFile.getLineAndCharacterOfPosition(_tokenInfo.token.pos).line; + var _indentation = computeIndentation(_tokenInfo.token, _startLine, -1, parent, parentDynamicIndentation, _startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, _indentation.indentation, _indentation.delta); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, listDynamicIndentation); } else { - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + consumeTokenAndAdvanceScanner(_tokenInfo, parent, parentDynamicIndentation); } } } var inheritedIndentation = -1; - for (var i = 0, len = nodes.length; i < len; ++i) { - inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, true); + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var child = nodes[_i]; + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, _startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + var _tokenInfo_1 = formattingScanner.readTokenInfo(parent); + if (_tokenInfo_1.token.kind === listEndToken && ts.rangeContainsRange(parent, _tokenInfo_1.token)) { + consumeTokenAndAdvanceScanner(_tokenInfo_1, parent, listDynamicIndentation); } } } @@ -31062,8 +26473,8 @@ var ts; if (indentToken) { var indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { - for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { - var triviaItem = currentTokenInfo.leadingTrivia[i]; + for (var _i = 0, _a = currentTokenInfo.leadingTrivia, _n = _a.length; _i < _n; _i++) { + var triviaItem = _a[_i]; if (!ts.rangeContainsRange(originalRange, triviaItem)) { continue; } @@ -31076,8 +26487,8 @@ var ts; break; case 2: if (indentNextTokenOrTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, commentIndentation, false); + var _commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, _commentIndentation, false); indentNextTokenOrTrivia = false; } break; @@ -31097,8 +26508,8 @@ var ts; } } function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var i = 0, len = trivia.length; i < len; ++i) { - var triviaItem = trivia[i]; + for (var _i = 0, _n = trivia.length; _i < _n; _i++) { + var triviaItem = trivia[_i]; if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); @@ -31114,7 +26525,8 @@ 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; @@ -31142,7 +26554,9 @@ 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; @@ -31166,31 +26580,26 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var _startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - if (startLine === endLine) { + var parts; + if (_startLine === endLine) { if (!firstLineIsIndented) { insertIndentation(commentRange.pos, indentation, false); } return; } else { - var parts = []; + parts = []; var startPos = commentRange.pos; - for (var line = startLine; line < endLine; ++line) { + 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 startLinePos = ts.getStartPositionOfLine(_startLine, sourceFile); var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; @@ -31198,19 +26607,21 @@ var ts; var startIndex = 0; if (firstLineIsIndented) { startIndex = 1; - startLine++; + _startLine++; } - 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 newIndentation = nonWhitespaceCharacterAndColumn.column + delta; + 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 newIndentation = nonWhitespaceCharacterAndColumn.column + _delta; if (newIndentation > 0) { var indentationString = getIndentationString(newIndentation, options); - recordReplace(startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); + recordReplace(_startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); } else { - recordDelete(startLinePos, nonWhitespaceCharacterAndColumn.character); + recordDelete(_startLinePos, nonWhitespaceCharacterAndColumn.character); } } } @@ -31232,10 +26643,7 @@ 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) { @@ -31389,7 +26797,12 @@ 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; } @@ -31415,9 +26828,9 @@ var ts; } break; } - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation; + var _actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation; } previous = current; current = current.parent; @@ -31434,9 +26847,9 @@ var ts; } SmartIndenter.getIndentationForNode = getIndentationForNode; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var parent = current.parent; + var _parent = current.parent; var parentStart; - while (parent) { + while (_parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { var start = current.getStart(sourceFile); @@ -31448,20 +26861,21 @@ var ts; return actualIndentation + indentationDelta; } } - parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); + parentStart = getParentStart(_parent, current, 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) { - return actualIndentation + indentationDelta; + var _actualIndentation = getActualIndentationForNode(current, _parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (_actualIndentation !== -1) { + return _actualIndentation + indentationDelta; } } - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + if (shouldIndentChildNode(_parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } - current = parent; + current = _parent; currentStart = parentStart; - parent = current.parent; + _parent = current.parent; } return indentationDelta; } @@ -31482,7 +26896,8 @@ var ts; } } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 221 || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && + (parent.kind === 221 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -31522,7 +26937,8 @@ 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; @@ -31536,25 +26952,30 @@ var ts; case 132: case 131: case 136: - case 137: + 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())) { return node.parent.parameters; } break; + } case 156: - case 155: - var start = node.getStart(sourceFile); - if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + case 155: { + var _start = node.getStart(sourceFile); + 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; + } } } return undefined; @@ -31603,10 +27024,7 @@ var ts; } character++; } - return { - column: column, - character: character - }; + return { column: column, character: character }; } SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { @@ -31823,8 +27241,8 @@ var ts; 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++) { - var node = nodes[i]; + for (var _i = 0, _n = nodes.length; _i < _n; _i++) { + var node = nodes[_i]; if (pos < node.pos) { pos = this.addSyntheticNodes(list._children, pos, node.pos); } @@ -31838,9 +27256,10 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; + var children; if (this.kind >= 125) { scanner.setText((sourceFile || this.getSourceFile()).text); - var children = []; + children = []; var pos = this.pos; var processNode = function (node) { if (pos < node.pos) { @@ -31881,8 +27300,8 @@ var ts; }; NodeObject.prototype.getFirstToken = function (sourceFile) { var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (child.kind < 125) { return child; } @@ -31989,7 +27408,10 @@ 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); @@ -32001,7 +27423,7 @@ var ts; } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; - var docComments = []; + var _docComments = []; var blankLineCount = 0; var isInParamTag = false; while (pos < end) { @@ -32036,14 +27458,14 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + pushDocCommentLineText(_docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } - else if (!isInParamTag && docComments.length) { + else if (!isInParamTag && _docComments.length) { blankLineCount++; } } - return docComments; + return _docComments; } function getCleanedParamJsDocComment(pos, end, sourceFile) { var paramHelpStringMargin; @@ -32144,8 +27566,8 @@ var ts; } var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { - var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42) { + var _ch = sourceFile.text.charCodeAt(pos); + if (_ch === 42) { pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -32205,9 +27627,7 @@ 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; }; @@ -32241,7 +27661,9 @@ 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; @@ -32455,9 +27877,7 @@ 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 ""; } @@ -32473,8 +27893,8 @@ var ts; if (declaration.kind !== 193 && declaration.kind !== 195) { return false; } - for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 221 || parent.kind === 201) { + for (var _parent = declaration.parent; !ts.isFunctionBlock(_parent); _parent = _parent.parent) { + if (_parent.kind === 221 || _parent.kind === 201) { return false; } } @@ -32515,8 +27935,9 @@ var ts; this.host = host; this.fileNameToEntry = {}; var rootFileNames = host.getScriptFileNames(); - for (var i = 0, n = rootFileNames.length; i < n; i++) { - this.createEntry(rootFileNames[i]); + for (var _i = 0, _n = rootFileNames.length; _i < _n; _i++) { + var fileName = rootFileNames[_i]; + this.createEntry(fileName); } this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); } @@ -32575,17 +27996,17 @@ var ts; if (!scriptSnapshot) { throw new Error("Could not find file: '" + fileName + "'."); } - var version = this.host.getScriptVersion(fileName); + var _version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, _version, true); } - else if (this.currentFileVersion !== version) { + else if (this.currentFileVersion !== _version) { var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, _version, editRange); } if (sourceFile) { - this.currentFileVersion = version; + this.currentFileVersion = _version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; this.currentSourceFile = sourceFile; @@ -32634,9 +28055,7 @@ 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) { @@ -32647,9 +28066,7 @@ 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 @@ -32838,11 +28255,7 @@ 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) { @@ -32855,10 +28268,14 @@ 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) { @@ -32893,10 +28310,12 @@ 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 === 218 || node.parent.kind === 219) && 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) { @@ -32919,12 +28338,15 @@ 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) { @@ -32937,7 +28359,8 @@ 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; @@ -32992,44 +28415,33 @@ 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 220: - return ScriptElementKind.variableElement; - case 128: - return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + 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: @@ -33085,31 +28497,19 @@ 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(); - for (var i = 0, n = oldSourceFiles.length; i < n; i++) { - var fileName = oldSourceFiles[i].fileName; + for (var _i = 0, _n = oldSourceFiles.length; _i < _n; _i++) { + var oldSourceFile = oldSourceFiles[_i]; + var fileName = oldSourceFile.fileName; if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { documentRegistry.releaseDocument(fileName, oldSettings); } @@ -33124,8 +28524,8 @@ var ts; return undefined; } if (!changesInCompilationSettingsAffectSyntax) { - var oldSourceFile = program && program.getSourceFile(fileName); - if (oldSourceFile) { + var _oldSourceFile = program && program.getSourceFile(fileName); + if (_oldSourceFile) { return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } @@ -33142,8 +28542,9 @@ var ts; if (program.getSourceFiles().length !== rootFileNames.length) { return false; } - for (var i = 0, n = rootFileNames.length; i < n; i++) { - if (!sourceFileUpToDate(program.getSourceFile(rootFileNames[i]))) { + for (var _a = 0, _b = rootFileNames.length; _a < _b; _a++) { + var _fileName = rootFileNames[_a]; + if (!sourceFileUpToDate(program.getSourceFile(_fileName))) { return false; } } @@ -33191,12 +28592,13 @@ 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); - for (var i = 1, n = displayName.length; isValid && i < n; i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); + for (var _i = 1, n = displayName.length; isValid && _i < n; _i++) { + isValid = ts.isIdentifierPart(displayName.charCodeAt(_i), target); } if (isValid) { return ts.unescapeIdentifier(displayName); @@ -33222,20 +28624,20 @@ var ts; var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { log("Returning an empty list because completion was inside a comment."); return undefined; } - var start = new Date().getTime(); + start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); if (previousToken && position <= previousToken.end && previousToken.kind === 64) { - var start = new Date().getTime(); + var _start = new Date().getTime(); previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); - log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - _start)); } if (previousToken && isCompletionListBlocker(previousToken)) { log("Returning an empty list because completion was requested in an invalid position."); @@ -33263,12 +28665,14 @@ var ts; typeChecker: typeInfoResolver }; log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); - var location = ts.getTouchingPropertyName(sourceFile, position); + var _location = ts.getTouchingPropertyName(sourceFile, position); var semanticStart = new Date().getTime(); + var isMemberCompletion; + var isNewIdentifierLocation; if (isRightOfDot) { var symbols = []; - var isMemberCompletion = true; - var isNewIdentifierLocation = false; + isMemberCompletion = true; + isNewIdentifierLocation = false; if (node.kind === 64 || node.kind === 125 || node.kind === 153) { var symbol = typeInfoResolver.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { @@ -33322,8 +28726,8 @@ var ts; isMemberCompletion = false; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(previousToken); var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); + var _symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); + getCompletionEntriesFromSymbols(_symbols, activeCompletionSession); } } if (!isMemberCompletion) { @@ -33337,9 +28741,9 @@ var ts; entries: activeCompletionSession.entries }; function getCompletionEntriesFromSymbols(symbols, session) { - var start = new Date().getTime(); + var _start_1 = new Date().getTime(); ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker, location); + var entry = createCompletionEntry(symbol, session.typeChecker, _location); if (entry) { var id = ts.escapeIdentifier(entry.name); if (!ts.lookUp(session.symbols, id)) { @@ -33348,12 +28752,14 @@ var ts; } } }); - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - _start_1)); } function isCompletionListBlocker(previousToken) { - var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); + var _start_1 = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + isIdentifierDefinitionLocation(previousToken) || + isRightOfIllegalDot(previousToken); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - _start_1)); return result; } function showCompletionsInImportsClause(node) { @@ -33369,9 +28775,16 @@ 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: @@ -33381,7 +28794,8 @@ 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: @@ -33401,10 +28815,12 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var start = previousToken.getStart(); + if (previousToken.kind === 8 + || previousToken.kind === 9 + || ts.isTemplateLiteralKind(previousToken.kind)) { + var _start_1 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start < position && position < end) { + if (_start_1 < position && position < end) { return true; } else if (position === end) { @@ -33415,12 +28831,12 @@ var ts; } function getContainingObjectLiteralApplicableForCompletion(previousToken) { if (previousToken) { - var parent = previousToken.parent; + var _parent = previousToken.parent; switch (previousToken.kind) { case 14: case 23: - if (parent && parent.kind === 152) { - return parent; + if (_parent && _parent.kind === 152) { + return _parent; } break; } @@ -33448,23 +28864,43 @@ 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 === 217 || 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: @@ -33509,18 +28945,17 @@ var ts; if (!importDeclaration.importClause) { return exports; } - if (importDeclaration.importClause.namedBindings && importDeclaration.importClause.namedBindings.kind === 207) { + 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; + var _name = el.propertyName || el.name; + exisingImports[_name.text] = true; }); } 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) { @@ -33536,13 +28971,13 @@ var ts; } existingMemberNames[m.name.text] = true; }); - var filteredMembers = []; + var _filteredMembers = []; ts.forEach(contextualMemberSymbols, function (s) { if (!existingMemberNames[s.name]) { - filteredMembers.push(s); + _filteredMembers.push(s); } }); - return filteredMembers; + return _filteredMembers; } } function getCompletionEntryDetails(fileName, position, entryName) { @@ -33553,10 +28988,10 @@ var ts; } var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); if (symbol) { - var location = ts.getTouchingPropertyName(sourceFile, position); - var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); - ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, location) !== undefined, "Could not find type for symbol"); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, session.typeChecker, location, 7); + var _location = ts.getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, _location); + ts.Debug.assert(session.typeChecker.getTypeOfSymbolAtLocation(symbol, _location) !== undefined, "Could not find type for symbol"); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), _location, session.typeChecker, _location, 7); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -33570,9 +29005,7 @@ var ts; name: entryName, kind: ScriptElementKind.keyword, kindModifiers: ScriptElementKindModifier.none, - displayParts: [ - ts.displayPart(entryName, 5) - ], + displayParts: [ts.displayPart(entryName, 5)], documentation: undefined }; } @@ -33670,7 +29103,9 @@ 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); } @@ -33679,11 +29114,13 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); var hasAddedSymbolInfo; + var type; if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } - var type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + var signature; + type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); if (type) { if (location.parent && location.parent.kind === 153) { var right = location.parent.name; @@ -33753,24 +29190,25 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || (location.kind === 113 && location.parent.kind === 133)) { - var signature; + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || + (location.kind === 113 && location.parent.kind === 133)) { var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); + var _allSignatures = functionDeclaration.kind === 133 ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { - signature = allSignatures[0]; + signature = _allSignatures[0]; } if (functionDeclaration.kind === 133) { symbolKind = ScriptElementKind.constructorImplementationElement; 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); + addSignatureDisplayParts(signature, _allSignatures); hasAddedSymbolInfo = true; } } @@ -33830,7 +29268,7 @@ var ts; } else { var signatureDeclaration = ts.getDeclarationOfKind(symbol, 127).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + var _signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); if (signatureDeclaration.kind === 137) { displayParts.push(ts.keywordPart(87)); displayParts.push(ts.spacePart()); @@ -33838,7 +29276,7 @@ var ts; else if (signatureDeclaration.kind !== 136 && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, _signature, sourceFile, 32)); } } if (symbolFlags & 8) { @@ -33888,7 +29326,9 @@ 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) { @@ -33901,9 +29341,14 @@ 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) { - var allSignatures = type.getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); + else if (symbolFlags & 16 || + symbolFlags & 8192 || + symbolFlags & 16384 || + symbolFlags & 131072 || + symbolFlags & 98304 || + symbolKind === ScriptElementKind.memberFunctionElement) { + var _allSignatures_1 = type.getCallSignatures(); + addSignatureDisplayParts(_allSignatures_1[0], _allSignatures_1); } } } @@ -33914,11 +29359,7 @@ 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()); @@ -33952,10 +29393,10 @@ var ts; documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { + var _typeParameterParts = ts.mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); - displayParts.push.apply(displayParts, typeParameterParts); + displayParts.push.apply(displayParts, _typeParameterParts); } } function getQuickInfoAtPosition(fileName, position) { @@ -34005,26 +29446,20 @@ 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; } @@ -34055,7 +29490,8 @@ 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)); }); @@ -34072,11 +29508,12 @@ var ts; }; } function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; + var _declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 133) || (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { - declarations.push(d); + if ((selectConstructors && d.kind === 133) || + (!selectConstructors && (d.kind === 195 || d.kind === 132 || d.kind === 131))) { + _declarations.push(d); if (d.body) definition = d; } @@ -34085,8 +29522,8 @@ var ts; result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); return true; } - else if (declarations.length) { - result.push(getDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); + else if (_declarations.length) { + result.push(getDefinitionInfo(_declarations[_declarations.length - 1], symbolKind, symbolName, containerName)); return true; } return false; @@ -34115,10 +29552,9 @@ 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: @@ -34166,7 +29602,9 @@ 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; @@ -34187,7 +29625,8 @@ 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); } } @@ -34200,8 +29639,8 @@ var ts; while (ifStatement) { var children = ifStatement.getChildren(); pushKeywordIf(keywords, children[0], 83); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 75)) { + for (var _i = children.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, children[_i], 75)) { break; } } @@ -34211,10 +29650,10 @@ var ts; ifStatement = ifStatement.elseStatement; } var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 75 && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; + for (var _i_1 = 0; _i_1 < keywords.length; _i_1++) { + if (keywords[_i_1].kind === 75 && _i_1 < keywords.length - 1) { + var elseKeyword = keywords[_i_1]; + var ifKeyword = keywords[_i_1 + 1]; var shouldHighlightNextKeyword = true; for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { @@ -34228,11 +29667,11 @@ var ts; textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); - i++; + _i_1++; continue; } } - result.push(getReferenceEntryFromNode(keywords[i])); + result.push(getReferenceEntryFromNode(keywords[_i_1])); } return result; } @@ -34295,17 +29734,17 @@ var ts; function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { - var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 221) { - return parent; + var _parent = child.parent; + if (ts.isFunctionBlock(_parent) || _parent.kind === 221) { + return _parent; } - if (parent.kind === 191) { - var tryStatement = parent; + if (_parent.kind === 191) { + var tryStatement = _parent; if (tryStatement.tryBlock === child && tryStatement.catchClause) { return child; } } - child = parent; + child = _parent; } return undefined; } @@ -34326,8 +29765,8 @@ var ts; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 81, 99, 74)) { if (loopNode.kind === 179) { var loopTokens = loopNode.getChildren(); - for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 99)) { + for (var _i = loopTokens.length - 1; _i >= 0; _i--) { + if (pushKeywordIf(keywords, loopTokens[_i], 99)) { break; } } @@ -34390,8 +29829,8 @@ var ts; return actualOwner && actualOwner === owner; } function getBreakOrContinueOwner(statement) { - for (var node = statement.parent; node; node = node.parent) { - switch (node.kind) { + for (var _node = statement.parent; _node; _node = _node.parent) { + switch (_node.kind) { case 188: if (statement.kind === 184) { continue; @@ -34401,12 +29840,12 @@ var ts; case 183: case 180: case 179: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; + if (!statement.label || isLabeledBy(_node, statement.label.text)) { + return _node; } break; default: - if (ts.isFunctionLike(node)) { + if (ts.isFunctionLike(_node)) { return undefined; } break; @@ -34432,16 +29871,15 @@ 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; } } @@ -34485,9 +29923,7 @@ 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); @@ -34541,7 +29977,9 @@ 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); @@ -34551,9 +29989,7 @@ 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); @@ -34567,9 +30003,7 @@ var ts; } var symbol = typeInfoResolver.getSymbolAtLocation(node); if (!symbol) { - return [ - getReferenceEntryFromNode(node) - ]; + return [getReferenceEntryFromNode(node)]; } var declarations = symbol.declarations; if (!declarations || !declarations.length) { @@ -34603,7 +30037,9 @@ var ts; } return result; function isImportOrExportSpecifierName(location) { - return location.parent && (location.parent.kind === 208 || location.parent.kind === 212) && 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) { @@ -34611,46 +30047,38 @@ var ts; }); } 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; }); + var _name; if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; + _name = functionExpression.name.text; } if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var name = typeInfoResolver.symbolToString(symbol); - return stripQuotes(name); + _name = typeInfoResolver.symbolToString(symbol); + return stripQuotes(_name); } function getInternedName(symbol, location, declarations) { if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { - return d.kind === 160 ? d : undefined; - }); - if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; - } - else { - var name = symbol.name; - } - return stripQuotes(name); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 160 ? d : undefined; }); + var _name = functionExpression && functionExpression.name + ? functionExpression.name.text + : symbol.name; + return stripQuotes(_name); } function stripQuotes(name) { - var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { - return name.substring(1, length - 1); + var _length = name.length; + if (_length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(_length - 1) === 34) { + return name.substring(1, _length - 1); } ; return name; } 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); } @@ -34661,24 +30089,25 @@ var ts; if (symbol.parent || (symbol.flags & 268435456)) { return undefined; } - var scope = undefined; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var i = 0, n = declarations.length; i < n; i++) { - var container = getContainerNode(declarations[i]); + var _scope = undefined; + var _declarations = symbol.getDeclarations(); + if (_declarations) { + for (var _i = 0, _n = _declarations.length; _i < _n; _i++) { + var declaration = _declarations[_i]; + var container = getContainerNode(declaration); if (!container) { return undefined; } - if (scope && scope !== container) { + if (_scope && _scope !== container) { return undefined; } if (container.kind === 221 && !ts.isExternalModule(container)) { return undefined; } - scope = container; + _scope = container; } } - return scope; + return _scope; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; @@ -34694,7 +30123,8 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -34702,21 +30132,22 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var result = []; + var _result = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.getWidth() !== labelName.length) { return; } - if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - result.push(getReferenceEntryFromNode(node)); + if (_node === targetLabel || + (isJumpStatementTarget(_node) && getTargetLabel(_node, labelName) === targetLabel)) { + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function isValidReferencePosition(node, searchSymbolName) { if (node) { @@ -34724,7 +30155,8 @@ 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; @@ -34747,7 +30179,8 @@ 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), @@ -34812,21 +30245,21 @@ var ts; default: return undefined; } - var result = []; + var _result = []; var sourceFile = searchSpaceNode.getSourceFile(); var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 90) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 90) { return; } - var container = ts.getSuperContainer(node, false); + var container = ts.getSuperContainer(_node, false); if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - result.push(getReferenceEntryFromNode(node)); + _result.push(getReferenceEntryFromNode(_node)); } }); - return result; + return _result; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); @@ -34855,48 +30288,49 @@ var ts; default: return undefined; } - var result = []; + var _result = []; + var possiblePositions; if (searchSpaceNode.kind === 221) { ts.forEach(sourceFiles, function (sourceFile) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, _result); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, _result); } - return result; + return _result; function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 92) { + var _node = ts.getTouchingWord(sourceFile, position); + if (!_node || _node.kind !== 92) { return; } - var container = ts.getThisContainer(node, false); + var container = ts.getThisContainer(_node, false); switch (searchSpaceNode.kind) { case 160: case 195: if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 132: case 131: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 196: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; case 221: if (container.kind === 221 && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); + result.push(getReferenceEntryFromNode(_node)); } break; } @@ -34904,30 +30338,28 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { - var result = [ - symbol - ]; + var _result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + _result.push(typeInfoResolver.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + _result.push.apply(_result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { - result.push(shorthandValueSymbol); + _result.push(shorthandValueSymbol); } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { - result.push(rootSymbol); + _result.push(rootSymbol); } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); } }); - return result; + return _result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 | 64)) { @@ -34959,14 +30391,13 @@ 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) { @@ -34974,11 +30405,9 @@ var ts; return true; } 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; - }); + var _result = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), _result); + return ts.forEach(_result, function (s) { return searchSymbols.indexOf(s) >= 0; }); } return false; }); @@ -34987,32 +30416,28 @@ var ts; if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name = node.text; + var _name = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name); + var unionProperty = contextualType.getProperty(_name); if (unionProperty) { - return [ - unionProperty - ]; + return [unionProperty]; } else { - var result = []; + var _result = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result.push(symbol); + var _symbol = t.getProperty(_name); + if (_symbol) { + _result.push(_symbol); } }); - return result; + return _result; } } else { - var symbol = contextualType.getProperty(name); - if (symbol) { - return [ - symbol - ]; + var _symbol = contextualType.getProperty(_name); + if (_symbol) { + return [_symbol]; } } } @@ -35021,10 +30446,12 @@ var ts; } function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { + var lastIterationMeaning; do { - var lastIterationMeaning = meaning; - for (var i = 0, n = declarations.length; i < n; i++) { - var declarationMeaning = getMeaningFromDeclaration(declarations[i]); + lastIterationMeaning = meaning; + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var declaration = declarations[_i]; + var declarationMeaning = getMeaningFromDeclaration(declaration); if (declarationMeaning & meaning) { meaning |= declarationMeaning; } @@ -35051,13 +30478,13 @@ var ts; if (node.kind === 64 && ts.isDeclarationName(node)) { return true; } - var parent = node.parent; - if (parent) { - if (parent.kind === 166 || parent.kind === 165) { + var _parent = node.parent; + if (_parent) { + if (_parent.kind === 166 || _parent.kind === 165) { return true; } - else if (parent.kind === 167 && parent.left === node) { - var operator = parent.operatorToken.kind; + else if (_parent.kind === 167 && _parent.left === node) { + var operator = _parent.operatorToken.kind; return 52 <= operator && operator <= 63; } } @@ -35068,9 +30495,7 @@ 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(); @@ -35164,7 +30589,9 @@ var ts; } function getMeaningFromRightHandSideOfImportEquals(node) { ts.Debug.assert(node.kind === 64); - if (node.parent.kind === 125 && node.parent.right === node && node.parent.parent.kind === 203) { + if (node.parent.kind === 125 && + node.parent.right === node && + node.parent.parent.kind === 203) { return 1 | 2 | 4; } return 4; @@ -35223,7 +30650,8 @@ 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 { @@ -35270,7 +30698,8 @@ var ts; } } else if (flags & 1536) { - if (meaningAtPosition & 4 || (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + if (meaningAtPosition & 4 || + (meaningAtPosition & 1 && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } @@ -35395,11 +30824,16 @@ 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; } } @@ -35453,8 +30887,8 @@ var ts; function processElement(element) { if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); - for (var i = 0, n = children.length; i < n; i++) { - var child = children[i]; + for (var _i = 0, _n = children.length; _i < _n; _i++) { + var child = children[_i]; if (ts.isToken(child)) { classifyToken(child); } @@ -35478,8 +30912,8 @@ var ts; if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var i = 0, n = childNodes.length; i < n; i++) { - var current = childNodes[i]; + for (var _i = 0, _n = childNodes.length; _i < _n; _i++) { + var current = childNodes[_i]; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); @@ -35497,22 +30931,14 @@ 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; } @@ -35521,7 +30947,7 @@ var ts; var start = new Date().getTime(); var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - var start = new Date().getTime(); + start = new Date().getTime(); var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); return result; @@ -35567,9 +30993,9 @@ var ts; continue; } var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; + for (var _i = 0, n = descriptors.length; _i < n; _i++) { + if (matchArray[_i + firstDescriptorCaptureIndex]) { + descriptor = descriptors[_i]; } } ts.Debug.assert(descriptor !== undefined); @@ -35592,18 +31018,18 @@ var ts; var singleLineCommentStart = /(?:\/\/+\s*)/.source; 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 _preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + var regExpString = _preamble + messagePortion + endOfLineOrEndOfComment; 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) { @@ -35617,9 +31043,10 @@ var ts; if (declarations && declarations.length > 0) { var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { - for (var i = 0; i < declarations.length; i++) { - var sourceFile = declarations[i].getSourceFile(); - if (sourceFile && getCanonicalFileName(ts.normalizePath(sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + for (var _i = 0, _n = declarations.length; _i < _n; _i++) { + var current = declarations[_i]; + var _sourceFile = current.getSourceFile(); + if (_sourceFile && getCanonicalFileName(ts.normalizePath(_sourceFile.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } @@ -35704,7 +31131,9 @@ var ts; break; case 8: case 7: - if (ts.isDeclarationName(node) || node.parent.kind === 213 || isArgumentOfElementAccessExpression(node)) { + if (ts.isDeclarationName(node) || + node.parent.kind === 213 || + isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } break; @@ -35714,10 +31143,13 @@ 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); + var _scanner = ts.createScanner(2, false); var noRegexTable = []; noRegexTable[64] = true; noRegexTable[8] = true; @@ -35743,7 +31175,10 @@ 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; @@ -35781,17 +31216,17 @@ var ts; templateStack.push(11); break; } - scanner.setText(text); + _scanner.setText(text); var result = { finalLexState: 0, entries: [] }; var angleBracketStack = 0; do { - token = scanner.scan(); + token = _scanner.scan(); if (!ts.isTrivia(token)) { if ((token === 36 || token === 56) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9) { + if (_scanner.reScanSlashToken() === 9) { token = 9; } } @@ -35801,13 +31236,18 @@ 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; } @@ -35824,7 +31264,7 @@ var ts; if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); if (lastTemplateStackToken === 11) { - token = scanner.reScanTemplateToken(); + token = _scanner.reScanTemplateToken(); if (token === 13) { templateStack.pop(); } @@ -35844,13 +31284,13 @@ var ts; } while (token !== 1); return result; function processToken() { - var start = scanner.getTokenPos(); - var end = scanner.getTextPos(); + var start = _scanner.getTokenPos(); + var end = _scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { if (token === 8) { - var tokenText = scanner.getTokenText(); - if (scanner.isUnterminated()) { + var tokenText = _scanner.getTokenText(); + if (_scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { @@ -35858,17 +31298,19 @@ var ts; } if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 ? 3 : 2; + result.finalLexState = quoteChar === 34 + ? 3 + : 2; } } } else if (token === 3) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { result.finalLexState = 1; } } else if (ts.isTemplateLiteralKind(token)) { - if (scanner.isUnterminated()) { + if (_scanner.isUnterminated()) { if (token === 13) { result.finalLexState = 5; } @@ -35890,10 +31332,7 @@ var ts; if (result.entries.length === 0) { length -= offset; } - result.entries.push({ - length: length, - classification: classification - }); + result.entries.push({ length: length, classification: classification }); } } } @@ -35988,9 +31427,7 @@ var ts; return 5; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function getDefaultLibFilePath(options) { @@ -36014,15 +31451,9 @@ 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(); @@ -36196,12 +31627,17 @@ 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) { @@ -36222,7 +31658,8 @@ 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)) { @@ -36240,7 +31677,8 @@ 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) { @@ -36492,21 +31930,15 @@ 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 () { @@ -36556,9 +31988,7 @@ 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 a899c1e240b..7fba731f25e 100644 --- a/bin/typescriptServices_internal.d.ts +++ b/bin/typescriptServices_internal.d.ts @@ -62,7 +62,7 @@ declare module ts { * index in the array will be the one associated with the produced key. */ function arrayToMap(array: T[], makeKey: (value: T) => string): Map; - var localizedDiagnosticMessages: Map; + let localizedDiagnosticMessages: Map; function getLocaleSpecificMessage(message: string): string; function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic; @@ -74,7 +74,7 @@ declare module ts { function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; function normalizeSlashes(path: string): string; function getRootLength(path: string): number; - var directorySeparator: string; + let directorySeparator: string; function normalizePath(path: string): string; function getDirectoryPath(path: string): string; function isUrl(path: string): boolean; @@ -94,7 +94,7 @@ declare module ts { getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; getSignatureConstructor(): new (checker: TypeChecker) => Signature; } - var objectAllocator: ObjectAllocator; + let objectAllocator: ObjectAllocator; const enum AssertionLevel { None = 0, Normal = 1, @@ -186,7 +186,7 @@ declare module ts { function isPrologueDirective(node: Node): boolean; function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode?: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; - var fullTripleSlashReferencePathRegEx: RegExp; + let fullTripleSlashReferencePathRegEx: RegExp; function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T; function isFunctionLike(node: Node): boolean; function isFunctionBlock(node: Node): boolean; @@ -257,7 +257,7 @@ declare module ts { function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; - var unchangedTextChangeRange: TextChangeRange; + let unchangedTextChangeRange: TextChangeRange; /** * Called to merge all the changes that occurred across several versions of a script snapshot * into a single change. i.e. if a user keeps making successive edits to a script we will diff --git a/bin/typescript_internal.d.ts b/bin/typescript_internal.d.ts index d01fe853505..2d5973e5877 100644 --- a/bin/typescript_internal.d.ts +++ b/bin/typescript_internal.d.ts @@ -62,7 +62,7 @@ declare module "typescript" { * index in the array will be the one associated with the produced key. */ function arrayToMap(array: T[], makeKey: (value: T) => string): Map; - var localizedDiagnosticMessages: Map; + let localizedDiagnosticMessages: Map; function getLocaleSpecificMessage(message: string): string; function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic; @@ -74,7 +74,7 @@ declare module "typescript" { function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; function normalizeSlashes(path: string): string; function getRootLength(path: string): number; - var directorySeparator: string; + let directorySeparator: string; function normalizePath(path: string): string; function getDirectoryPath(path: string): string; function isUrl(path: string): boolean; @@ -94,7 +94,7 @@ declare module "typescript" { getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; getSignatureConstructor(): new (checker: TypeChecker) => Signature; } - var objectAllocator: ObjectAllocator; + let objectAllocator: ObjectAllocator; const enum AssertionLevel { None = 0, Normal = 1, @@ -186,7 +186,7 @@ declare module "typescript" { function isPrologueDirective(node: Node): boolean; function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode?: SourceFile): CommentRange[]; function getJsDocComments(node: Node, sourceFileOfNode: SourceFile): CommentRange[]; - var fullTripleSlashReferencePathRegEx: RegExp; + let fullTripleSlashReferencePathRegEx: RegExp; function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T; function isFunctionLike(node: Node): boolean; function isFunctionBlock(node: Node): boolean; @@ -257,7 +257,7 @@ declare module "typescript" { function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; - var unchangedTextChangeRange: TextChangeRange; + let unchangedTextChangeRange: TextChangeRange; /** * Called to merge all the changes that occurred across several versions of a script snapshot * into a single change. i.e. if a user keeps making successive edits to a script we will diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index d0d6005d979..f951fe49269 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -58,7 +58,7 @@ module ts { } function bindSourceFileWorker(file: SourceFile): void { - var parent: Node; + let parent: Node; let container: Node; let blockScopeContainer: Node; let lastContainer: Node; @@ -505,7 +505,7 @@ module ts { bindChildren(node, 0, /*isBlockScopeContainer*/ false); break; case SyntaxKind.ExportAssignment: - if ((node).expression.kind === SyntaxKind.Identifier) { + if ((node).expression && (node).expression.kind === SyntaxKind.Identifier) { // An export default clause with an identifier exports all meanings of that identifier declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Alias, SymbolFlags.AliasExcludes); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9e59259e1d8..28e45f92f8f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -22,6 +22,9 @@ module ts { let emitResolver = createResolver(); + let undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); + let argumentsSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "arguments"); + let checker: TypeChecker = { getNodeCount: () => sum(host.getSourceFiles(), "nodeCount"), getIdentifierCount: () => sum(host.getSourceFiles(), "identifierCount"), @@ -59,8 +62,6 @@ module ts { getExportsOfExternalModule, }; - var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); - var argumentsSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "arguments"); let unknownSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "unknown"); let resolvingSymbol = createSymbol(SymbolFlags.Transient, "__resolving__"); @@ -447,7 +448,7 @@ module ts { let declaration = forEach(result.declarations, d => isBlockOrCatchScoped(d) ? d : undefined); Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - + // first check if usage is lexically located after the declaration let isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { @@ -464,7 +465,7 @@ module ts { if (variableDeclaration.parent.parent.kind === SyntaxKind.VariableStatement || variableDeclaration.parent.parent.kind === SyntaxKind.ForStatement) { - // variable statement/for statement case, + // variable statement/for statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } @@ -579,7 +580,7 @@ module ts { } function getTargetOfExportAssignment(node: ExportAssignment): Symbol { - return resolveEntityName(node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace); + return node.expression && resolveEntityName(node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace); } function getTargetOfImportDeclaration(node: Declaration): Symbol { @@ -635,7 +636,7 @@ module ts { if (!links.referenced) { links.referenced = true; let node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === SyntaxKind.ExportAssignment) { + if (node.kind === SyntaxKind.ExportAssignment && (node).expression) { // export default checkExpressionCached((node).expression); } @@ -686,8 +687,10 @@ module ts { if (getFullWidth(name) === 0) { return undefined; } + + let symbol: Symbol; if (name.kind === SyntaxKind.Identifier) { - var symbol = resolveName(name, (name).text, meaning, Diagnostics.Cannot_find_name_0, name); + symbol = resolveName(name, (name).text, meaning, Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } @@ -698,7 +701,7 @@ module ts { return undefined; } let right = (name).right; - var symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); + symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right)); return undefined; @@ -734,12 +737,20 @@ module ts { return symbol; } } + + let sourceFile: SourceFile; while (true) { let fileName = normalizePath(combinePaths(searchPath, moduleName)); - var sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); - if (sourceFile || isRelative) break; + sourceFile = host.getSourceFile(fileName + ".ts") || host.getSourceFile(fileName + ".d.ts"); + if (sourceFile || isRelative) { + break; + } + let parentPath = getDirectoryPath(searchPath); - if (parentPath === searchPath) break; + if (parentPath === searchPath) { + break; + } + searchPath = parentPath; } if (sourceFile) { @@ -1726,11 +1737,12 @@ module ts { function isUsedInExportAssignment(node: Node) { // Get source File and see if it is external module and has export assigned symbol let externalModule = getContainingExternalModule(node); + let exportAssignmentSymbol: Symbol; + let resolvedExportSymbol: Symbol; if (externalModule) { // This is export assigned symbol node let externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol: Symbol; + exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); let symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; @@ -1931,12 +1943,14 @@ module ts { } return parentType; } + + let type: Type; if (pattern.kind === SyntaxKind.ObjectBindingPattern) { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) let name = declaration.propertyName || declaration.name; // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. - var type = getTypeOfPropertyOfType(parentType, name.text) || + type = getTypeOfPropertyOfType(parentType, name.text) || isNumericLiteralName(name.text) && getIndexTypeOfType(parentType, IndexKind.Number) || getIndexTypeOfType(parentType, IndexKind.String); if (!type) { @@ -1953,7 +1967,7 @@ module ts { if (!declaration.dotDotDotToken) { // Use specific property type when parent is a tuple or numeric index type when parent is an array let propName = "" + indexOf(pattern.elements, declaration); - var type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, IndexKind.Number); + type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, IndexKind.Number); if (!type) { if (isTupleType(parentType)) { error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), (parentType).elementTypes.length, pattern.elements.length); @@ -1966,7 +1980,7 @@ module ts { } else { // Rest element has an array type with the same element type as the parent type - var type = createArrayType(getIndexTypeOfType(parentType, IndexKind.Number)); + type = createArrayType(getIndexTypeOfType(parentType, IndexKind.Number)); } } return type; @@ -2122,7 +2136,16 @@ module ts { } // Handle export default expressions if (declaration.kind === SyntaxKind.ExportAssignment) { - return links.type = checkExpression((declaration).expression); + var exportAssignment = declaration; + if (exportAssignment.expression) { + return links.type = checkExpression(exportAssignment.expression); + } + else if (exportAssignment.type) { + return links.type = getTypeFromTypeNode(exportAssignment.type); + } + else { + return links.type = anyType; + } } // Handle variable, parameter or property links.type = resolvingType; @@ -2643,18 +2666,24 @@ module ts { function resolveAnonymousTypeMembers(type: ObjectType) { let symbol = type.symbol; + let members: SymbolTable; + let callSignatures: Signature[]; + let constructSignatures: Signature[]; + let stringIndexType: Type; + let numberIndexType: Type; + if (symbol.flags & SymbolFlags.TypeLiteral) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); - var numberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); + members = symbol.members; + callSignatures = getSignaturesOfSymbol(members["__call"]); + constructSignatures = getSignaturesOfSymbol(members["__new"]); + stringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String); + numberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number); } else { // Combinations of function, class, enum and module - var members = emptySymbols; - var callSignatures: Signature[] = emptyArray; - var constructSignatures: Signature[] = emptyArray; + members = emptySymbols; + callSignatures = emptyArray; + constructSignatures = emptyArray; if (symbol.flags & SymbolFlags.HasExports) { members = getExportsOfSymbol(symbol); } @@ -2672,8 +2701,8 @@ module ts { addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); } } - var stringIndexType: Type = undefined; - var numberIndexType: Type = (symbol.flags & SymbolFlags.Enum) ? stringType : undefined; + stringIndexType = undefined; + numberIndexType = (symbol.flags & SymbolFlags.Enum) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -2980,14 +3009,15 @@ module ts { function getReturnTypeOfSignature(signature: Signature): Type { if (!signature.resolvedReturnType) { signature.resolvedReturnType = resolvingType; + let type: Type; if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); + type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - var type = getUnionType(map(signature.unionSignatures, getReturnTypeOfSignature)); + type = getUnionType(map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -3191,8 +3221,8 @@ module ts { let links = getNodeLinks(node); if (!links.resolvedType) { let symbol = resolveEntityName(node.typeName, SymbolFlags.Type); + let type: Type; if (symbol) { - var type: Type; if ((symbol.flags & SymbolFlags.TypeParameter) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { // TypeScript 1.0 spec (April 2014): 3.4.1 // Type parameters declared in a particular type parameter list @@ -3576,8 +3606,9 @@ module ts { } function instantiateSignature(signature: Signature, mapper: TypeMapper, eraseTypeParameters?: boolean): Signature { + let freshTypeParameters: TypeParameter[]; if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); } let result = createSignature(signature.declaration, freshTypeParameters, @@ -4287,12 +4318,13 @@ module ts { } return Ternary.False; } + let related: Ternary; if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } if (!related) { if (reportErrors) { @@ -4452,7 +4484,7 @@ module ts { } /** - * Check if a Type was written as a tuple type literal. + * Check if a Type was written as a tuple type literal. * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. */ function isTupleType(type: Type) : boolean { @@ -4532,13 +4564,14 @@ module ts { function reportImplicitAnyError(declaration: Declaration, type: Type) { let typeAsString = typeToString(getWidenedType(type)); + let diagnostic: DiagnosticMessage; switch (declaration.kind) { case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: - var diagnostic = Diagnostics.Member_0_implicitly_has_an_1_type; + diagnostic = Diagnostics.Member_0_implicitly_has_an_1_type; break; case SyntaxKind.Parameter: - var diagnostic = (declaration).dotDotDotToken ? + diagnostic = (declaration).dotDotDotToken ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Parameter_0_implicitly_has_an_1_type; break; @@ -4553,10 +4586,10 @@ module ts { error(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } - var diagnostic = Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + diagnostic = Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; default: - var diagnostic = Diagnostics.Variable_0_implicitly_has_an_1_type; + diagnostic = Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, declarationNameToString(declaration.name), typeAsString); } @@ -5319,6 +5352,7 @@ module ts { if (container) { let canUseSuperExpression = false; + let needToCaptureLexicalThis: boolean; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes @@ -5331,7 +5365,7 @@ module ts { // - In a static member function or static member accessor // super property access might appear in arrow functions with arbitrary deep nesting - var needToCaptureLexicalThis = false; + needToCaptureLexicalThis = false; while (container && container.kind === SyntaxKind.ArrowFunction) { container = getSuperContainer(container, /*includeFunctions*/ true); needToCaptureLexicalThis = true; @@ -5857,15 +5891,16 @@ module ts { if (memberDecl.kind === SyntaxKind.PropertyAssignment || memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment || isObjectLiteralMethod(memberDecl)) { + let type: Type; if (memberDecl.kind === SyntaxKind.PropertyAssignment) { - var type = checkPropertyAssignment(memberDecl, contextualMapper); + type = checkPropertyAssignment(memberDecl, contextualMapper); } else if (memberDecl.kind === SyntaxKind.MethodDeclaration) { - var type = checkObjectLiteralMethod(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); - var type = memberDecl.name.kind === SyntaxKind.ComputedPropertyName + type = memberDecl.name.kind === SyntaxKind.ComputedPropertyName ? unknownType : checkExpression(memberDecl.name, contextualMapper); } @@ -6382,14 +6417,15 @@ module ts { let arg = args[i]; if (arg.kind !== SyntaxKind.OmittedExpression) { let paramType = getTypeAtPosition(signature, arg.kind === SyntaxKind.SpreadElementExpression ? -1 : i); + let argType: Type; if (i === 0 && args[i].parent.kind === SyntaxKind.TaggedTemplateExpression) { - var argType = globalTemplateStringsArrayType; + argType = globalTemplateStringsArrayType; } else { // For context sensitive arguments we pass the identityMapper, which is a signal to treat all // context sensitive function expressions as wildcards let mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - var argType = checkExpressionWithContextualType(arg, paramType, mapper); + argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } @@ -6661,12 +6697,12 @@ module ts { let originalCandidate = current; let inferenceResult: InferenceContext; - + let candidate: Signature; + let typeArgumentsAreValid: boolean; while (true) { - var candidate = originalCandidate; + candidate = originalCandidate; if (candidate.typeParameters) { let typeArgumentTypes: Type[]; - var typeArgumentsAreValid: boolean; if (typeArguments) { typeArgumentTypes = new Array(candidate.typeParameters.length); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false) @@ -6948,9 +6984,9 @@ module ts { if (!func.body) { return unknownType; } - + let type: Type; if (func.body.kind !== SyntaxKind.Block) { - var type = checkExpressionCached(func.body, contextualMapper); + type = checkExpressionCached(func.body, contextualMapper); } else { // Aggregate the types of expressions within all the return statements. @@ -6960,7 +6996,7 @@ module ts { } // When return statements are contextually typed we allow the return type to be a union type. Otherwise we require the // return expressions to have a best common supertype. - var type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); + type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, Diagnostics.No_best_common_type_exists_among_return_expressions); return unknownType; @@ -7129,18 +7165,20 @@ module ts { // and property accesses(section 4.10). // All other expression constructs described in this chapter are classified as values. switch (n.kind) { - case SyntaxKind.Identifier: - var symbol = findSymbol(n); + case SyntaxKind.Identifier: { + let symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.3 // An identifier expression that references a variable or parameter is classified as a reference. // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & SymbolFlags.Variable) !== 0; - case SyntaxKind.PropertyAccessExpression: - var symbol = findSymbol(n); + } + case SyntaxKind.PropertyAccessExpression: { + let symbol = findSymbol(n); // TypeScript 1.0 spec (April 2014): 4.10 // A property access expression is always classified as a reference. // NOTE (not in spec): assignment to enum members should not be allowed return !symbol || symbol === unknownSymbol || (symbol.flags & ~SymbolFlags.EnumMember) !== 0; + } case SyntaxKind.ElementAccessExpression: // old compiler doesn't check indexed assess return true; @@ -7154,12 +7192,13 @@ module ts { function isConstVariableReference(n: Node): boolean { switch (n.kind) { case SyntaxKind.Identifier: - case SyntaxKind.PropertyAccessExpression: - var symbol = findSymbol(n); + case SyntaxKind.PropertyAccessExpression: { + let symbol = findSymbol(n); return symbol && (symbol.flags & SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & NodeFlags.Const) !== 0; - case SyntaxKind.ElementAccessExpression: + } + case SyntaxKind.ElementAccessExpression: { let index = (n).argumentExpression; - var symbol = findSymbol((n).expression); + let symbol = findSymbol((n).expression); if (symbol && index && index.kind === SyntaxKind.StringLiteral) { let name = (index).text; @@ -7167,6 +7206,7 @@ module ts { return prop && (prop.flags & SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & NodeFlags.Const) !== 0; } return false; + } case SyntaxKind.ParenthesizedExpression: return isConstVariableReference((n).expression); default: @@ -8395,13 +8435,11 @@ module ts { return; } - var symbol: Symbol; - // Exports should be checked only if enclosing module contains both exported and non exported declarations. // In case if all declarations are non-exported check is unnecessary. // if localSymbol is defined on node then node itself is exported - check is required - var symbol = node.localSymbol; + let symbol = node.localSymbol; if (!symbol) { // local symbol is undefined => this declaration is non-exported. // however symbol might contain other declarations that are exported @@ -8668,36 +8706,48 @@ module ts { // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration // let x = 0; // symbol for this declaration will be 'symbol' // } - if (node.initializer && (getCombinedNodeFlags(node) & NodeFlags.BlockScoped) === 0) { - let symbol = getSymbolOfNode(node); - if (symbol.flags & SymbolFlags.FunctionScopedVariable) { - let localDeclarationSymbol = resolveName(node, (node.name).text, SymbolFlags.Variable, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & SymbolFlags.BlockScopedVariable) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & NodeFlags.BlockScoped) { - let varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, SyntaxKind.VariableDeclarationList); - let container = - varDeclList.parent.kind === SyntaxKind.VariableStatement && - varDeclList.parent.parent; + // skip block-scoped variables and parameters + if ((getCombinedNodeFlags(node) & NodeFlags.BlockScoped) !== 0 || isParameterDeclaration(node)) { + return; + } - // names of block-scoped and function scoped variables can collide only - // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) - let namesShareScope = - container && - (container.kind === SyntaxKind.Block && isFunctionLike(container.parent) || - (container.kind === SyntaxKind.ModuleBlock && container.kind === SyntaxKind.ModuleDeclaration) || - container.kind === SyntaxKind.SourceFile); + // skip variable declarations that don't have initializers + // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern + // so we'll always treat binding elements as initialized + if (node.kind === SyntaxKind.VariableDeclaration && !node.initializer) { + return; + } - // here we know that function scoped variable is shadowed by block scoped one - // if they are defined in the same scope - binder has already reported redeclaration error - // otherwise if variable has an initializer - show error that initialization will fail - // since LHS will be block scoped name instead of function scoped - if (!namesShareScope) { - let name = symbolToString(localDeclarationSymbol); - error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); - } + var symbol = getSymbolOfNode(node); + if (symbol.flags & SymbolFlags.FunctionScopedVariable) { + let localDeclarationSymbol = resolveName(node, (node.name).text, SymbolFlags.Variable, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); + if (localDeclarationSymbol && + localDeclarationSymbol !== symbol && + localDeclarationSymbol.flags & SymbolFlags.BlockScopedVariable) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & NodeFlags.BlockScoped) { + let varDeclList = getAncestor(localDeclarationSymbol.valueDeclaration, SyntaxKind.VariableDeclarationList); + let container = + varDeclList.parent.kind === SyntaxKind.VariableStatement && varDeclList.parent.parent + ? varDeclList.parent.parent + : undefined; + + // names of block-scoped and function scoped variables can collide only + // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) + let namesShareScope = + container && + (container.kind === SyntaxKind.Block && isFunctionLike(container.parent) || + container.kind === SyntaxKind.ModuleBlock || + container.kind === SyntaxKind.ModuleDeclaration || + container.kind === SyntaxKind.SourceFile); + + // here we know that function scoped variable is shadowed by block scoped one + // if they are defined in the same scope - binder has already reported redeclaration error + // otherwise if variable has an initializer - show error that initialization will fail + // since LHS will be block scoped name instead of function scoped + if (!namesShareScope) { + let name = symbolToString(localDeclarationSymbol); + error(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); } } } @@ -8713,10 +8763,13 @@ module ts { // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node: VariableLikeDeclaration): void { - if (getRootDeclaration(node).kind === SyntaxKind.Parameter) { - var func = getContainingFunction(node); - visit(node.initializer); + if (getRootDeclaration(node).kind !== SyntaxKind.Parameter) { + return; } + + let func = getContainingFunction(node); + visit(node.initializer); + function visit(n: Node) { if (n.kind === SyntaxKind.Identifier) { let referencedSymbol = getNodeLinks(n).resolvedSymbol; @@ -9111,7 +9164,7 @@ module ts { */ function checkElementTypeOfArrayOrString(arrayOrStringType: Type, expressionForError: Expression): Type { Debug.assert(languageVersion < ScriptTarget.ES6); - + // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the remaining type is the same as the initial type. let arrayType = removeTypesFromUnionType(arrayOrStringType, TypeFlags.StringLike, /*isTypeOfKind*/ true, /*allowEmptyUnionResult*/ true); @@ -10094,12 +10147,21 @@ module ts { if (!checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression.kind === SyntaxKind.Identifier) { - markExportAsReferenced(node); + if (node.expression) { + if (node.expression.kind === SyntaxKind.Identifier) { + markExportAsReferenced(node); + } + else { + checkExpressionCached(node.expression); + } } - else { - checkExpressionCached(node.expression); + if (node.type) { + checkSourceElement(node.type); + if (!isInAmbientContext(node)) { + grammarErrorOnFirstToken(node.type, Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); + } } + checkExternalModuleExports(container); } @@ -10792,7 +10854,7 @@ module ts { // Return the list of properties of the given type, augmented with properties from Function // if the type has call or construct signatures function getAugmentedPropertiesOfType(type: Type): Symbol[] { - var type = getApparentType(type); + type = getApparentType(type); let propsByName = createSymbolTable(getPropertiesOfType(type)); if (getSignaturesOfType(type, SignatureKind.Call).length || getSignaturesOfType(type, SignatureKind.Construct).length) { forEach(getPropertiesOfType(globalFunctionType), p => { @@ -10933,7 +10995,7 @@ module ts { } function generateNameForExportAssignment(node: ExportAssignment) { - if (node.expression.kind !== SyntaxKind.Identifier) { + if (node.expression && node.expression.kind !== SyntaxKind.Identifier) { assignGeneratedName(node, makeUniqueName("default")); } } @@ -11104,26 +11166,11 @@ module ts { function getBlockScopedVariableId(n: Identifier): number { Debug.assert(!nodeIsSynthesized(n)); - // ignore name parts of property access expressions - if (n.parent.kind === SyntaxKind.PropertyAccessExpression && - (n.parent).name === n) { - return undefined; - } + let isVariableDeclarationOrBindingElement = + n.parent.kind === SyntaxKind.BindingElement || (n.parent.kind === SyntaxKind.VariableDeclaration && (n.parent).name === n); - // ignore property names in object binding patterns - if (n.parent.kind === SyntaxKind.BindingElement && - (n.parent).propertyName === n) { - return undefined; - } - - // for names in variable declarations and binding elements try to short circuit and fetch symbol from the node - let declarationSymbol: Symbol = - (n.parent.kind === SyntaxKind.VariableDeclaration && (n.parent).name === n) || - n.parent.kind === SyntaxKind.BindingElement - ? getSymbolOfNode(n.parent) - : undefined; - - let symbol = declarationSymbol || + let symbol = + (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || resolveName(n, n.text, SymbolFlags.Value | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined); @@ -11356,16 +11403,15 @@ module ts { } } - function checkGrammarTypeParameterList(node: FunctionLikeDeclaration, typeParameters: NodeArray): boolean { + function checkGrammarTypeParameterList(node: FunctionLikeDeclaration, typeParameters: NodeArray, file: SourceFile): boolean { if (checkGrammarForDisallowedTrailingComma(typeParameters)) { return true; } if (typeParameters && typeParameters.length === 0) { let start = typeParameters.pos - "<".length; - let sourceFile = getSourceFileOfNode(node); - let end = skipTrivia(sourceFile.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); + let end = skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); } } @@ -11409,7 +11455,21 @@ module ts { function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean { // Prevent cascading error by short-circuit - return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters) || checkGrammarParameterList(node.parameters); + let file = getSourceFileOfNode(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || + checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); + } + + function checkGrammarArrowFunction(node: FunctionLikeDeclaration, file: SourceFile): boolean { + if (node.kind === SyntaxKind.ArrowFunction) { + let arrowFunction = node; + let startLine = getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; + let endLine = getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; + if (startLine !== endLine) { + return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, Diagnostics.Line_terminator_not_permitted_before_arrow); + } + } + return false; } function checkGrammarIndexSignatureParameters(node: SignatureDeclaration): boolean { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e79d762524c..269f23492e2 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -146,6 +146,12 @@ module ts { description: Diagnostics.Preserve_new_lines_when_emitting_code, experimental: true }, + { + name: "cacheDownlevelForOfLength", + type: "boolean", + description: "Cache length access when downlevel emitting for-of statements", + experimental: true, + }, { name: "target", shortName: "t", diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index d40fcd25ce0..622b28d5f18 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -157,6 +157,8 @@ module ts { Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, Unterminated_Unicode_escape_sequence: { code: 1199, category: DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, + Line_terminator_not_permitted_before_arrow: { code: 1200, category: DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, + A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration: { code: 1201, category: DiagnosticCategory.Error, key: "A type annotation on an export statement is only allowed in an ambient external module declaration." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, 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: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c4121e92251..410cce54d17 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -617,8 +617,17 @@ }, "Unterminated Unicode escape sequence.": { "category": "Error", - "code": 1199 + "code": 1199 }, + "Line terminator not permitted before arrow.": { + "category": "Error", + "code": 1200 + }, + "A type annotation on an export statement is only allowed in an ambient external module declaration.": { + "category": "Error", + "code": 1201 + }, + "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 49119768f6f..006b09892df 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2289,19 +2289,19 @@ module ts { sourceMapDir = getDirectoryPath(normalizePath(jsFilePath)); } - function emitNodeWithSourceMap(node: Node) { + function emitNodeWithSourceMap(node: Node, allowGeneratedIdentifiers?: boolean) { if (node) { if (nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); + return emitNodeWithoutSourceMap(node, /*allowGeneratedIdentifiers*/ false); } if (node.kind != SyntaxKind.SourceFile) { recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); } else { recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); + emitNodeWithoutSourceMap(node, /*allowGeneratedIdentifiers*/ false); } } } @@ -2331,16 +2331,22 @@ module ts { // Create a temporary variable with a unique unused name. The forLoopVariable parameter signals that the // name should be one that is appropriate for a for loop variable. - function createTempVariable(location: Node, forLoopVariable?: boolean): Identifier { - let name = forLoopVariable ? "_i" : undefined; - while (true) { - if (name && !isExistingName(location, name)) { - break; - } + function createTempVariable(location: Node, preferredName?: string): Identifier { + for (var name = preferredName; !name || isExistingName(location, name); tempCount++) { // _a .. _h, _j ... _z, _0, _1, ... - // Note that _i is skipped - name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + CharacterCodes.a) : tempCount - 25); - tempCount++; + + // Note: we avoid generating _i and _n as those are common names we want in other places. + var char = CharacterCodes.a + tempCount; + if (char === CharacterCodes.i || char === CharacterCodes.n) { + continue; + } + + if (tempCount < 26) { + name = "_" + String.fromCharCode(char); + } + else { + name = "_" + (tempCount - 26); + } } // This is necessary so that a name generated via renameNonTopLevelLetAndConst will see the name @@ -2359,8 +2365,8 @@ module ts { tempVariables.push(name); } - function createAndRecordTempVariable(location: Node): Identifier { - let temp = createTempVariable(location, /*forLoopVariable*/ false); + function createAndRecordTempVariable(location: Node, preferredName?: string): Identifier { + let temp = createTempVariable(location, preferredName); recordTempDeclaration(temp); return temp; @@ -2832,17 +2838,24 @@ module ts { } } - function getBlockScopedVariableId(node: Identifier): number { - // return undefined for synthesized nodes - return !nodeIsSynthesized(node) && resolver.getBlockScopedVariableId(node); + function getGeneratedNameForIdentifier(node: Identifier): string { + if (nodeIsSynthesized(node) || !generatedBlockScopeNames) { + return undefined; + } + + var variableId = resolver.getBlockScopedVariableId(node) + if (variableId === undefined) { + return undefined; + } + + return generatedBlockScopeNames[variableId]; } - function emitIdentifier(node: Identifier) { - let variableId = getBlockScopedVariableId(node); - if (variableId !== undefined && generatedBlockScopeNames) { - let text = generatedBlockScopeNames[variableId]; - if (text) { - write(text); + function emitIdentifier(node: Identifier, allowGeneratedIdentifiers: boolean) { + if (allowGeneratedIdentifiers) { + let generatedName = getGeneratedNameForIdentifier(node); + if (generatedName) { + write(generatedName); return; } } @@ -2895,7 +2908,7 @@ module ts { function emitBindingElement(node: BindingElement) { if (node.propertyName) { - emit(node.propertyName); + emit(node.propertyName, /*allowGeneratedIdentifiers*/ false); write(": "); } if (node.dotDotDotToken) { @@ -3068,7 +3081,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - var { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(objectLiteral.properties, property); + let { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(objectLiteral.properties, property); // Only emit the first accessor. if (firstAccessor !== property) { @@ -3239,7 +3252,7 @@ module ts { } function emitMethod(node: MethodDeclaration) { - emit(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); if (languageVersion < ScriptTarget.ES6) { write(": function "); } @@ -3247,13 +3260,13 @@ module ts { } function emitPropertyAssignment(node: PropertyDeclaration) { - emit(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); write(": "); emit(node.initializer); } function emitShorthandPropertyAssignment(node: ShorthandPropertyAssignment) { - emit(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: // module m { // export let y; @@ -3262,7 +3275,20 @@ module ts { // export let obj = { y }; // } // The short-hand property in obj need to emit as such ... = { y : m.y } regardless of the TargetScript version - if (languageVersion < ScriptTarget.ES6 || resolver.getExpressionNameSubstitution(node.name)) { + if (languageVersion < ScriptTarget.ES6) { + // Emit identifier as an identifier + write(": "); + var generatedName = getGeneratedNameForIdentifier(node.name); + if (generatedName) { + write(generatedName); + } + else { + // Even though this is stored as identifier treat it as an expression + // Short-hand, { x }, is equivalent of normal form { x: x } + emitExpressionIdentifier(node.name); + } + } + else if (resolver.getExpressionNameSubstitution(node.name)) { // Emit identifier as an identifier write(": "); // Even though this is stored as identifier treat it as an expression @@ -3315,7 +3341,7 @@ module ts { let indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); write("."); let indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); decreaseIndentIf(indentedBeforeDot, indentedAfterDot); } @@ -3795,8 +3821,10 @@ module ts { // // we don't want to emit a temporary variable for the RHS, just use it directly. let rhsIsIdentifier = node.expression.kind === SyntaxKind.Identifier; - let counter = createTempVariable(node, /*forLoopVariable*/ true); - let rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, /*forLoopVariable*/ false); + let counter = createTempVariable(node, /*preferredName*/ "_i"); + let rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node); + + var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, /*preferredName:*/ "_n") : undefined; // This is the let keyword for the counter and rhsReference. The let keyword for // the LHS will be emitted inside the body. @@ -3817,14 +3845,30 @@ module ts { emitNodeWithoutSourceMap(node.expression); emitEnd(node.expression); } + + if (cachedLength) { + write(", "); + emitNodeWithoutSourceMap(cachedLength); + write(" = "); + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } + write("; "); // _i < _a.length; emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); + + if (cachedLength) { + emitNodeWithoutSourceMap(cachedLength); + } + else { + emitNodeWithoutSourceMap(rhsReference); + write(".length"); + } + emitEnd(node.initializer); write("; "); @@ -3865,7 +3909,7 @@ module ts { else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (let of []) {} - emitNodeWithoutSourceMap(createTempVariable(node, /*forLoopVariable*/ false)); + emitNodeWithoutSourceMap(createTempVariable(node)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } @@ -4451,7 +4495,7 @@ module ts { if (languageVersion < ScriptTarget.ES6 && hasRestParameters(node)) { let restIndex = node.parameters.length - 1; let restParam = node.parameters[restIndex]; - let tempName = createTempVariable(node, /*forLoopVariable*/ true).text; + let tempName = createTempVariable(node, /*preferredName:*/ "_i").text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -4488,7 +4532,7 @@ module ts { function emitAccessor(node: AccessorDeclaration) { write(node.kind === SyntaxKind.GetAccessor ? "get " : "set "); - emit(node.name); + emit(node.name, /*allowGeneratedIdentifiers*/ false); emitSignatureAndBody(node); } @@ -5534,7 +5578,7 @@ module ts { emitLeadingComments(node.endOfFileToken); } - function emitNodeWithoutSourceMapWithComments(node: Node): void { + function emitNodeWithoutSourceMapWithComments(node: Node, allowGeneratedIdentifiers?: boolean): void { if (!node) { return; } @@ -5548,14 +5592,14 @@ module ts { emitLeadingComments(node); } - emitJavaScriptWorker(node); + emitJavaScriptWorker(node, allowGeneratedIdentifiers); if (emitComments) { emitTrailingComments(node); } } - function emitNodeWithoutSourceMapWithoutComments(node: Node): void { + function emitNodeWithoutSourceMapWithoutComments(node: Node, allowGeneratedIdentifiers?: boolean): void { if (!node) { return; } @@ -5564,7 +5608,7 @@ module ts { return emitPinnedOrTripleSlashComments(node); } - emitJavaScriptWorker(node); + emitJavaScriptWorker(node, allowGeneratedIdentifiers); } function shouldEmitLeadingAndTrailingComments(node: Node) { @@ -5594,11 +5638,11 @@ module ts { return true; } - function emitJavaScriptWorker(node: Node) { + function emitJavaScriptWorker(node: Node, allowGeneratedIdentifiers: boolean = true) { // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { case SyntaxKind.Identifier: - return emitIdentifier(node); + return emitIdentifier(node, allowGeneratedIdentifiers); case SyntaxKind.Parameter: return emitParameter(node); case SyntaxKind.MethodDeclaration: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 7f89ff6153b..6aed05193e8 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -8,7 +8,7 @@ module ts { export function getNodeConstructor(kind: SyntaxKind): new () => Node { return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)); } - + export function createNode(kind: SyntaxKind): Node { return new (getNodeConstructor(kind))(); } @@ -95,6 +95,7 @@ module ts { visitNodes(cbNodes, (node).typeParameters) || visitNodes(cbNodes, (node).parameters) || visitNode(cbNode, (node).type) || + visitNode(cbNode, (node).equalsGreaterThanToken) || visitNode(cbNode, (node).body); case SyntaxKind.TypeReference: return visitNode(cbNode, (node).typeName) || @@ -282,7 +283,8 @@ module ts { visitNode(cbNode, (node).name); case SyntaxKind.ExportAssignment: return visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, (node).expression); + visitNode(cbNode, (node).expression) || + visitNode(cbNode, (node).type); case SyntaxKind.TemplateExpression: return visitNode(cbNode, (node).head) || visitNodes(cbNodes, (node).templateSpans); case SyntaxKind.TemplateSpan: @@ -369,7 +371,7 @@ module ts { function fixupParentReferences(sourceFile: SourceFile) { // normally parent references are set during binding. However, for clients that only need - // a syntax tree, and no semantic features, then the binding process is an unnecessary + // a syntax tree, and no semantic features, then the binding process is an unnecessary // overhead. This functions allows us to set all the parents, without all the expense of // binding. @@ -379,7 +381,7 @@ module ts { function visitNode(n: Node): void { // walk down setting parents that differ from the parent we think it should be. This - // allows us to quickly bail out of setting parents for subtrees during incremental + // allows us to quickly bail out of setting parents for subtrees during incremental // parsing if (n.parent !== parent) { n.parent = parent; @@ -417,7 +419,7 @@ module ts { var text = oldText.substring(node.pos, node.end); } - // Ditch any existing LS children we may have created. This way we can avoid + // Ditch any existing LS children we may have created. This way we can avoid // moving them forward. node._children = undefined; node.pos += delta; @@ -455,9 +457,9 @@ module ts { // We may need to update both the 'pos' and the 'end' of the element. - // If the 'pos' is before the start of the change, then we don't need to touch it. - // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have + // If the 'pos' is before the start of the change, then we don't need to touch it. + // If it isn't, then the 'pos' must be inside the change. How we update it will + // depend if delta is positive or negative. If delta is positive then we have // something like: // // -------------------AAA----------------- @@ -471,7 +473,7 @@ module ts { // -------------------XXXYYYYYYY----------------- // -------------------ZZZ----------------- // - // In this case, any element that started in the 'X' range will keep its position. + // In this case, any element that started in the 'X' range will keep its position. // However any element htat started after that will have their pos adjusted to be // at the end of the new range. i.e. any node that started in the 'Y' range will // be adjusted to have their start at the end of the 'Z' range. @@ -481,7 +483,7 @@ module ts { element.pos = Math.min(element.pos, changeRangeNewEnd); // If the 'end' is after the change range, then we always adjust it by the delta - // amount. However, if the end is in the change range, then how we adjust it + // amount. However, if the end is in the change range, then how we adjust it // will depend on if delta is positive or negative. If delta is positive then we // have something like: // @@ -496,7 +498,7 @@ module ts { // -------------------XXXYYYYYYY----------------- // -------------------ZZZ----------------- // - // In this case, any element that ended in the 'X' range will keep its position. + // In this case, any element that ended in the 'X' range will keep its position. // However any element htat ended after that will have their pos adjusted to be // at the end of the new range. i.e. any node that ended in the 'Y' range will // be adjusted to have their end at the end of the 'Z' range. @@ -505,7 +507,7 @@ module ts { element.end += delta; } else { - // Element ends in the change range. The element will keep its position if + // Element ends in the change range. The element will keep its position if // possible. Or Move backward to the new-end if it's in the 'Y' range. element.end = Math.min(element.end, changeRangeNewEnd); } @@ -544,7 +546,7 @@ module ts { function visitNode(child: IncrementalNode) { Debug.assert(child.pos <= child.end); if (child.pos > changeRangeOldEnd) { - // Node is entirely past the change range. We need to move both its pos and + // Node is entirely past the change range. We need to move both its pos and // end, forward or backward appropriately. moveElementEntirelyPastChangeRange(child, /*isArray:*/ false, delta, oldText, newText, aggressiveChecks); return; @@ -607,12 +609,12 @@ module ts { // If the text changes with an insertion of / just before the semicolon then we end up with: // void foo() { //; } // - // If we were to just use the changeRange a is, then we would not rescan the { token + // If we were to just use the changeRange a is, then we would not rescan the { token // (as it does not intersect the actual original change range). Because an edit may // change the token touching it, we actually need to look back *at least* one token so - // that the prior token sees that change. + // that the prior token sees that change. let maxLookahead = 1; - + let start = changeRange.span.start; // the first iteration aligns us with the change start. subsequent iteration move us to @@ -676,7 +678,7 @@ module ts { return; } - // If the child intersects this position, then this node is currently the nearest + // If the child intersects this position, then this node is currently the nearest // node that starts before the position. if (child.pos <= position) { if (child.pos >= bestResult.pos) { @@ -687,7 +689,7 @@ module ts { // Now, the node may overlap the position, or it may end entirely before the // position. If it overlaps with the position, then either it, or one of its - // children must be the nearest node before the position. So we can just + // children must be the nearest node before the position. So we can just // recurse into this child to see if we can find something better. if (position < child.end) { // The nearest node is either this child, or one of the children inside @@ -703,15 +705,15 @@ module ts { Debug.assert(child.end <= position); // The child ends entirely before this position. Say you have the following // (where $ is the position) - // - // ? $ : <...> <...> // - // We would want to find the nearest preceding node in "complex expr 2". + // ? $ : <...> <...> + // + // We would want to find the nearest preceding node in "complex expr 2". // To support that, we keep track of this node, and once we're done searching // for a best node, we recurse down this node to see if we can find a good // result in it. // - // This approach allows us to quickly skip over nodes that are entirely + // This approach allows us to quickly skip over nodes that are entirely // before the position, while still allowing us to find any nodes in the // last one that might be what we want. lastNodeEntirelyBeforePosition = child; @@ -744,13 +746,13 @@ module ts { } } - // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter + // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter // indicates what changed between the 'text' that this SourceFile has and the 'newText'. - // The SourceFile will be created with the compiler attempting to reuse as many nodes from + // The SourceFile will be created with the compiler attempting to reuse as many nodes from // this file as possible. // // Note: this function mutates nodes from this SourceFile. That means any existing nodes - // from this SourceFile that are being held onto may change as a result (including + // from this SourceFile that are being held onto may change as a result (including // becoming detached from any SourceFile). It is recommended that this SourceFile not // be used once 'update' is called on it. export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile { @@ -769,7 +771,7 @@ module ts { } // Make sure we're not trying to incrementally update a source file more than once. Once - // we do an update the original source file is considered unusbale from that point onwards. + // we do an update the original source file is considered unusbale from that point onwards. // // This is because we do incremental parsing in-place. i.e. we take nodes from the old // tree and give them new positions and parents. From that point on, trusting the old @@ -781,24 +783,24 @@ module ts { let oldText = sourceFile.text; let syntaxCursor = createSyntaxCursor(sourceFile); - // Make the actual change larger so that we know to reparse anything whose lookahead + // Make the actual change larger so that we know to reparse anything whose lookahead // might have intersected the change. let changeRange = extendToAffectedRange(sourceFile, textChangeRange); checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - // Ensure that extending the affected range only moved the start of the change range + // Ensure that extending the affected range only moved the start of the change range // earlier in the file. Debug.assert(changeRange.span.start <= textChangeRange.span.start); Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); - // The is the amount the nodes after the edit range need to be adjusted. It can be + // The is the amount the nodes after the edit range need to be adjusted. It can be // positive (if the edit added characters), negative (if the edit deleted characters) // or zero (if this was a pure overwrite with nothing added/removed). let delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; // If we added or removed characters during the edit, then we need to go and adjust all - // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they + // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they // may move backward (if we deleted chars). // // Doing this helps us out in two ways. First, it means that any nodes/tokens we want @@ -811,7 +813,7 @@ module ts { // // We will also adjust the positions of nodes that intersect the change range as well. // By doing this, we ensure that all the positions in the old tree are consistent, not - // just the positions of nodes entirely before/after the change range. By being + // just the positions of nodes entirely before/after the change range. By being // consistent, we can then easily map from positions to nodes in the old tree easily. // // Also, mark any syntax elements that intersect the changed span. We know, up front, @@ -822,15 +824,15 @@ module ts { // Now that we've set up our internal incremental state just proceed and parse the // source file in the normal fashion. When possible the parser will retrieve and // reuse nodes from the old tree. - // + // // Note: passing in 'true' for setNodeParents is very important. When incrementally // parsing, we will be reusing nodes from the old tree, and placing it into new - // parents. If we don't set the parents now, we'll end up with an observably - // inconsistent tree. Setting the parents on the new tree should be very fast. We + // parents. If we don't set the parents now, we'll end up with an observably + // inconsistent tree. Setting the parents on the new tree should be very fast. We // will immediately bail out of walking any subtrees when we can see that their parents // are already correct. - let result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true) - + let result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true) + return result; } @@ -885,13 +887,13 @@ module ts { return { currentNode(position: number) { - // Only compute the current node if the position is different than the last time - // we were asked. The parser commonly asks for the node at the same position + // Only compute the current node if the position is different than the last time + // we were asked. The parser commonly asks for the node at the same position // twice. Once to know if can read an appropriate list element at a certain point, // and then to actually read and consume the node. if (position !== lastQueriedPosition) { - // Much of the time the parser will need the very next node in the array that - // we just returned a node from.So just simply check for that case and move + // Much of the time the parser will need the very next node in the array that + // we just returned a node from.So just simply check for that case and move // forward in the array instead of searching for the node again. if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { currentArrayIndex++; @@ -905,7 +907,7 @@ module ts { } } - // Cache this query so that we don't do any extra work if the parser calls back + // Cache this query so that we don't do any extra work if the parser calls back // into us. Note: this is very common as the parser will make pairs of calls like // 'isListElement -> parseListElement'. If we were unable to find a node when // called with 'isListElement', we don't want to redo the work when parseListElement @@ -917,7 +919,7 @@ module ts { return current; } }; - + // Finds the highest element in the tree we can find that starts at the provided position. // The element must be a direct child of some node list in the tree. This way after we // return it, we can easily return its next sibling in the list. @@ -960,7 +962,7 @@ module ts { } else { if (child.pos < position && position < child.end) { - // Position in somewhere within this child. Search in it and + // Position in somewhere within this child. Search in it and // stop searching in this array. forEachChild(child, visitNode, visitArray); return true; @@ -1007,10 +1009,10 @@ module ts { // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is // that some tokens that would be considered identifiers may be considered keywords. // - // When adding more parser context flags, consider which is the more common case that the + // When adding more parser context flags, consider which is the more common case that the // flag will be in. This should be hte 'false' state for that flag. The reason for this is // that we don't store data in our nodes unless the value is in the *non-default* state. So, - // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost // all nodes would need extra state on them to store this info. // @@ -1030,20 +1032,20 @@ module ts { // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] // - // Where you have to be careful is then understanding what the points are in the grammar + // Where you have to be careful is then understanding what the points are in the grammar // where the values are *not* passed along. For example: // // SingleNameBinding[Yield,GeneratorParameter] // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt // - // Here this is saying that if the GeneratorParameter context flag is set, that we should + // Here this is saying that if the GeneratorParameter context flag is set, that we should // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier // and we should explicitly unset the 'yield' context flag before calling into the Initializer. - // production. Conversely, if the GeneratorParameter context flag is not set, then we + // production. Conversely, if the GeneratorParameter context flag is not set, then we // should leave the 'yield' context flag alone. // - // Getting this all correct is tricky and requires careful reading of the grammar to + // Getting this all correct is tricky and requires careful reading of the grammar to // understand when these values should be changed versus when they should be inherited. // // Note: it should not be necessary to save/restore these flags during speculative/lookahead @@ -1051,7 +1053,7 @@ module ts { // descent parsing and unwinding. let contextFlags: ParserContextFlags = 0; - // Whether or not we've had a parse error since creating the last AST node. If we have + // Whether or not we've had a parse error since creating the last AST node. If we have // encountered an error, it will be stored on the next AST node we create. Parse errors // can be broken down into three categories: // @@ -1062,7 +1064,7 @@ module ts { // by the 'parseExpected' function. // // 3) A token was present that no parsing function was able to consume. This type of error - // only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser + // only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser // decides to skip the token. // // In all of these cases, we want to mark the next node as having had an error before it. @@ -1071,8 +1073,8 @@ module ts { // node. in that event we would then not produce the same errors as we did before, causing // significant confusion problems. // - // Note: it is necessary that this value be saved/restored during speculative/lookahead - // parsing. During lookahead parsing, we will often create a node. That node will have + // Note: it is necessary that this value be saved/restored during speculative/lookahead + // parsing. During lookahead parsing, we will often create a node. That node will have // this value attached, and then this value will be set back to 'false'. If we decide to // rewind, we must get back to the same value we had prior to the lookahead. // @@ -1135,7 +1137,7 @@ module ts { setDisallowInContext(true); return result; } - + // no need to do anything special if 'in' is already allowed. return func(); } @@ -1206,7 +1208,7 @@ module ts { sourceFile.parseDiagnostics.push(createFileDiagnostic(sourceFile, start, length, message, arg0)); } - // Mark that we've encountered an error. We'll set an appropriate bit on the next + // Mark that we've encountered an error. We'll set an appropriate bit on the next // node we finish so that it can't be reused incrementally. parseErrorBeforeNextFinishedNode = true; } @@ -1245,7 +1247,7 @@ module ts { } function speculationHelper(callback: () => T, isLookAhead: boolean): T { - // Keep track of the state we'll need to rollback to if lookahead fails (or if the + // Keep track of the state we'll need to rollback to if lookahead fails (or if the // caller asked us to always reset our state). let saveToken = token; let saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; @@ -1253,13 +1255,13 @@ module ts { // Note: it is not actually necessary to save/restore the context flags here. That's // because the saving/restorating of these flags happens naturally through the recursive - // descent nature of our parser. However, we still store this here just so we can + // descent nature of our parser. However, we still store this here just so we can // assert that that invariant holds. let saveContextFlags = contextFlags; // If we're only looking ahead, then tell the scanner to only lookahead as well. - // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the - // same. + // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the + // same. let result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); @@ -1277,15 +1279,15 @@ module ts { return result; } - // Invokes the provided callback then unconditionally restores the parser to the state it + // Invokes the provided callback then unconditionally restores the parser to the state it // was in immediately prior to invoking the callback. The result of invoking the callback // is returned from this function. function lookAhead(callback: () => T): T { return speculationHelper(callback, /*isLookAhead:*/ true); } - + // Invokes the provided callback. If the callback returns something falsy, then it restores - // the parser to the state it was in immediately prior to invoking the callback. If the + // the parser to the state it was in immediately prior to invoking the callback. If the // callback returns something truthy, then the parser state is not rolled back. The result // of invoking the callback is returned from this function. function tryParse(callback: () => T): T { @@ -1296,8 +1298,8 @@ module ts { if (token === SyntaxKind.Identifier) { return true; } - - // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. if (token === SyntaxKind.YieldKeyword && inYieldContext()) { return false; @@ -1464,7 +1466,7 @@ module ts { // LiteralPropertyName // [+GeneratorParameter] ComputedPropertyName // [~GeneratorParameter] ComputedPropertyName[?Yield] - // + // // ComputedPropertyName[Yield] : // [ AssignmentExpression[In, ?Yield] ] // @@ -1648,13 +1650,13 @@ module ts { } function isVariableDeclaratorListTerminator(): boolean { - // If we can consume a semicolon (either explicitly, or with ASI), then consider us done + // If we can consume a semicolon (either explicitly, or with ASI), then consider us done // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } - // in the case where we're parsing the variable declarator of a 'for-in' statement, we + // in the case where we're parsing the variable declarator of a 'for-in' statement, we // are done if we see an 'in' keyword in front of us. Same with for-of if (isInOrOfKeyword(token)) { return true; @@ -1730,7 +1732,7 @@ module ts { if (node) { return consumeNode(node); } - + return parseElement(); } @@ -1738,9 +1740,9 @@ module ts { // If there is an outstanding parse error that we've encountered, but not attached to // some node, then we cannot get a node from the old source tree. This is because we // want to mark the next node we encounter as being unusable. - // + // // Note: This may be too conservative. Perhaps we could reuse hte node and set the bit - // on it (or its leftmost child) as having the error. For now though, being conservative + // on it (or its leftmost child) as having the error. For now though, being conservative // is nice and likely won't ever affect perf. if (parseErrorBeforeNextFinishedNode) { return undefined; @@ -1763,18 +1765,18 @@ module ts { return undefined; } - // Can't reuse a node that contains a parse error. This is necessary so that we + // Can't reuse a node that contains a parse error. This is necessary so that we // produce the same set of errors again. if (containsParseError(node)) { return undefined; } - // We can only reuse a node if it was parsed under the same strict mode that we're + // We can only reuse a node if it was parsed under the same strict mode that we're // currently in. i.e. if we originally parsed a node in non-strict mode, but then // the user added 'using strict' at the top of the file, then we can't use that node // again as the presense of strict mode may cause us to parse the tokens in the file // differetly. - // + // // Note: we *can* reuse tokens when the strict mode changes. That's because tokens // are unaffected by strict mode. It's just the parser will decide what to do with it // differently depending on what mode it is in. @@ -1828,32 +1830,32 @@ module ts { case ParsingContext.Parameters: return isReusableParameter(node); - // Any other lists we do not care about reusing nodes in. But feel free to add if + // Any other lists we do not care about reusing nodes in. But feel free to add if // you can do so safely. Danger areas involve nodes that may involve speculative // parsing. If speculative parsing is involved with the node, then the range the // parser reached while looking ahead might be in the edited range (see the example // in canReuseVariableDeclaratorNode for a good case of this). case ParsingContext.HeritageClauses: - // This would probably be safe to reuse. There is no speculative parsing with + // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. case ParsingContext.TypeReferences: - // This would probably be safe to reuse. There is no speculative parsing with + // This would probably be safe to reuse. There is no speculative parsing with // type names in a heritage clause. There can be generic names in the type - // name list. But because it is a type context, we never use speculative + // name list. But because it is a type context, we never use speculative // parsing on the type argument list. case ParsingContext.TypeParameters: - // This would probably be safe to reuse. There is no speculative parsing with + // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in // unambiguous *type* contexts. While type *arguments* occur in very ambiguous // *expression* contexts. case ParsingContext.TupleElementTypes: - // This would probably be safe to reuse. There is no speculative parsing with + // This would probably be safe to reuse. There is no speculative parsing with // tuple types. - // Technically, type argument list types are probably safe to reuse. While + // Technically, type argument list types are probably safe to reuse. While // speculative parsing is involved with them (since type argument lists are only // produced from speculative parsing a < as a type argument list), we only have // the types because speculative parsing succeeded. Thus, the lookahead never @@ -1861,12 +1863,12 @@ module ts { case ParsingContext.TypeArguments: // Note: these are almost certainly not safe to ever reuse. Expressions commonly - // need a large amount of lookahead, and we should not reuse them as they may + // need a large amount of lookahead, and we should not reuse them as they may // have actually intersected the edit. case ParsingContext.ArgumentExpressions: // This is not safe to reuse for the same reason as the 'AssignmentExpression' - // cases. i.e. a property assignment may end with an expression, and thus might + // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. case ParsingContext.ObjectLiteralMembers: } @@ -1980,12 +1982,12 @@ module ts { // // let v = new List < A, B // - // This is actually legal code. It's a list of variable declarators "v = new List() - // - // then we have a problem. "v = new ListcreateMissingNode(SyntaxKind.Identifier, /*reportAtCurrentToken:*/ true, Diagnostics.Identifier_expected); } @@ -2185,7 +2187,7 @@ module ts { if (scanner.hasExtendedUnicodeEscape()) { node.hasExtendedUnicodeEscape = true; } - + if (scanner.isUnterminated()) { node.isUnterminated = true; } @@ -2193,7 +2195,7 @@ module ts { let tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - + // Octal literals are not allowed in strict mode or ES5 // Note that theoretically the following condition would hold true literals like 009, // which is not octal.But because of how the scanner separates the tokens, we would @@ -2232,7 +2234,7 @@ module ts { let node = createNode(SyntaxKind.TypeParameter); node.name = parseIdentifier(); if (parseOptional(SyntaxKind.ExtendsKeyword)) { - // It's not uncommon for people to write improper constraints to a generic. If the + // It's not uncommon for people to write improper constraints to a generic. If the // user writes a constraint that is an expression and not an actual type, then parse // it out as an expression (so we can recover well), but report that a type is needed // instead. @@ -2294,7 +2296,7 @@ module ts { if (getFullWidth(node.name) === 0 && node.flags === 0 && isModifier(token)) { // in cases like - // 'use strict' + // 'use strict' // function foo(static) // isParameter('static') === true, because of isModifier('static') // however 'static' is not a legal identifier in a strict mode. @@ -2341,7 +2343,7 @@ module ts { } } - // Note: after careful analysis of the grammar, it does not appear to be possible to + // Note: after careful analysis of the grammar, it does not appear to be possible to // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling // this FormalParameters production either always sets both to true, or always sets // both to false. As such we only have a single parameter to represent both. @@ -2388,7 +2390,7 @@ module ts { } function parseTypeMemberSemicolon() { - // We allow type members to be separated by commas or (possibly ASI) semicolons. + // We allow type members to be separated by commas or (possibly ASI) semicolons. // First check if it was a comma. If so, we're done with the member. if (parseOptional(SyntaxKind.CommaToken)) { return; @@ -2561,9 +2563,9 @@ module ts { case SyntaxKind.NumericLiteral: return parsePropertyOrMethodSignature(); default: - // Index declaration as allowed as a type member. But as per the grammar, + // Index declaration as allowed as a type member. But as per the grammar, // they also allow modifiers. So we have to check for an index declaration - // that might be following modifiers. This ensures that things work properly + // that might be following modifiers. This ensures that things work properly // when incrementally parsing as the parser will produce the Index declaration // if it has the same text regardless of whether it is inside a class or an // object type. @@ -2844,7 +2846,7 @@ module ts { function parseExpression(): Expression { // Expression[in]: - // AssignmentExpression[in] + // AssignmentExpression[in] // Expression[in] , AssignmentExpression[in] let expr = parseAssignmentExpressionOrHigher(); @@ -2860,13 +2862,13 @@ module ts { // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse // this as an equals-value clause with a missing equals. - // NOTE: There are two places where we allow equals-value clauses. The first is in a + // NOTE: There are two places where we allow equals-value clauses. The first is in a // variable declarator. The second is with a parameter. For variable declarators // it's more likely that a { would be a allowed (as an object literal). While this // is also allowed for parameters, the risk is that we consume the { as an object // literal when it really will be for the block following the parameter. if (scanner.hasPrecedingLineBreak() || (inParameter && token === SyntaxKind.OpenBraceToken) || !isStartOfExpression()) { - // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - + // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - // do not try to parse initializer return undefined; } @@ -2887,17 +2889,17 @@ module ts { // 4) ArrowFunctionExpression[?in,?yield] // 5) [+Yield] YieldExpression[?In] // - // Note: for ease of implementation we treat productions '2' and '3' as the same thing. + // Note: for ease of implementation we treat productions '2' and '3' as the same thing. // (i.e. they're both BinaryExpressions with an assignment operator in it). // First, do the simple check if we have a YieldExpression (production '5'). if (isYieldExpression()) { return parseYieldExpression(); - } + } // Then, check if we have an arrow function (production '4') that starts with a parenthesized // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is - // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. let arrowExpression = tryParseParenthesizedArrowFunctionExpression(); if (arrowExpression) { @@ -2908,9 +2910,9 @@ module ts { // start with a LogicalOrExpression, while the assignment productions can only start with // LeftHandSideExpressions. // - // So, first, we try to just parse out a BinaryExpression. If we get something that is a - // LeftHandSide or higher, then we can try to parse out the assignment expression part. - // Otherwise, we try to parse out the conditional expression bit. We want to allow any + // So, first, we try to just parse out a BinaryExpression. If we get something that is a + // LeftHandSide or higher, then we can try to parse out the assignment expression part. + // Otherwise, we try to parse out the conditional expression bit. We want to allow any // binary expression here, so we pass in the 'lowest' precedence here so that it matches // and consumes anything. let expr = parseBinaryExpressionOrHigher(/*precedence:*/ 0); @@ -2923,7 +2925,7 @@ module ts { } // Now see if we might be in cases '2' or '3'. - // If the expression was a LHS expression, and we have an assignment operator, then + // If the expression was a LHS expression, and we have an assignment operator, then // we're in '2' or '3'. Consume the assignment and return. // // Note: we call reScanGreaterToken so that we get an appropriately merged token @@ -2938,7 +2940,7 @@ module ts { function isYieldExpression(): boolean { if (token === SyntaxKind.YieldKeyword) { - // If we have a 'yield' keyword, and htis is a context where yield expressions are + // If we have a 'yield' keyword, and htis is a context where yield expressions are // allowed, then definitely parse out a yield expression. if (inYieldContext()) { return true; @@ -2953,12 +2955,12 @@ module ts { // We're in a context where 'yield expr' is not allowed. However, if we can // definitely tell that the user was trying to parse a 'yield expr' and not // just a normal expr that start with a 'yield' identifier, then parse out - // a 'yield expr'. We can then report an error later that they are only + // a 'yield expr'. We can then report an error later that they are only // allowed in generator expressions. - // + // // for example, if we see 'yield(foo)', then we'll have to treat that as an // invocation expression of something called 'yield'. However, if we have - // 'yield foo' then that is not legal as a normal expression, so we can + // 'yield foo' then that is not legal as a normal expression, so we can // definitely recognize this as a yield expression. // // for now we just check if the next token is an identifier. More heuristics @@ -2997,7 +2999,7 @@ module ts { return finishNode(node); } else { - // if the next token is not on the same line as yield. or we don't have an '*' or + // if the next token is not on the same line as yield. or we don't have an '*' or // the start of an expressin, then this is just a simple "yield" expression. return finishNode(node); } @@ -3006,17 +3008,17 @@ module ts { function parseSimpleArrowFunctionExpression(identifier: Identifier): Expression { Debug.assert(token === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - let node = createNode(SyntaxKind.ArrowFunction, identifier.pos); - + let node = createNode(SyntaxKind.ArrowFunction, identifier.pos); + let parameter = createNode(SyntaxKind.Parameter, identifier.pos); - parameter.name = identifier; + parameter.name = identifier; finishNode(parameter); node.parameters = >[parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - parseExpected(SyntaxKind.EqualsGreaterThanToken); + node.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, false, Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); @@ -3043,15 +3045,13 @@ module ts { return undefined; } - // If we have an arrow, then try to parse the body. Even if not, try to parse if we + // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. - if (parseExpected(SyntaxKind.EqualsGreaterThanToken) || token === SyntaxKind.OpenBraceToken) { - arrowFunction.body = parseArrowFunctionExpressionBody(); - } - else { - // If not, we're probably better off bailing out and returning a bogus function expression. - arrowFunction.body = parseIdentifier(); - } + var lastToken = token; + arrowFunction.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, /*reportAtCurrentPosition:*/false, Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === SyntaxKind.EqualsGreaterThanToken || lastToken === SyntaxKind.OpenBraceToken) + ? parseArrowFunctionExpressionBody() + : parseIdentifier(); return finishNode(arrowFunction); } @@ -3135,18 +3135,18 @@ module ts { } } - function parsePossibleParenthesizedArrowFunctionExpressionHead() { + function parsePossibleParenthesizedArrowFunctionExpressionHead(): ArrowFunction { return parseParenthesizedArrowFunctionExpressionHead(/*allowAmbiguity:*/ false); } - function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity: boolean): FunctionExpression { - let node = createNode(SyntaxKind.ArrowFunction); - // Arrow functions are never generators. - // + function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity: boolean): ArrowFunction { + let node = createNode(SyntaxKind.ArrowFunction); + // Arrow functions are never generators. + // // If we're speculatively parsing a signature for a parenthesized arrow function, then // we have to have a complete parameter list. Otherwise we might see something like // a => (b => c) - // And think that "(b =>" was actually a parenthesized arrow function with a missing + // And think that "(b =>" was actually a parenthesized arrow function with a missing // close paren. fillSignature(SyntaxKind.ColonToken, /*yieldAndGeneratorParameterContext:*/ false, /*requireCompleteParameterList:*/ !allowAmbiguity, node); @@ -3179,7 +3179,7 @@ module ts { if (isStartOfStatement(/*inErrorRecovery:*/ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) // - // Here we try to recover from a potential error situation in the case where the + // Here we try to recover from a potential error situation in the case where the // user meant to supply a block. For example, if the user wrote: // // a => @@ -3204,10 +3204,10 @@ module ts { return leftOperand; } - // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and - // we do not that for the 'whenFalse' part. + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. let node = createNode(SyntaxKind.ConditionalExpression, leftOperand.pos); - node.condition = leftOperand; + node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = allowInAnd(parseAssignmentExpressionOrHigher); node.colonToken = parseExpectedToken(SyntaxKind.ColonToken, /*reportAtCurrentPosition:*/ false, @@ -3227,7 +3227,7 @@ module ts { function parseBinaryExpressionRest(precedence: number, leftOperand: Expression): Expression { while (true) { - // We either have a binary operator here, or we're finished. We call + // We either have a binary operator here, or we're finished. We call // reScanGreaterToken so that we merge token sequences like > and = into >= reScanGreaterToken(); @@ -3374,15 +3374,15 @@ module ts { function parseLeftHandSideExpressionOrHigher(): LeftHandSideExpression { // Original Ecma: - // LeftHandSideExpression: See 11.2 + // LeftHandSideExpression: See 11.2 // NewExpression - // CallExpression + // CallExpression // // Our simplification: // - // LeftHandSideExpression: See 11.2 - // MemberExpression - // CallExpression + // LeftHandSideExpression: See 11.2 + // MemberExpression + // CallExpression // // See comment in parseMemberExpressionOrHigher on how we replaced NewExpression with // MemberExpression to make our lives easier. @@ -3391,14 +3391,14 @@ module ts { // out into its own productions: // // CallExpression: - // MemberExpression Arguments + // MemberExpression Arguments // CallExpression Arguments // CallExpression[Expression] // CallExpression.IdentifierName // super ( ArgumentListopt ) // super.IdentifierName // - // Because of the recursion in these calls, we need to bottom out first. There are two + // Because of the recursion in these calls, we need to bottom out first. There are two // bottom out states we can run into. Either we see 'super' which must start either of // the last two CallExpression productions. Or we have a MemberExpression which either // completes the LeftHandSideExpression, or starts the beginning of the first four @@ -3407,7 +3407,7 @@ module ts { ? parseSuperExpression() : parseMemberExpressionOrHigher(); - // Now, we *may* be complete. However, we might have consumed the start of a + // Now, we *may* be complete. However, we might have consumed the start of a // CallExpression. As such, we need to consume the rest of it here to be complete. return parseCallExpressionRest(expression); } @@ -3417,39 +3417,39 @@ module ts { // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. // like so: // - // PrimaryExpression : See 11.1 + // PrimaryExpression : See 11.1 // this // Identifier // Literal // ArrayLiteral // ObjectLiteral - // (Expression) + // (Expression) // FunctionExpression // new MemberExpression Arguments? // - // MemberExpression : See 11.2 - // PrimaryExpression + // MemberExpression : See 11.2 + // PrimaryExpression // MemberExpression[Expression] // MemberExpression.IdentifierName // - // CallExpression : See 11.2 - // MemberExpression + // CallExpression : See 11.2 + // MemberExpression // CallExpression Arguments // CallExpression[Expression] - // CallExpression.IdentifierName + // CallExpression.IdentifierName // // Technically this is ambiguous. i.e. CallExpression defines: // // CallExpression: // CallExpression Arguments - // + // // If you see: "new Foo()" // - // Then that could be treated as a single ObjectCreationExpression, or it could be + // Then that could be treated as a single ObjectCreationExpression, or it could be // treated as the invocation of "new Foo". We disambiguate that in code (to match // the original grammar) by making sure that if we see an ObjectCreationExpression // we always consume arguments if they are there. So we treat "new Foo()" as an - // object creation only, and not at all as an invocation) Another way to think + // object creation only, and not at all as an invocation) Another way to think // about this is that for every "new" that we see, we will consume an argument list if // it is there as part of the *associated* object creation node. Any additional // argument lists we see, will become invocation expressions. @@ -3539,7 +3539,7 @@ module ts { if (token === SyntaxKind.LessThanToken) { // See if this is the start of a generic invocation. If so, consume it and - // keep checking for postfix expressions. Otherwise, it's just a '<' that's + // keep checking for postfix expressions. Otherwise, it's just a '<' that's // part of an arithmetic expression. Break out so we consume it higher in the // stack. let typeArguments = tryParse(parseTypeArgumentsInExpression); @@ -3593,8 +3593,8 @@ module ts { function canFollowTypeArgumentsInExpression(): boolean { switch (token) { - case SyntaxKind.OpenParenToken: // foo( - // this case are the only case where this token can legally follow a type argument + case SyntaxKind.OpenParenToken: // foo( + // this case are the only case where this token can legally follow a type argument // list. So we definitely want to treat this as a type arg list. case SyntaxKind.DotToken: // foo. @@ -3615,7 +3615,7 @@ module ts { case SyntaxKind.BarToken: // foo | case SyntaxKind.CloseBraceToken: // foo } case SyntaxKind.EndOfFileToken: // foo - // these cases can't legally follow a type arg list. However, they're not legal + // these cases can't legally follow a type arg list. However, they're not legal // expressions either. The user is probably in the middle of a generic type. So // treat it as such. return true; @@ -3836,7 +3836,7 @@ module ts { parseExpected(SyntaxKind.CloseParenToken); // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html - // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in + // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby // do;while(0)x will have a semicolon inserted before x. parseOptional(SyntaxKind.SemicolonToken); @@ -3974,9 +3974,9 @@ module ts { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; - // Because of automatic semicolon insertion, we need to report error if this + // Because of automatic semicolon insertion, we need to report error if this // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' - // directly as that might consume an expression on the following line. + // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. let node = createNode(SyntaxKind.ThrowStatement); @@ -4046,9 +4046,9 @@ module ts { function isStartOfStatement(inErrorRecovery: boolean): boolean { // Functions and variable statements are allowed as a statement. But as per the grammar, - // they also allow modifiers. So we have to check for those statements that might be - // following modifiers.This ensures that things work properly when incrementally parsing - // as the parser will produce the same FunctionDeclaraiton or VariableStatement if it has + // they also allow modifiers. So we have to check for those statements that might be + // following modifiers.This ensures that things work properly when incrementally parsing + // as the parser will produce the same FunctionDeclaraiton or VariableStatement if it has // the same text regardless of whether it is inside a block or not. if (isModifier(token)) { let result = lookAhead(parseVariableStatementOrFunctionDeclarationWithModifiers); @@ -4134,7 +4134,7 @@ module ts { return parseBlock(/*ignoreMissingOpenBrace:*/ false, /*checkForStrictMode:*/ false); case SyntaxKind.VarKeyword: case SyntaxKind.ConstKeyword: - // const here should always be parsed as const declaration because of check in 'isStatement' + // const here should always be parsed as const declaration because of check in 'isStatement' return parseVariableStatement(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(scanner.getStartPos(), /*modifiers:*/ undefined); @@ -4174,8 +4174,8 @@ module ts { } // Else parse it like identifier - fall through default: - // Functions and variable statements are allowed as a statement. But as per - // the grammar, they also allow modifiers. So we have to check for those + // Functions and variable statements are allowed as a statement. But as per + // the grammar, they also allow modifiers. So we have to check for those // statements that might be following modifiers. This ensures that things // work properly when incrementally parsing as the parser will produce the // same FunctionDeclaraiton or VariableStatement if it has the same text @@ -4336,7 +4336,7 @@ module ts { return finishNode(node); } - + function canFollowContextualOfKeyword(): boolean { return nextTokenIsIdentifier() && nextToken() === SyntaxKind.CloseParenToken; } @@ -4439,7 +4439,7 @@ module ts { if (token === SyntaxKind.OpenBracketToken) { return true; } - + // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. @@ -4718,7 +4718,7 @@ module ts { // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; if (identifier || // import id - token === SyntaxKind.AsteriskToken || // import * + token === SyntaxKind.AsteriskToken || // import * token === SyntaxKind.OpenBraceToken) { // import { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); parseExpected(SyntaxKind.FromKeyword); @@ -4744,7 +4744,7 @@ module ts { importClause.name = identifier; } - // If there was no default import or if there is comma token after default import + // If there was no default import or if there is comma token after default import // parse namespace or named imports if (!importClause.name || parseOptional(SyntaxKind.CommaToken)) { @@ -4770,12 +4770,12 @@ module ts { } function parseModuleSpecifier(): Expression { - // We allow arbitrary expressions here, even though the grammar only allows string + // We allow arbitrary expressions here, even though the grammar only allows string // literals. We check to ensure that it is only a string literal later in the grammar // walker. let result = parseExpression(); - // Ensure the string being required is in our 'identifier' table. This will ensure - // that features like 'find refs' will look inside this file when search for its name. + // Ensure the string being required is in our 'identifier' table. This will ensure + // that features like 'find refs' will look inside this file when search for its name. if (result.kind === SyntaxKind.StringLiteral) { internIdentifier((result).text); } @@ -4868,12 +4868,17 @@ module ts { setModifiers(node, modifiers); if (parseOptional(SyntaxKind.EqualsToken)) { node.isExportEquals = true; + node.expression = parseAssignmentExpressionOrHigher(); } else { parseExpected(SyntaxKind.DefaultKeyword); + if (parseOptional(SyntaxKind.ColonToken)) { + node.type = parseType(); + } + else { + node.expression = parseAssignmentExpressionOrHigher(); + } } - //node.exportName = parseIdentifier(); - node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } @@ -5013,8 +5018,8 @@ module ts { let amdDependencies: {path: string; name: string}[] = []; let amdModuleName: string; - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a + // Keep scanning all the leading trivia in the file until we get to something that + // isn't trivia. Any single line comment will be analyzed to see if it is a // reference comment. while (true) { let kind = triviaScanner.scan(); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 9b933cacf74..b6bff3c0937 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2,15 +2,15 @@ /// module ts { - /* @internal */ export var emitTime = 0; - /* @internal */ export var ioReadTime = 0; + /* @internal */ export let emitTime = 0; + /* @internal */ export let ioReadTime = 0; /** The version of the TypeScript compiler release */ - export var version = "1.5.0.0"; + export let version = "1.5.0.0"; export function createCompilerHost(options: CompilerOptions): CompilerHost { - var currentDirectory: string; - var existingDirectories: Map = {}; + let currentDirectory: string; + let existingDirectories: Map = {}; function getCanonicalFileName(fileName: string): string { // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. @@ -19,12 +19,13 @@ module ts { } // returned by CScript sys environment - var unsupportedFileEncodingErrorCode = -2147024809; + let unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile { + let text: string; try { - var start = new Date().getTime(); - var text = sys.readFile(fileName, options.charset); + let start = new Date().getTime(); + text = sys.readFile(fileName, options.charset); ioReadTime += new Date().getTime() - start; } catch (e) { @@ -53,7 +54,7 @@ module ts { function ensureDirectoriesExist(directoryPath: string) { if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = getDirectoryPath(directoryPath); + let parentDirectory = getDirectoryPath(directoryPath); ensureDirectoriesExist(parentDirectory); sys.createDirectory(directoryPath); } @@ -82,7 +83,7 @@ module ts { } export function getPreEmitDiagnostics(program: Program): Diagnostic[] { - var diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); + let diagnostics = program.getSyntacticDiagnostics().concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics()); return sortAndDeduplicateDiagnostics(diagnostics); } @@ -91,15 +92,15 @@ module ts { return messageText; } else { - var diagnosticChain = messageText; - var result = ""; + let diagnosticChain = messageText; + let result = ""; - var indent = 0; + let indent = 0; while (diagnosticChain) { if (indent) { result += newLine; - for (var i = 0; i < indent; i++) { + for (let i = 0; i < indent; i++) { result += " "; } } @@ -113,12 +114,12 @@ module ts { } export function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program { - var program: Program; - var files: SourceFile[] = []; - var filesByName: Map = {}; - var diagnostics = createDiagnosticCollection(); - var seenNoDefaultLib = options.noLib; - var commonSourceDirectory: string; + let program: Program; + let files: SourceFile[] = []; + let filesByName: Map = {}; + let diagnostics = createDiagnosticCollection(); + let seenNoDefaultLib = options.noLib; + let commonSourceDirectory: string; host = host || createCompilerHost(options); forEach(rootNames, name => processRootFile(name, false)); @@ -127,8 +128,8 @@ module ts { } verifyCompilerOptions(); - var diagnosticsProducingTypeChecker: TypeChecker; - var noDiagnosticsTypeChecker: TypeChecker; + let diagnosticsProducingTypeChecker: TypeChecker; + let noDiagnosticsTypeChecker: TypeChecker; program = { getSourceFile: getSourceFile, @@ -172,7 +173,7 @@ module ts { } function getDeclarationDiagnostics(targetSourceFile: SourceFile): Diagnostic[] { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); + let resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(targetSourceFile); return ts.getDeclarationDiagnostics(getEmitHost(), resolver, targetSourceFile); } @@ -186,11 +187,11 @@ module ts { // Create the emit resolver outside of the "emitTime" tracking code below. That way // any cost associated with it (like type checking) are appropriate associated with // the type-checking counter. - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + let emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); - var start = new Date().getTime(); + let start = new Date().getTime(); - var emitResult = emitFiles( + let emitResult = emitFiles( emitResolver, getEmitHost(writeFileCallback), sourceFile); @@ -209,7 +210,7 @@ module ts { return getDiagnostics(sourceFile); } - var allDiagnostics: Diagnostic[] = []; + let allDiagnostics: Diagnostic[] = []; forEach(program.getSourceFiles(), sourceFile => { addRange(allDiagnostics, getDiagnostics(sourceFile)); }); @@ -230,20 +231,20 @@ module ts { } function getSemanticDiagnosticsForFile(sourceFile: SourceFile): Diagnostic[] { - var typeChecker = getDiagnosticsProducingTypeChecker(); + let typeChecker = getDiagnosticsProducingTypeChecker(); Debug.assert(!!sourceFile.bindDiagnostics); - var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile); - var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); + let bindDiagnostics = sourceFile.bindDiagnostics; + let checkDiagnostics = typeChecker.getDiagnostics(sourceFile); + let programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); } function getGlobalDiagnostics(): Diagnostic[] { - var typeChecker = getDiagnosticsProducingTypeChecker(); + let typeChecker = getDiagnosticsProducingTypeChecker(); - var allDiagnostics: Diagnostic[] = []; + let allDiagnostics: Diagnostic[] = []; addRange(allDiagnostics, typeChecker.getGlobalDiagnostics()); addRange(allDiagnostics, diagnostics.getGlobalDiagnostics()); @@ -259,11 +260,13 @@ module ts { } function processSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number) { + let start: number; + let length: number; if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; + start = refPos; + length = refEnd - refPos; } - var diagnostic: DiagnosticMessage; + let diagnostic: DiagnosticMessage; if (hasExtension(fileName)) { if (!options.allowNonTsExtensions && !fileExtensionIs(host.getCanonicalFileName(fileName), ".ts")) { diagnostic = Diagnostics.File_0_must_have_extension_ts_or_d_ts; @@ -297,20 +300,20 @@ module ts { // Get source file from normalized fileName function findSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refStart?: number, refLength?: number): SourceFile { - var canonicalName = host.getCanonicalFileName(fileName); + let canonicalName = host.getCanonicalFileName(fileName); if (hasProperty(filesByName, canonicalName)) { // We've already looked for this file, use cached result return getSourceFileFromCache(fileName, canonicalName, /*useAbsolutePath*/ false); } else { - var normalizedAbsolutePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); - var canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); + let normalizedAbsolutePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + let canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); if (hasProperty(filesByName, canonicalAbsolutePath)) { return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, /*useAbsolutePath*/ true); } // We haven't looked for this file, do so now and cache result - var file = filesByName[canonicalName] = host.getSourceFile(fileName, options.target, hostErrorMessage => { + let file = filesByName[canonicalName] = host.getSourceFile(fileName, options.target, hostErrorMessage => { if (refFile) { diagnostics.add(createFileDiagnostic(refFile, refStart, refLength, Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); @@ -326,7 +329,7 @@ module ts { filesByName[canonicalAbsolutePath] = file; if (!options.noResolve) { - var basePath = getDirectoryPath(fileName); + let basePath = getDirectoryPath(fileName); processReferencedFiles(file, basePath); processImportedModules(file, basePath); } @@ -337,13 +340,14 @@ module ts { files.push(file); } } + + return file; } - return file; function getSourceFileFromCache(fileName: string, canonicalName: string, useAbsolutePath: boolean): SourceFile { - var file = filesByName[canonicalName]; + let file = filesByName[canonicalName]; if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; + let sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; if (canonicalName !== sourceFileName) { diagnostics.add(createFileDiagnostic(refFile, refStart, refLength, Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); @@ -355,7 +359,7 @@ module ts { function processReferencedFiles(file: SourceFile, basePath: string) { forEach(file.referencedFiles, ref => { - var referencedFileName = isRootedDiskPath(ref.fileName) ? ref.fileName : combinePaths(basePath, ref.fileName); + let referencedFileName = isRootedDiskPath(ref.fileName) ? ref.fileName : combinePaths(basePath, ref.fileName); processSourceFile(normalizePath(referencedFileName), /* isDefaultLib */ false, file, ref.pos, ref.end); }); } @@ -363,17 +367,17 @@ module ts { function processImportedModules(file: SourceFile, basePath: string) { forEach(file.statements, node => { if (node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration || node.kind === SyntaxKind.ExportDeclaration) { - var moduleNameExpr = getExternalModuleName(node); + let moduleNameExpr = getExternalModuleName(node); if (moduleNameExpr && moduleNameExpr.kind === SyntaxKind.StringLiteral) { - var moduleNameText = (moduleNameExpr).text; + let moduleNameText = (moduleNameExpr).text; if (moduleNameText) { - var searchPath = basePath; + let searchPath = basePath; while (true) { - var searchName = normalizePath(combinePaths(searchPath, moduleNameText)); + let searchName = normalizePath(combinePaths(searchPath, moduleNameText)); if (findModuleSourceFile(searchName + ".ts", moduleNameExpr) || findModuleSourceFile(searchName + ".d.ts", moduleNameExpr)) { break; } - var parentPath = getDirectoryPath(searchPath); + let parentPath = getDirectoryPath(searchPath); if (parentPath === searchPath) { break; } @@ -392,14 +396,14 @@ module ts { if (isExternalModuleImportEqualsDeclaration(node) && getExternalModuleImportEqualsDeclarationExpression(node).kind === SyntaxKind.StringLiteral) { - var nameLiteral = getExternalModuleImportEqualsDeclarationExpression(node); - var moduleName = nameLiteral.text; + let nameLiteral = getExternalModuleImportEqualsDeclarationExpression(node); + let moduleName = nameLiteral.text; if (moduleName) { // TypeScript 1.0 spec (April 2014): 12.1.6 // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules // only through top - level external module names. Relative external module names are not permitted. - var searchName = normalizePath(combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); + let searchName = normalizePath(combinePaths(basePath, moduleName)); + let tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { findModuleSourceFile(searchName + ".d.ts", nameLiteral); } @@ -426,10 +430,10 @@ module ts { return; } - var firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined); + let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined); if (firstExternalModuleSourceFile && !options.module) { // We cannot use createDiagnosticFromNode because nodes do not have parents yet - var span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); + let span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } @@ -440,15 +444,15 @@ module ts { (options.mapRoot && // there is --mapRoot Specified and there would be multiple js files generated (!options.out || firstExternalModuleSourceFile !== undefined))) { - var commonPathComponents: string[]; + let commonPathComponents: string[]; forEach(files, sourceFile => { // Each file contributes into common source file path if (!(sourceFile.flags & NodeFlags.DeclarationFile) && !fileExtensionIs(sourceFile.fileName, ".js")) { - var sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); + let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); sourcePathComponents.pop(); // FileName is not part of directory if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 835a5b838d0..fbcadab8c1d 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -959,7 +959,7 @@ module ts { if (pos >= len) { return token = SyntaxKind.EndOfFileToken; } - var ch = text.charCodeAt(pos); + let ch = text.charCodeAt(pos); switch (ch) { case CharacterCodes.lineFeed: case CharacterCodes.carriageReturn: @@ -1248,10 +1248,10 @@ module ts { case CharacterCodes.tilde: return pos++, token = SyntaxKind.TildeToken; case CharacterCodes.backslash: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { + let cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); return token = getIdentifierToken(); } error(Diagnostics.Invalid_character); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c97cc09d310..0cb8301be8a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -329,7 +329,7 @@ module ts { // If the parser encountered an error when parsing the code that created this node. Note // the parser only sets this directly on the node it creates right after encountering the - // error. + // error. ThisNodeHasError = 1 << 4, // Context flags set directly by the parser. @@ -337,7 +337,7 @@ module ts { // Context flags computed by aggregating child flags upwards. - // Used during incremental parsing to determine if this node or any of its children had an + // Used during incremental parsing to determine if this node or any of its children had an // error. Computed only once and then cached. ThisNodeOrAnySubNodesHasError = 1 << 5, @@ -354,7 +354,7 @@ module ts { export interface Node extends TextRange { kind: SyntaxKind; flags: NodeFlags; - // Specific context the parser was in when this node was created. Normally undefined. + // Specific context the parser was in when this node was created. Normally undefined. // Only set when the parser was in some interesting context (like async/yield). parserContextFlags?: ParserContextFlags; modifiers?: ModifiersArray; // Array of modifiers @@ -524,7 +524,7 @@ module ts { body?: Block; } - // See the comment on MethodDeclaration for the intuition behind AccessorDeclaration being a + // See the comment on MethodDeclaration for the intuition behind AccessorDeclaration being a // ClassElement and an ObjectLiteralElement. export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { _accessorDeclarationBrand: any; @@ -575,12 +575,12 @@ module ts { export interface StringLiteralTypeNode extends LiteralExpression, TypeNode { } - // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. + // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. // Consider 'Expression'. Without the brand, 'Expression' is actually no different // (structurally) than 'Node'. Because of this you can pass any Node to a function that // takes an Expression without any error. By using the 'brands' we ensure that the type - // checker actually thinks you have something of the right type. Note: the brands are - // never actually given values. At runtime they have zero cost. + // checker actually thinks you have something of the right type. Note: the brands are + // never actually given values. At runtime they have zero cost. export interface Expression extends Node { _expressionBrand: any; @@ -653,6 +653,10 @@ module ts { body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional } + export interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } + // The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral, // or any literal of a template, this means quotes have been removed and escapes have been converted to actual characters. // For a NumericLiteral, the stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1". @@ -735,7 +739,7 @@ module ts { } export interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; + declarationList: VariableDeclarationList; } export interface ExpressionStatement extends Statement { @@ -903,7 +907,7 @@ module ts { moduleSpecifier: Expression; } - // In case of: + // In case of: // import d from "mod" => name = d, namedBinding = undefined // import * as ns from "mod" => name = undefined, namedBinding: NamespaceImport = { name: ns } // import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns } @@ -940,7 +944,8 @@ module ts { export interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } export interface FileReference extends TextRange { @@ -969,7 +974,7 @@ module ts { externalModuleIndicator: Node; languageVersion: ScriptTarget; identifiers: Map; - + /* @internal */ nodeCount: number; /* @internal */ identifierCount: number; /* @internal */ symbolCount: number; @@ -977,10 +982,10 @@ module ts { // File level diagnostics reported by the parser (includes diagnostics about /// references // as well as code diagnostics). /* @internal */ parseDiagnostics: Diagnostic[]; - + // File level diagnostics reported by the binder. /* @internal */ bindDiagnostics: Diagnostic[]; - + // Stores a line map for the file. // This field should never be used directly to obtain line map, use getLineMap function instead. /* @internal */ lineMap: number[]; @@ -1000,10 +1005,10 @@ module ts { getSourceFiles(): SourceFile[]; /** - * Emits the javascript and declaration files. If targetSourceFile is not specified, then + * Emits the javascript and declaration files. If targetSourceFile is not specified, then * the javascript and declaration files will be produced for all the files in this program. * If targetSourceFile is specified, then only the javascript and declaration for that - * specific file will be generated. + * specific file will be generated. * * If writeFile is not specified then the writeFile callback from the compiler host will be * used for writing the javascript and declaration files. Otherwise, the writeFile parameter @@ -1021,7 +1026,7 @@ module ts { getCommonSourceDirectory(): string; - // For testing purposes only. Should not be used by any other consumers (including the + // For testing purposes only. Should not be used by any other consumers (including the // language service). /* @internal */ getDiagnosticsProducingTypeChecker(): TypeChecker; @@ -1058,7 +1063,7 @@ module ts { // when -version or -help was provided, or this was a normal compilation, no diagnostics // were produced, and all outputs were generated successfully. Success = 0, - + // Diagnostics were produced and because of them no code was generated. DiagnosticsPresent_OutputsSkipped = 1, @@ -1168,12 +1173,12 @@ module ts { // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here - // var a: C; + // var a: C; // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p - WriteTypeParametersOrArguments = 0x00000001, + WriteTypeParametersOrArguments = 0x00000001, // Use only external alias information to get the symbol name in the given context - // eg. module m { export class c { } } import x = m.c; + // eg. module m { export class c { } } import x = m.c; // When this flag is specified m.c will be used to refer to the class instead of alias symbol x UseOnlyExternalAliasing = 0x00000002, } @@ -1561,8 +1566,9 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; + /* @internal */ stripInternal?: boolean; + /* @internal */ preserveNewLines?: boolean; + /* @internal */ cacheDownlevelForOfLength?: boolean; [option: string]: string | number | boolean; } @@ -1780,7 +1786,7 @@ module ts { // Gets a count of how many times this collection has been modified. This value changes // each time 'add' is called (regardless of whether or not an equivalent diagnostic was // already in the collection). As such, it can be used as a simple way to tell if any - // operation caused diagnostics to be returned by storing and comparing the return value + // operation caused diagnostics to be returned by storing and comparing the return value // of this method before/after the operation is performed. getModificationCount(): number; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ea362eb2220..4fce9c928f7 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -14,7 +14,7 @@ module ts { } export function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration { - var declarations = symbol.declarations; + let declarations = symbol.declarations; for (let declaration of declarations) { if (declaration.kind === kind) { return declaration; @@ -39,12 +39,12 @@ module ts { } // Pool writers to avoid needing to allocate them for every symbol we write. - var stringWriters: StringSymbolWriter[] = []; + let stringWriters: StringSymbolWriter[] = []; export function getSingleLineStringWriter(): StringSymbolWriter { if (stringWriters.length == 0) { - var str = ""; + let str = ""; - var writeText: (text: string) => void = text => str += text; + let writeText: (text: string) => void = text => str += text; return { string: () => str, writeKeyword: writeText, @@ -88,7 +88,7 @@ module ts { // A node is considered to contain a parse error if: // a) the parser explicitly marked that it had an error // b) any of it's children reported that it had an error. - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & ParserContextFlags.ThisNodeHasError) !== 0) || + let thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & ParserContextFlags.ThisNodeHasError) !== 0) || forEachChild(node, containsParseError); // If so, mark ourselves accordingly. @@ -117,8 +117,8 @@ module ts { // This is a useful function for debugging purposes. export function nodePosToString(node: Node): string { - var file = getSourceFileOfNode(node); - var loc = getLineAndCharacterOfPosition(file, node.pos); + let file = getSourceFileOfNode(node); + let loc = getLineAndCharacterOfPosition(file, node.pos); return `${ file.fileName }(${ loc.line + 1 },${ loc.character + 1 })`; } @@ -132,7 +132,7 @@ module ts { // missing. This happens whenever the parser knows it needs to parse something, but can't // get anything in the source code that it expects at that location. For example: // - // var a: ; + // let a: ; // // Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source // code). So the parser will attempt to parse out a type, and will create an actual node. @@ -165,7 +165,7 @@ module ts { return ""; } - var text = sourceFile.text; + let text = sourceFile.text; return text.substring(skipTrivia(text, node.pos), node.end); } @@ -203,7 +203,7 @@ module ts { } export function getEnclosingBlockScopeContainer(node: Node): Node { - var current = node; + let current = node; while (current) { if (isFunctionLike(current)) { return current; @@ -244,14 +244,14 @@ module ts { } export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic { - var sourceFile = getSourceFileOfNode(node); - var span = getErrorSpanForNode(sourceFile, node); + let sourceFile = getSourceFileOfNode(node); + let span = getErrorSpanForNode(sourceFile, node); return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2); } export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic { - var sourceFile = getSourceFileOfNode(node); - var span = getErrorSpanForNode(sourceFile, node); + let sourceFile = getSourceFileOfNode(node); + let span = getErrorSpanForNode(sourceFile, node); return { file: sourceFile, start: span.start, @@ -264,15 +264,15 @@ module ts { /* @internal */ export function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan { - var scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text); + let scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text); scanner.setTextPos(pos); scanner.scan(); - var start = scanner.getTokenPos(); + let start = scanner.getTokenPos(); return createTextSpanFromBounds(start, scanner.getTextPos()); } export function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan { - var errorNode = node; + let errorNode = node; switch (node.kind) { // This list is a work in progress. Add missing node kinds to improve their error // spans. @@ -295,7 +295,7 @@ module ts { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + let pos = nodeIsMissing(errorNode) ? errorNode.pos : skipTrivia(sourceFile.text, errorNode.pos); @@ -332,7 +332,7 @@ module ts { export function getCombinedNodeFlags(node: Node): NodeFlags { node = walkUpBindingElementsAndPatterns(node); - var flags = node.flags; + let flags = node.flags; if (node.kind === SyntaxKind.VariableDeclaration) { node = node.parent; } @@ -389,7 +389,7 @@ module ts { } } - export var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/ + export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/ // Warning: This has the same semantics as the forEach family of functions, @@ -619,7 +619,7 @@ module ts { // fall through case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: - var parent = node.parent; + let parent = node.parent; switch (parent.kind) { case SyntaxKind.VariableDeclaration: case SyntaxKind.Parameter: @@ -641,13 +641,13 @@ module ts { case SyntaxKind.SwitchStatement: return (parent).expression === node; case SyntaxKind.ForStatement: - var forStatement = parent; + let forStatement = parent; return (forStatement.initializer === node && forStatement.initializer.kind !== SyntaxKind.VariableDeclarationList) || forStatement.condition === node || forStatement.iterator === node; case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: - var forInStatement = parent; + let forInStatement = parent; return (forInStatement.initializer === node && forInStatement.initializer.kind !== SyntaxKind.VariableDeclarationList) || forInStatement.expression === node; case SyntaxKind.TypeAssertionExpression: @@ -666,7 +666,7 @@ module ts { } export function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean) { - var moduleState = getModuleInstanceState(node) + let moduleState = getModuleInstanceState(node) return moduleState === ModuleInstanceState.Instantiated || (preserveConstEnums && moduleState === ModuleInstanceState.ConstEnumOnly); } @@ -689,7 +689,7 @@ module ts { return (node).moduleSpecifier; } if (node.kind === SyntaxKind.ImportEqualsDeclaration) { - var reference = (node).moduleReference; + let reference = (node).moduleReference; if (reference.kind === SyntaxKind.ExternalModuleReference) { return (reference).expression; } @@ -820,7 +820,7 @@ module ts { return false; } - var parent = name.parent; + let parent = name.parent; if (parent.kind === SyntaxKind.ImportSpecifier || parent.kind === SyntaxKind.ExportSpecifier) { if ((parent).propertyName) { return true; @@ -835,17 +835,17 @@ module ts { } export function getClassBaseTypeNode(node: ClassDeclaration) { - var heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); + let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } export function getClassImplementedTypeNodes(node: ClassDeclaration) { - var heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ImplementsKeyword); + let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ImplementsKeyword); return heritageClause ? heritageClause.types : undefined; } export function getInterfaceBaseTypeNodes(node: InterfaceDeclaration) { - var heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); + let heritageClause = getHeritageClause(node.heritageClauses, SyntaxKind.ExtendsKeyword); return heritageClause ? heritageClause.types : undefined; } @@ -863,7 +863,7 @@ module ts { export function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference) { if (!host.getCompilerOptions().noResolve) { - var referenceFileName = isRootedDiskPath(reference.fileName) ? reference.fileName : combinePaths(getDirectoryPath(sourceFile.fileName), reference.fileName); + let referenceFileName = isRootedDiskPath(reference.fileName) ? reference.fileName : combinePaths(getDirectoryPath(sourceFile.fileName), reference.fileName); referenceFileName = getNormalizedAbsolutePath(referenceFileName, host.getCurrentDirectory()); return host.getSourceFile(referenceFileName); } @@ -880,8 +880,8 @@ module ts { } export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { - var simpleReferenceRegEx = /^\/\/\/\s*/gim; + let simpleReferenceRegEx = /^\/\/\/\s*/gim; if (simpleReferenceRegEx.exec(comment)) { if (isNoDefaultLibRegEx.exec(comment)) { return { @@ -889,10 +889,10 @@ module ts { } } else { - var matchResult = fullTripleSlashReferencePathRegEx.exec(comment); + let matchResult = fullTripleSlashReferencePathRegEx.exec(comment); if (matchResult) { - var start = commentRange.pos; - var end = commentRange.end; + let start = commentRange.pos; + let end = commentRange.end; return { fileReference: { pos: start, @@ -949,9 +949,9 @@ module ts { return (name).text; } if (name.kind === SyntaxKind.ComputedPropertyName) { - var nameExpression = (name).expression; + let nameExpression = (name).expression; if (isWellKnownSymbolSyntactically(nameExpression)) { - var rightHandSideName = (nameExpression).name.text; + let rightHandSideName = (nameExpression).name.text; return getPropertyNameForKnownSymbolName(rightHandSideName); } } @@ -1003,14 +1003,14 @@ module ts { } export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + let overlapStart = Math.max(span.start, other.start); + let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); return overlapStart < overlapEnd; } export function textSpanOverlap(span1: TextSpan, span2: TextSpan) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + let overlapStart = Math.max(span1.start, span2.start); + let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); if (overlapStart < overlapEnd) { return createTextSpanFromBounds(overlapStart, overlapEnd); } @@ -1022,7 +1022,7 @@ module ts { } export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) { - var end = start + length; + let end = start + length; return start <= textSpanEnd(span) && end >= span.start; } @@ -1031,8 +1031,8 @@ module ts { } export function textSpanIntersection(span1: TextSpan, span2: TextSpan) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + let intersectStart = Math.max(span1.start, span2.start); + let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); if (intersectStart <= intersectEnd) { return createTextSpanFromBounds(intersectStart, intersectEnd); } @@ -1070,7 +1070,7 @@ module ts { return { span, newLength }; } - export var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); /** * Called to merge all the changes that occurred across several versions of a script snapshot @@ -1091,14 +1091,14 @@ module ts { // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } // as it makes things much easier to reason about. - var change0 = changes[0]; + let change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; + let oldStartN = change0.span.start; + let oldEndN = textSpanEnd(change0.span); + let newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; + for (let i = 1; i < changes.length; i++) { + let nextChange = changes[i]; // Consider the following case: // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting @@ -1180,13 +1180,13 @@ module ts { // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) // } - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; + let oldStart1 = oldStartN; + let oldEnd1 = oldEndN; + let newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; + let oldStart2 = nextChange.span.start; + let oldEnd2 = textSpanEnd(nextChange.span); + let newEnd2 = oldStart2 + nextChange.newLength; oldStartN = Math.min(oldStart1, oldStart2); oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); @@ -1205,7 +1205,7 @@ module ts { } export function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node { - var node = createNode(kind); + let node = createNode(kind); node.pos = -1; node.end = -1; node.startsOnNewLine = startsOnNewLine; @@ -1215,7 +1215,7 @@ module ts { export function generateUniqueName(baseName: string, isExistingName: (name: string) => boolean): string { // First try '_name' if (baseName.charCodeAt(0) !== CharacterCodes._) { - var baseName = "_" + baseName; + baseName = "_" + baseName; if (!isExistingName(baseName)) { return baseName; } @@ -1224,9 +1224,9 @@ module ts { if (baseName.charCodeAt(baseName.length - 1) !== CharacterCodes._) { baseName += "_"; } - var i = 1; + let i = 1; while (true) { - var name = baseName + i; + let name = baseName + i; if (!isExistingName(name)) { return name; } @@ -1236,11 +1236,11 @@ module ts { // @internal export function createDiagnosticCollection(): DiagnosticCollection { - var nonFileDiagnostics: Diagnostic[] = []; - var fileDiagnostics: Map = {}; + let nonFileDiagnostics: Diagnostic[] = []; + let fileDiagnostics: Map = {}; - var diagnosticsModified = false; - var modificationCount = 0; + let diagnosticsModified = false; + let modificationCount = 0; return { add, @@ -1254,7 +1254,7 @@ module ts { } function add(diagnostic: Diagnostic): void { - var diagnostics: Diagnostic[]; + let diagnostics: Diagnostic[]; if (diagnostic.file) { diagnostics = fileDiagnostics[diagnostic.file.fileName]; if (!diagnostics) { @@ -1282,14 +1282,14 @@ module ts { return fileDiagnostics[fileName] || []; } - var allDiagnostics: Diagnostic[] = []; + let allDiagnostics: Diagnostic[] = []; function pushDiagnostic(d: Diagnostic) { allDiagnostics.push(d); } forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { + for (let key in fileDiagnostics) { if (hasProperty(fileDiagnostics, key)) { forEach(fileDiagnostics[key], pushDiagnostic); } @@ -1306,7 +1306,7 @@ module ts { diagnosticsModified = false; nonFileDiagnostics = sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { + for (let key in fileDiagnostics) { if (hasProperty(fileDiagnostics, key)) { fileDiagnostics[key] = sortAndDeduplicateDiagnostics(fileDiagnostics[key]); } @@ -1319,8 +1319,8 @@ module ts { // the language service. These characters should be escaped when printing, and if any characters are added, // the map below must be updated. Note that this regexp *does not* include the 'delete' character. // There is no reason for this other than that JSON.stringify does not handle it either. - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap: Map = { + let escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + let escapedCharsMap: Map = { "\0": "\\0", "\t": "\\t", "\v": "\\v", @@ -1351,12 +1351,12 @@ module ts { } function get16BitUnicodeEscapeSequence(charCode: number): string { - var hexCharCode = charCode.toString(16).toUpperCase(); - var paddedHexCode = ("0000" + hexCharCode).slice(-4); + let hexCharCode = charCode.toString(16).toUpperCase(); + let paddedHexCode = ("0000" + hexCharCode).slice(-4); return "\\u" + paddedHexCode; } - var nonAsciiCharacters = /[^\u0000-\u007F]/g; + let nonAsciiCharacters = /[^\u0000-\u007F]/g; export function escapeNonAsciiCharacters(s: string): string { // Replace non-ASCII characters with '\uNNNN' escapes if any exist. // Otherwise just return the original string. diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index c56ea72cd66..395141cc4cc 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -173,6 +173,10 @@ module ts.BreakpointResolver { return textSpan(node, (node).expression); case SyntaxKind.ExportAssignment: + if (!(node).expression) { + return undefined; + } + // span on export = id return textSpan(node, (node).expression); diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index b20d8fea22d..24ddabc2b2b 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -23,7 +23,7 @@ module ts.formatting { * Indentation for the scope that can be dynamically recomputed. * i.e * while(true) - * { var x; + * { let x; * } * Normally indentation is applied only to the first token in line so at glance 'var' should not be touched. * However if some format rule adds new line between '}' and 'var' 'var' will become @@ -67,12 +67,12 @@ module ts.formatting { } export function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { - var line = sourceFile.getLineAndCharacterOfPosition(position).line; + let line = sourceFile.getLineAndCharacterOfPosition(position).line; if (line === 0) { return []; } // get the span for the previous\current line - var span = { + let span = { // get start position for the previous line pos: getStartPositionOfLine(line - 1, sourceFile), // get end position for the current line (end value is exclusive so add 1 to the result) @@ -90,7 +90,7 @@ module ts.formatting { } export function formatDocument(sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { - var span = { + let span = { pos: 0, end: sourceFile.text.length }; @@ -99,7 +99,7 @@ module ts.formatting { export function formatSelection(start: number, end: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] { // format from the beginning of the line - var span = { + let span = { pos: getLineStartPositionForPosition(start, sourceFile), end: end }; @@ -107,11 +107,11 @@ module ts.formatting { } function formatOutermostParent(position: number, expectedLastToken: SyntaxKind, sourceFile: SourceFile, options: FormatCodeOptions, rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { - var parent = findOutermostParent(position, expectedLastToken, sourceFile); + let parent = findOutermostParent(position, expectedLastToken, sourceFile); if (!parent) { return []; } - var span = { + let span = { pos: getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), end: parent.end }; @@ -119,7 +119,7 @@ module ts.formatting { } function findOutermostParent(position: number, expectedTokenKind: SyntaxKind, sourceFile: SourceFile): Node { - var precedingToken = findPrecedingToken(position, sourceFile); + let precedingToken = findPrecedingToken(position, sourceFile); // when it is claimed that trigger character was typed at given position // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed). @@ -134,13 +134,13 @@ module ts.formatting { // walk up and search for the parent node that ends at the same position with precedingToken. // for cases like this // - // var x = 1; + // let x = 1; // while (true) { // } // after typing close curly in while statement we want to reformat just the while statement. // However if we just walk upwards searching for the parent that has the same end value - // we'll end up with the whole source file. isListElement allows to stop on the list element level - var current = precedingToken; + let current = precedingToken; while (current && current.parent && current.parent.end === precedingToken.end && @@ -159,7 +159,7 @@ module ts.formatting { case SyntaxKind.InterfaceDeclaration: return rangeContainsRange((parent).members, node); case SyntaxKind.ModuleDeclaration: - var body = (parent).body; + let body = (parent).body; return body && body.kind === SyntaxKind.Block && rangeContainsRange((body).statements, node); case SyntaxKind.SourceFile: case SyntaxKind.Block: @@ -177,9 +177,9 @@ module ts.formatting { return find(sourceFile); function find(n: Node): Node { - var candidate = forEachChild(n, c => startEndContainsRange(c.getStart(sourceFile), c.end, range) && c); + let candidate = forEachChild(n, c => startEndContainsRange(c.getStart(sourceFile), c.end, range) && c); if (candidate) { - var result = find(candidate); + let result = find(candidate); if (result) { return result; } @@ -199,7 +199,7 @@ module ts.formatting { } // pick only errors that fall in range - var sorted = errors + let sorted = errors .filter(d => rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length)) .sort((e1, e2) => e1.start - e2.start); @@ -207,7 +207,7 @@ module ts.formatting { return rangeHasNoErrors; } - var index = 0; + let index = 0; return r => { // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. @@ -218,7 +218,7 @@ module ts.formatting { return false; } - var error = sorted[index]; + let error = sorted[index]; if (r.end <= error.start) { // specified range ends before the error refered by 'index' - no error in range return false; @@ -244,12 +244,12 @@ module ts.formatting { * and return its end as start position for the scanner. */ function getScanStartPosition(enclosingNode: Node, originalRange: TextRange, sourceFile: SourceFile): number { - var start = enclosingNode.getStart(sourceFile); + let start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { return start; } - var precedingToken = findPrecedingToken(originalRange.pos, sourceFile); + let precedingToken = findPrecedingToken(originalRange.pos, sourceFile); if (!precedingToken) { // no preceding token found - start from the beginning of enclosing node return enclosingNode.pos; @@ -280,10 +280,10 @@ module ts.formatting { * to the initial indentation. */ function getOwnOrInheritedDelta(n: Node, options: FormatCodeOptions, sourceFile: SourceFile): number { - var previousLine = Constants.Unknown; - var childKind = SyntaxKind.Unknown; + let previousLine = Constants.Unknown; + let childKind = SyntaxKind.Unknown; while (n) { - var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; + let line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; if (previousLine !== Constants.Unknown && line !== previousLine) { break; } @@ -305,30 +305,30 @@ module ts.formatting { rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); + let rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); // formatting context is used by rules provider - var formattingContext = new FormattingContext(sourceFile, requestKind); + let formattingContext = new FormattingContext(sourceFile, requestKind); // find the smallest node that fully wraps the range and compute the initial indentation for the node - var enclosingNode = findEnclosingNode(originalRange, sourceFile); + let enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); + let formattingScanner = getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + let initialIndentation = SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); - var previousRangeHasError: boolean; - var previousRange: TextRangeWithKind; - var previousParent: Node; - var previousRangeStartLine: number; + let previousRangeHasError: boolean; + let previousRange: TextRangeWithKind; + let previousParent: Node; + let previousRangeStartLine: number; - var edits: TextChange[] = []; + let edits: TextChange[] = []; formattingScanner.advance(); if (formattingScanner.isOnToken()) { - var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); + let startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + let delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); } @@ -357,9 +357,9 @@ module ts.formatting { } } else { - var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; - var startLinePosition = getLineStartPositionForPosition(startPos, sourceFile); - var column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + let startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + let startLinePosition = getLineStartPositionForPosition(startPos, sourceFile); + let column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); if (startLine !== parentStartLine || startPos === column) { return column } @@ -376,7 +376,7 @@ module ts.formatting { parentDynamicIndentation: DynamicIndentation, effectiveParentStartLine: number): Indentation { - var indentation = inheritedIndentation; + let indentation = inheritedIndentation; if (indentation === Constants.Unknown) { if (isSomeBlock(node.kind)) { // blocks should be indented in @@ -475,7 +475,7 @@ module ts.formatting { return; } - var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + let nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); // a useful observations when tracking context node // / @@ -489,7 +489,7 @@ module ts.formatting { // context node is set to parent node value after processing every child node // context node is set to parent of the token after processing every token - var childContextNode = contextNode; + let childContextNode = contextNode; // if there are any tokens that logically belong to node and interleave child nodes // such tokens will be consumed in processChildNode for for the child that follows them @@ -504,7 +504,7 @@ module ts.formatting { // proceed any tokens in the node that are located after child nodes while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(node); + let tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > node.end) { break; } @@ -519,12 +519,12 @@ module ts.formatting { parentStartLine: number, isListItem: boolean): number { - var childStartPos = child.getStart(sourceFile); + let childStartPos = child.getStart(sourceFile); - var childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); + let childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); // if child is a list item - try to get its indentation - var childIndentationAmount = Constants.Unknown; + let childIndentationAmount = Constants.Unknown; if (isListItem) { childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); if (childIndentationAmount !== Constants.Unknown) { @@ -543,7 +543,7 @@ module ts.formatting { while (formattingScanner.isOnToken()) { // proceed any parent tokens that are located prior to child.getStart() - var tokenInfo = formattingScanner.readTokenInfo(node); + let tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > childStartPos) { // stop when formatting scanner advances past the beginning of the child break; @@ -558,13 +558,13 @@ module ts.formatting { if (isToken(child)) { // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules - var tokenInfo = formattingScanner.readTokenInfo(child); + let tokenInfo = formattingScanner.readTokenInfo(child); Debug.assert(tokenInfo.token.end === child.end); consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } - var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + let childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); @@ -578,16 +578,16 @@ module ts.formatting { parentStartLine: number, parentDynamicIndentation: DynamicIndentation): void { - var listStartToken = getOpenTokenForList(parent, nodes); - var listEndToken = getCloseTokenForOpenToken(listStartToken); + let listStartToken = getOpenTokenForList(parent, nodes); + let listEndToken = getCloseTokenForOpenToken(listStartToken); - var listDynamicIndentation = parentDynamicIndentation; - var startLine = parentStartLine; + let listDynamicIndentation = parentDynamicIndentation; + let startLine = parentStartLine; if (listStartToken !== SyntaxKind.Unknown) { // introduce a new indentation scope for lists (including list start and end tokens) while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); + let tokenInfo = formattingScanner.readTokenInfo(parent); if (tokenInfo.token.end > nodes.pos) { // stop when formatting scanner moves past the beginning of node list break; @@ -595,7 +595,7 @@ module ts.formatting { else if (tokenInfo.token.kind === listStartToken) { // consume list start token startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation = + let indentation = computeIndentation(tokenInfo.token, startLine, Constants.Unknown, parent, parentDynamicIndentation, startLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); @@ -608,14 +608,14 @@ module ts.formatting { } } - var inheritedIndentation = Constants.Unknown; + let inheritedIndentation = Constants.Unknown; for (let child of nodes) { inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, /*isListElement*/ true) } if (listEndToken !== SyntaxKind.Unknown) { if (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); + let tokenInfo = formattingScanner.readTokenInfo(parent); // consume the list end token only if it is still belong to the parent // there might be the case when current token matches end token but does not considered as one // function (x: function) <-- @@ -631,21 +631,21 @@ module ts.formatting { function consumeTokenAndAdvanceScanner(currentTokenInfo: TokenInfo, parent: Node, dynamicIndentation: DynamicIndentation): void { Debug.assert(rangeContainsRange(parent, currentTokenInfo.token)); - var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); - var indentToken = false; + let lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + let indentToken = false; if (currentTokenInfo.leadingTrivia) { processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); } - var lineAdded: boolean; - var isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); + let lineAdded: boolean; + let isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); - var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); + let tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { - var rangeHasError = rangeContainsError(currentTokenInfo.token); + let rangeHasError = rangeContainsError(currentTokenInfo.token); // save prevStartLine since processRange will overwrite this value with current ones - var prevStartLine = previousRangeStartLine; + let prevStartLine = previousRangeStartLine; lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); if (rangeHasError) { // do not indent comments\token if token range overlaps with some error @@ -666,23 +666,23 @@ module ts.formatting { } if (indentToken) { - var indentNextTokenOrTrivia = true; + let indentNextTokenOrTrivia = true; if (currentTokenInfo.leadingTrivia) { for (let triviaItem of currentTokenInfo.leadingTrivia) { if (!rangeContainsRange(originalRange, triviaItem)) { continue; } - var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; + let triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { case SyntaxKind.MultiLineCommentTrivia: - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + let commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); indentMultilineComment(triviaItem, commentIndentation, /*firstLineIsIndented*/ !indentNextTokenOrTrivia); indentNextTokenOrTrivia = false; break; case SyntaxKind.SingleLineCommentTrivia: if (indentNextTokenOrTrivia) { - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + let commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); insertIndentation(triviaItem.pos, commentIndentation, /*lineAdded*/ false); indentNextTokenOrTrivia = false; } @@ -696,7 +696,7 @@ module ts.formatting { // indent token only if is it is in target range and does not overlap with any error ranges if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { - var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); + let tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); } } @@ -710,7 +710,7 @@ module ts.formatting { function processTrivia(trivia: TextRangeWithKind[], parent: Node, contextNode: Node, dynamicIndentation: DynamicIndentation): void { for (let triviaItem of trivia) { if (isComment(triviaItem.kind) && rangeContainsRange(originalRange, triviaItem)) { - var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); + let triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); } } @@ -722,12 +722,12 @@ module ts.formatting { contextNode: Node, dynamicIndentation: DynamicIndentation): boolean { - var rangeHasError = rangeContainsError(range); - var lineAdded: boolean; + let rangeHasError = rangeContainsError(range); + let lineAdded: boolean; if (!rangeHasError && !previousRangeHasError) { if (!previousRange) { // trim whitespaces starting from the beginning of the span up to the current line - var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); + let originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } else { @@ -755,10 +755,10 @@ module ts.formatting { formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); - var rule = rulesProvider.getRulesMap().GetRule(formattingContext); + let rule = rulesProvider.getRulesMap().GetRule(formattingContext); - var trimTrailingWhitespaces: boolean; - var lineAdded: boolean; + let trimTrailingWhitespaces: boolean; + let lineAdded: boolean; if (rule) { applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); @@ -798,16 +798,16 @@ module ts.formatting { } function insertIndentation(pos: number, indentation: number, lineAdded: boolean): void { - var indentationString = getIndentationString(indentation, options); + let indentationString = getIndentationString(indentation, options); if (lineAdded) { // new line is added before the token by the formatting rules // insert indentation string at the very beginning of the token recordReplace(pos, 0, indentationString); } else { - var tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); + let tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); if (indentation !== tokenStart.character) { - var startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); + let startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); recordReplace(startLinePosition, tokenStart.character, indentationString); } } @@ -815,9 +815,9 @@ module ts.formatting { function indentMultilineComment(commentRange: TextRange, indentation: number, firstLineIsIndented: boolean) { // split comment in lines - var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; - var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - + let startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + let endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; + let parts: TextRange[]; if (startLine === endLine) { if (!firstLineIsIndented) { // treat as single line comment @@ -826,10 +826,10 @@ module ts.formatting { return; } else { - var parts: TextRange[] = []; - var startPos = commentRange.pos; - for (var line = startLine; line < endLine; ++line) { - var endOfLine = getEndLinePosition(line, sourceFile); + parts = []; + let startPos = commentRange.pos; + for (let line = startLine; line < endLine; ++line) { + let endOfLine = getEndLinePosition(line, sourceFile); parts.push({ pos: startPos, end: endOfLine }); startPos = getStartPositionOfLine(line + 1, sourceFile); } @@ -837,33 +837,33 @@ module ts.formatting { parts.push({ pos: startPos, end: commentRange.end }); } - var startLinePos = getStartPositionOfLine(startLine, sourceFile); + let startLinePos = getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceColumnInFirstPart = + let nonWhitespaceColumnInFirstPart = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); if (indentation === nonWhitespaceColumnInFirstPart.column) { return; } - var startIndex = 0; + let startIndex = 0; if (firstLineIsIndented) { startIndex = 1; startLine++; } // shift all parts on the delta size - var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { - var startLinePos = getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceCharacterAndColumn = + let delta = indentation - nonWhitespaceColumnInFirstPart.column; + for (let i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + let startLinePos = getStartPositionOfLine(startLine, sourceFile); + let nonWhitespaceCharacterAndColumn = i === 0 ? nonWhitespaceColumnInFirstPart : SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; + let newIndentation = nonWhitespaceCharacterAndColumn.column + delta; if (newIndentation > 0) { - var indentationString = getIndentationString(newIndentation, options); + let indentationString = getIndentationString(newIndentation, options); recordReplace(startLinePos, nonWhitespaceCharacterAndColumn.character, indentationString); } else { @@ -873,16 +873,16 @@ module ts.formatting { } function trimTrailingWhitespacesForLines(line1: number, line2: number, range?: TextRangeWithKind) { - for (var line = line1; line < line2; ++line) { - var lineStartPosition = getStartPositionOfLine(line, sourceFile); - var lineEndPosition = getEndLinePosition(line, sourceFile); + for (let line = line1; line < line2; ++line) { + let lineStartPosition = getStartPositionOfLine(line, sourceFile); + let lineEndPosition = getEndLinePosition(line, sourceFile); // do not trim whitespaces in comments if (range && isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } - var pos = lineEndPosition; + let pos = lineEndPosition; while (pos >= lineStartPosition && isWhiteSpace(sourceFile.text.charCodeAt(pos))) { pos--; } @@ -915,7 +915,7 @@ module ts.formatting { currentRange: TextRangeWithKind, currentStartLine: number): void { - var between: TextRange; + let between: TextRange; switch (rule.Operation.Action) { case RuleAction.Ignore: // no action required @@ -935,7 +935,7 @@ module ts.formatting { } // edit should not be applied only if we have one line feed between elements - var lineDelta = currentStartLine - previousStartLine; + let lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); } @@ -946,7 +946,7 @@ module ts.formatting { return; } - var posDelta = currentRange.pos - previousRange.end; + let posDelta = currentRange.pos - previousRange.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== CharacterCodes.space) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); } @@ -1008,15 +1008,15 @@ module ts.formatting { return SyntaxKind.Unknown; } - var internedTabsIndentation: string[]; - var internedSpacesIndentation: string[]; + let internedTabsIndentation: string[]; + let internedSpacesIndentation: string[]; export function getIndentationString(indentation: number, options: FormatCodeOptions): string { if (!options.ConvertTabsToSpaces) { - var tabs = Math.floor(indentation / options.TabSize); - var spaces = indentation - tabs * options.TabSize; + let tabs = Math.floor(indentation / options.TabSize); + let spaces = indentation - tabs * options.TabSize; - var tabString: string; + let tabString: string; if (!internedTabsIndentation) { internedTabsIndentation = []; } @@ -1031,9 +1031,9 @@ module ts.formatting { return spaces ? tabString + repeat(" ", spaces) : tabString; } else { - var spacesString: string; - var quotient = Math.floor(indentation / options.IndentSize); - var remainder = indentation % options.IndentSize; + let spacesString: string; + let quotient = Math.floor(indentation / options.IndentSize); + let remainder = indentation % options.IndentSize; if (!internedSpacesIndentation) { internedSpacesIndentation = []; } @@ -1046,13 +1046,12 @@ module ts.formatting { spacesString = internedSpacesIndentation[quotient]; } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; } function repeat(value: string, count: number): string { - var s = ""; - for (var i = 0; i < count; ++i) { + let s = ""; + for (let i = 0; i < count; ++i) { s += value; } diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 52de4105df6..8683a975777 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -71,8 +71,8 @@ module ts.formatting { public TokensAreOnSameLine(): boolean { if (this.tokensAreOnSameLine === undefined) { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; + let startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; + let endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; this.tokensAreOnSameLine = (startLine == endLine); } @@ -96,17 +96,17 @@ module ts.formatting { } private NodeIsOnOneLine(node: Node): boolean { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; + let startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; + let endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; return startLine == endLine; } private BlockIsOnOneLine(node: Node): boolean { - var openBrace = findChildOfKind(node, SyntaxKind.OpenBraceToken, this.sourceFile); - var closeBrace = findChildOfKind(node, SyntaxKind.CloseBraceToken, this.sourceFile); + let openBrace = findChildOfKind(node, SyntaxKind.OpenBraceToken, this.sourceFile); + let closeBrace = findChildOfKind(node, SyntaxKind.CloseBraceToken, this.sourceFile); if (openBrace && closeBrace) { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; + let startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; + let endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; return startLine === endLine; } return false; diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index 962f142f609..f93739d6fb5 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -2,7 +2,7 @@ /// module ts.formatting { - var scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); + let scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); export interface FormattingScanner { advance(): void; @@ -24,13 +24,13 @@ module ts.formatting { scanner.setText(sourceFile.text); scanner.setTextPos(startPos); - var wasNewLine: boolean = true; - var leadingTrivia: TextRangeWithKind[]; - var trailingTrivia: TextRangeWithKind[]; + let wasNewLine: boolean = true; + let leadingTrivia: TextRangeWithKind[]; + let trailingTrivia: TextRangeWithKind[]; - var savedPos: number; - var lastScanAction: ScanAction; - var lastTokenInfo: TokenInfo; + let savedPos: number; + let lastScanAction: ScanAction; + let lastTokenInfo: TokenInfo; return { advance: advance, @@ -45,7 +45,7 @@ module ts.formatting { function advance(): void { lastTokenInfo = undefined; - var isStarted = scanner.getStartPos() !== startPos; + let isStarted = scanner.getStartPos() !== startPos; if (isStarted) { if (trailingTrivia) { @@ -64,19 +64,19 @@ module ts.formatting { scanner.scan(); } - var t: SyntaxKind; - var pos = scanner.getStartPos(); + let t: SyntaxKind; + let pos = scanner.getStartPos(); // Read leading trivia and token while (pos < endPos) { - var t = scanner.getToken(); + let t = scanner.getToken(); if (!isTrivia(t)) { break; } // consume leading trivia scanner.scan(); - var item = { + let item = { pos: pos, end: scanner.getStartPos(), kind: t @@ -133,7 +133,7 @@ module ts.formatting { // normally scanner returns the smallest available token // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. - var expectedScanAction = + let expectedScanAction = shouldRescanGreaterThanToken(n) ? ScanAction.RescanGreaterThanToken : shouldRescanSlashToken(n) @@ -159,7 +159,7 @@ module ts.formatting { scanner.scan(); } - var currentToken = scanner.getToken(); + let currentToken = scanner.getToken(); if (expectedScanAction === ScanAction.RescanGreaterThanToken && currentToken === SyntaxKind.GreaterThanToken) { currentToken = scanner.reScanGreaterToken(); @@ -179,7 +179,7 @@ module ts.formatting { lastScanAction = ScanAction.Scan; } - var token: TextRangeWithKind = { + let token: TextRangeWithKind = { pos: scanner.getStartPos(), end: scanner.getTextPos(), kind: currentToken @@ -194,7 +194,7 @@ module ts.formatting { if (!isTrivia(currentToken)) { break; } - var trivia = { + let trivia = { pos: scanner.getStartPos(), end: scanner.getTextPos(), kind: currentToken @@ -223,8 +223,8 @@ module ts.formatting { } function isOnToken(): boolean { - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + let current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); + let startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); return startPos < endPos && current !== SyntaxKind.EndOfFileToken && !isTrivia(current); } diff --git a/src/services/formatting/ruleDescriptor.ts b/src/services/formatting/ruleDescriptor.ts index e5b7d6f3186..031f88be00e 100644 --- a/src/services/formatting/ruleDescriptor.ts +++ b/src/services/formatting/ruleDescriptor.ts @@ -33,8 +33,7 @@ module ts.formatting { return RuleDescriptor.create4(left, Shared.TokenRange.FromToken(right)); } - static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor - { + static create3(left: SyntaxKind, right: Shared.TokenRange): RuleDescriptor { return RuleDescriptor.create4(Shared.TokenRange.FromToken(left), right); } diff --git a/src/services/formatting/ruleOperation.ts b/src/services/formatting/ruleOperation.ts index c73e3b6bcf7..7bd092e9584 100644 --- a/src/services/formatting/ruleOperation.ts +++ b/src/services/formatting/ruleOperation.ts @@ -35,7 +35,7 @@ module ts.formatting { } static create2(context: RuleOperationContext, action: RuleAction) { - var result = new RuleOperation(); + let result = new RuleOperation(); result.Context = context; result.Action = action; return result; diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 7eb5232af18..7d3509ef495 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -18,8 +18,8 @@ module ts.formatting { export class Rules { public getRuleName(rule: Rule) { - var o: ts.Map = this; - for (var name in o) { + let o: ts.Map = this; + for (let name in o) { if (o[name] === rule) { return name; } @@ -139,7 +139,7 @@ module ts.formatting { // Lambda expressions public SpaceAfterArrow: Rule; - // Optional parameters and var args + // Optional parameters and let args public NoSpaceAfterEllipsis: Rule; public NoSpaceAfterOptionalParameters: Rule; @@ -330,7 +330,7 @@ module ts.formatting { // Lambda expressions this.SpaceAfterArrow = new Rule(RuleDescriptor.create3(SyntaxKind.EqualsGreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); - // Optional parameters and var args + // Optional parameters and let args this.NoSpaceAfterEllipsis = new Rule(RuleDescriptor.create1(SyntaxKind.DotDotDotToken, SyntaxKind.Identifier), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); this.NoSpaceAfterOptionalParameters = new Rule(RuleDescriptor.create3(SyntaxKind.QuestionToken, Shared.TokenRange.FromTokens([SyntaxKind.CloseParenToken, SyntaxKind.CommaToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), RuleAction.Delete)); @@ -462,7 +462,7 @@ module ts.formatting { // equal in import a = module('a'); case SyntaxKind.ImportEqualsDeclaration: - // equal in var a = 0; + // equal in let a = 0; case SyntaxKind.VariableDeclaration: // equal in p = 0; case SyntaxKind.Parameter: @@ -470,7 +470,7 @@ module ts.formatting { case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: return context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken; - // "in" keyword in for (var x in []) { } + // "in" keyword in for (let x in []) { } case SyntaxKind.ForInStatement: return context.currentTokenSpan.kind === SyntaxKind.InKeyword || context.nextTokenSpan.kind === SyntaxKind.InKeyword; // Technically, "of" is not a binary operator, but format it the same way as "in" diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index 634ec61de9c..b43e91424f8 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -26,7 +26,7 @@ module ts.formatting { } static create(rules: Rule[]): RulesMap { - var result = new RulesMap(); + let result = new RulesMap(); result.Initialize(rules); return result; } @@ -36,7 +36,7 @@ module ts.formatting { this.map = new Array(this.mapRowLength * this.mapRowLength);//new Array(this.mapRowLength * this.mapRowLength); // This array is used only during construction of the rulesbucket in the map - var rulesBucketConstructionStateList: RulesBucketConstructionState[] = new Array(this.map.length);//new Array(this.map.length); + let rulesBucketConstructionStateList: RulesBucketConstructionState[] = new Array(this.map.length);//new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); return this.map; @@ -49,20 +49,20 @@ module ts.formatting { } private GetRuleBucketIndex(row: number, column: number): number { - var rulesBucketIndex = (row * this.mapRowLength) + column; + let rulesBucketIndex = (row * this.mapRowLength) + column; //Debug.Assert(rulesBucketIndex < this.map.Length, "Trying to access an index outside the array."); return rulesBucketIndex; } private FillRule(rule: Rule, rulesBucketConstructionStateList: RulesBucketConstructionState[]): void { - var specificRule = rule.Descriptor.LeftTokenRange != Shared.TokenRange.Any && + let specificRule = rule.Descriptor.LeftTokenRange != Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != Shared.TokenRange.Any; rule.Descriptor.LeftTokenRange.GetTokens().forEach((left) => { rule.Descriptor.RightTokenRange.GetTokens().forEach((right) => { - var rulesBucketIndex = this.GetRuleBucketIndex(left, right); + let rulesBucketIndex = this.GetRuleBucketIndex(left, right); - var rulesBucket = this.map[rulesBucketIndex]; + let rulesBucket = this.map[rulesBucketIndex]; if (rulesBucket == undefined) { rulesBucket = this.map[rulesBucketIndex] = new RulesBucket(); } @@ -73,8 +73,8 @@ module ts.formatting { } public GetRule(context: FormattingContext): Rule { - var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); - var bucket = this.map[bucketIndex]; + let bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); + let bucket = this.map[bucketIndex]; if (bucket != null) { for (let rule of bucket.Rules()) { if (rule.Operation.Context.InContext(context)) { @@ -86,8 +86,8 @@ module ts.formatting { } } - var MaskBitSize = 5; - var Mask = 0x1f; + let MaskBitSize = 5; + let Mask = 0x1f; export enum RulesPosition { IgnoreRulesSpecific = 0, @@ -121,10 +121,10 @@ module ts.formatting { } public GetInsertionIndex(maskPosition: RulesPosition): number { - var index = 0; + let index = 0; - var pos = 0; - var indexBitmap = this.rulesInsertionIndexBitmap; + let pos = 0; + let indexBitmap = this.rulesInsertionIndexBitmap; while (pos <= maskPosition) { index += (indexBitmap & Mask); @@ -136,11 +136,11 @@ module ts.formatting { } public IncreaseInsertionIndex(maskPosition: RulesPosition): void { - var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; + let value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; value++; Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); + let temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); temp |= value << maskPosition; this.rulesInsertionIndexBitmap = temp; @@ -159,7 +159,7 @@ module ts.formatting { } public AddRule(rule: Rule, specificTokens: boolean, constructionState: RulesBucketConstructionState[], rulesBucketIndex: number): void { - var position: RulesPosition; + let position: RulesPosition; if (rule.Operation.Action == RuleAction.Ignore) { position = specificTokens ? @@ -177,11 +177,11 @@ module ts.formatting { RulesPosition.NoContextRulesAny; } - var state = constructionState[rulesBucketIndex]; + let state = constructionState[rulesBucketIndex]; if (state === undefined) { state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); } - var index = state.GetInsertionIndex(position); + let index = state.GetInsertionIndex(position); this.rules.splice(index, 0, rule); state.IncreaseInsertionIndex(position); } diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 25b6f1ba772..5f63db8630b 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -40,8 +40,8 @@ module ts.formatting { public ensureUpToDate(options: ts.FormatCodeOptions) { if (this.options == null || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = RulesMap.create(activeRules); + let activeRules = this.createActiveRules(options); + let rulesMap = RulesMap.create(activeRules); this.activeRules = activeRules; this.rulesMap = rulesMap; @@ -50,7 +50,7 @@ module ts.formatting { } private createActiveRules(options: ts.FormatCodeOptions): Rule[] { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); + let rules = this.globalRules.HighPriorityCommonRules.slice(0); if (options.InsertSpaceAfterCommaDelimiter) { rules.push(this.globalRules.SpaceAfterComma); diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index f1d0935c132..e7beebf6866 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -12,13 +12,13 @@ module ts.formatting { return 0; // past EOF } - var precedingToken = findPrecedingToken(position, sourceFile); + let precedingToken = findPrecedingToken(position, sourceFile); if (!precedingToken) { return 0; } // no indentation in string \regex\template literals - var precedingTokenIsLiteral = + let precedingTokenIsLiteral = precedingToken.kind === SyntaxKind.StringLiteral || precedingToken.kind === SyntaxKind.RegularExpressionLiteral || precedingToken.kind === SyntaxKind.NoSubstitutionTemplateLiteral || @@ -29,11 +29,11 @@ module ts.formatting { return 0; } - var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + let lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; if (precedingToken.kind === SyntaxKind.CommaToken && precedingToken.parent.kind !== SyntaxKind.BinaryExpression) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it - var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); + let actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== Value.Unknown) { return actualIndentation; } @@ -41,10 +41,10 @@ module ts.formatting { // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken' // if such node is found - compute initial indentation for 'position' inside this node - var previous: Node; - var current = precedingToken; - var currentStart: LineAndCharacter; - var indentationDelta: number; + let previous: Node; + let current = precedingToken; + let currentStart: LineAndCharacter; + let indentationDelta: number; while (current) { if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : SyntaxKind.Unknown)) { @@ -61,7 +61,7 @@ module ts.formatting { } // check if current node is a list item - if yes, take indentation from it - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + let actualIndentation = getActualIndentationForListItem(current, sourceFile, options); if (actualIndentation !== Value.Unknown) { return actualIndentation; } @@ -79,7 +79,7 @@ module ts.formatting { } export function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: FormatCodeOptions): number { - var start = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); + let start = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, /*indentationDelta*/ 0, sourceFile, options); } @@ -91,33 +91,33 @@ module ts.formatting { sourceFile: SourceFile, options: EditorOptions): number { - var parent: Node = current.parent; - var parentStart: LineAndCharacter; + let parent: Node = current.parent; + let parentStart: LineAndCharacter; // walk upwards and collect indentations for pairs of parent-child nodes // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' while (parent) { - var useActualIndentation = true; + let useActualIndentation = true; if (ignoreActualIndentationRange) { - var start = current.getStart(sourceFile); + let start = current.getStart(sourceFile); useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; } if (useActualIndentation) { // check if current node is a list item - if yes, take indentation from it - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + let actualIndentation = getActualIndentationForListItem(current, sourceFile, options); if (actualIndentation !== Value.Unknown) { return actualIndentation + indentationDelta; } } parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = + let parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { // try to fetch actual indentation for current node from source text - var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + let actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); if (actualIndentation !== Value.Unknown) { return actualIndentation + indentationDelta; } @@ -138,7 +138,7 @@ module ts.formatting { function getParentStart(parent: Node, child: Node, sourceFile: SourceFile): LineAndCharacter { - var containingList = getContainingList(child, sourceFile); + let containingList = getContainingList(child, sourceFile); if (containingList) { return sourceFile.getLineAndCharacterOfPosition(containingList.pos); } @@ -151,7 +151,7 @@ module ts.formatting { */ function getActualIndentationForListItemBeforeComma(commaToken: Node, sourceFile: SourceFile, options: EditorOptions): number { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it - var commaItemInfo = findListItemInfo(commaToken); + let commaItemInfo = findListItemInfo(commaToken); if (commaItemInfo && commaItemInfo.listItemIndex > 0) { return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } @@ -174,7 +174,7 @@ module ts.formatting { // actual indentation is used for statements\declarations if one of cases below is true: // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line - var useActualIndentation = + let useActualIndentation = (isDeclaration(current) || isStatement(current)) && (parent.kind === SyntaxKind.SourceFile || !parentAndChildShareLine); @@ -186,7 +186,7 @@ module ts.formatting { } function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken: Node, current: Node, lineAtPosition: number, sourceFile: SourceFile): boolean { - var nextToken = findNextToken(precedingToken, current); + let nextToken = findNextToken(precedingToken, current); if (!nextToken) { return false; } @@ -205,7 +205,7 @@ module ts.formatting { // class A { // $} - var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; + let nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; return lineAtPosition === nextTokenStartLine; } @@ -222,10 +222,10 @@ module ts.formatting { export function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean { if (parent.kind === SyntaxKind.IfStatement && (parent).elseStatement === child) { - var elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile); + let elseKeyword = findChildOfKind(parent, SyntaxKind.ElseKeyword, sourceFile); Debug.assert(elseKeyword !== undefined); - var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + let elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; } @@ -251,8 +251,8 @@ module ts.formatting { case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - var start = node.getStart(sourceFile); + case SyntaxKind.ConstructSignature: { + let start = node.getStart(sourceFile); if ((node.parent).typeParameters && rangeContainsStartEnd((node.parent).typeParameters, start, node.getEnd())) { return (node.parent).typeParameters; @@ -261,9 +261,10 @@ module ts.formatting { return (node.parent).parameters; } break; + } case SyntaxKind.NewExpression: - case SyntaxKind.CallExpression: - var start = node.getStart(sourceFile); + case SyntaxKind.CallExpression: { + let start = node.getStart(sourceFile); if ((node.parent).typeArguments && rangeContainsStartEnd((node.parent).typeArguments, start, node.getEnd())) { return (node.parent).typeArguments; @@ -273,34 +274,35 @@ module ts.formatting { return (node.parent).arguments; } break; + } } } return undefined; } function getActualIndentationForListItem(node: Node, sourceFile: SourceFile, options: EditorOptions): number { - var containingList = getContainingList(node, sourceFile); + let containingList = getContainingList(node, sourceFile); return containingList ? getActualIndentationFromList(containingList) : Value.Unknown; function getActualIndentationFromList(list: Node[]): number { - var index = indexOf(list, node); + let index = indexOf(list, node); return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : Value.Unknown; } } function deriveActualIndentationFromList(list: Node[], index: number, sourceFile: SourceFile, options: EditorOptions): number { Debug.assert(index >= 0 && index < list.length); - var node = list[index]; + let node = list[index]; // walk toward the start of the list starting from current node and check if the line is the same for all items. // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] - var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); - for (var i = index - 1; i >= 0; --i) { + let lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + for (let i = index - 1; i >= 0; --i) { if (list[i].kind === SyntaxKind.CommaToken) { continue; } // skip list items that ends on the same line with the current list element - var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; + let prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; if (prevEndLine !== lineAndCharacter.line) { return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); } @@ -311,7 +313,7 @@ module ts.formatting { } function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter: LineAndCharacter, sourceFile: SourceFile, options: EditorOptions): number { - var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); + let lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } @@ -323,10 +325,10 @@ module ts.formatting { value of 'column' for '$' is 6 (assuming that tab size is 4) */ export function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorOptions) { - var character = 0; - var column = 0; - for (var pos = startPos; pos < endPos; ++pos) { - var ch = sourceFile.text.charCodeAt(pos); + let character = 0; + let column = 0; + for (let pos = startPos; pos < endPos; ++pos) { + let ch = sourceFile.text.charCodeAt(pos); if (!isWhiteSpace(ch)) { break; } @@ -403,9 +405,9 @@ module ts.formatting { * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. */ function nodeEndsWith(n: Node, expectedLastToken: SyntaxKind, sourceFile: SourceFile): boolean { - var children = n.getChildren(sourceFile); + let children = n.getChildren(sourceFile); if (children.length) { - var last = children[children.length - 1]; + let last = children[children.length - 1]; if (last.kind === expectedLastToken) { return true; } @@ -471,7 +473,7 @@ module ts.formatting { return isCompletedNode((n).statement, sourceFile); case SyntaxKind.DoStatement: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - var hasWhileKeyword = findChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile); + let hasWhileKeyword = findChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile); } diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index ff9cb91ce68..f1cdfebc978 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -27,7 +27,7 @@ module ts.formatting { constructor(from: SyntaxKind, to: SyntaxKind, except: SyntaxKind[]) { this.tokens = []; - for (var token = from; token <= to; token++) { + for (let token = from; token <= to; token++) { if (except.indexOf(token) < 0) { this.tokens.push(token); } @@ -74,8 +74,8 @@ module ts.formatting { export class TokenAllAccess implements ITokenAccess { public GetTokens(): SyntaxKind[] { - var result: SyntaxKind[] = []; - for (var token = SyntaxKind.FirstToken; token <= SyntaxKind.LastToken; token++) { + let result: SyntaxKind[] = []; + for (let token = SyntaxKind.FirstToken; token <= SyntaxKind.LastToken; token++) { result.push(token); } return result; diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 06eaa481dfb..c6463aba733 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -418,10 +418,10 @@ module ts.NavigationBar { } function createFunctionItem(node: FunctionDeclaration) { - if (node.name && node.body && node.body.kind === SyntaxKind.Block) { + if ((node.name || node.flags & NodeFlags.Default) && node.body && node.body.kind === SyntaxKind.Block) { let childItems = getItemsWorker(sortNodes((node.body).statements), createChildItem); - return getNavigationBarItem(node.name.text, + return getNavigationBarItem((!node.name && node.flags & NodeFlags.Default) ? "default": node.name.text , ts.ScriptElementKind.functionElement, getNodeModifiers(node), [getNodeSpan(node)], @@ -452,11 +452,6 @@ module ts.NavigationBar { } function createClassItem(node: ClassDeclaration): ts.NavigationBarItem { - if (!node.name) { - // An export default class may be nameless - return undefined; - } - let childItems: NavigationBarItem[]; if (node.members) { @@ -475,8 +470,10 @@ module ts.NavigationBar { childItems = getItemsWorker(sortNodes(nodes), createChildItem); } + var nodeName = !node.name && (node.flags & NodeFlags.Default) ? "default" : node.name.text; + return getNavigationBarItem( - node.name.text, + nodeName, ts.ScriptElementKind.classElement, getNodeModifiers(node), [getNodeSpan(node)], diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 78ec1d31049..246cf6569fc 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -553,6 +553,9 @@ declare module "typescript" { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -762,7 +765,8 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -1239,8 +1243,6 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1482,7 +1484,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index c152f56978a..09f2e3223c4 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -1668,6 +1668,15 @@ declare module "typescript" { >body : Expression | Block >Block : Block >Expression : Expression + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { +>ArrowFunction : ArrowFunction +>Expression : Expression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + equalsGreaterThanToken: Node; +>equalsGreaterThanToken : Node +>Node : Node } interface LiteralExpression extends PrimaryExpression { >LiteralExpression : LiteralExpression @@ -2324,9 +2333,13 @@ declare module "typescript" { isExportEquals?: boolean; >isExportEquals : boolean - expression: Expression; + expression?: Expression; >expression : Expression >Expression : Expression + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode } interface FileReference extends TextRange { >FileReference : FileReference @@ -3958,12 +3971,6 @@ declare module "typescript" { watch?: boolean; >watch : boolean - stripInternal?: boolean; ->stripInternal : boolean - - preserveNewLines?: boolean; ->preserveNewLines : boolean - [option: string]: string | number | boolean; >option : string } @@ -4747,7 +4754,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; >version : string function createCompilerHost(options: CompilerOptions): CompilerHost; diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index 7b90be03ff9..adb7b568163 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -584,6 +584,9 @@ declare module "typescript" { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -793,7 +796,8 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -1270,8 +1274,6 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1513,7 +1515,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 2311b8d20af..5c182d7e6ba 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -1814,6 +1814,15 @@ declare module "typescript" { >body : Expression | Block >Block : Block >Expression : Expression + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { +>ArrowFunction : ArrowFunction +>Expression : Expression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + equalsGreaterThanToken: Node; +>equalsGreaterThanToken : Node +>Node : Node } interface LiteralExpression extends PrimaryExpression { >LiteralExpression : LiteralExpression @@ -2470,9 +2479,13 @@ declare module "typescript" { isExportEquals?: boolean; >isExportEquals : boolean - expression: Expression; + expression?: Expression; >expression : Expression >Expression : Expression + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode } interface FileReference extends TextRange { >FileReference : FileReference @@ -4104,12 +4117,6 @@ declare module "typescript" { watch?: boolean; >watch : boolean - stripInternal?: boolean; ->stripInternal : boolean - - preserveNewLines?: boolean; ->preserveNewLines : boolean - [option: string]: string | number | boolean; >option : string } @@ -4893,7 +4900,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; >version : string function createCompilerHost(options: CompilerOptions): CompilerHost; diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index 18e44b9d11a..080fec98e2f 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -585,6 +585,9 @@ declare module "typescript" { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -794,7 +797,8 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -1271,8 +1275,6 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1514,7 +1516,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 4e2ab58e591..be2c226b8d0 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -1764,6 +1764,15 @@ declare module "typescript" { >body : Expression | Block >Block : Block >Expression : Expression + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { +>ArrowFunction : ArrowFunction +>Expression : Expression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + equalsGreaterThanToken: Node; +>equalsGreaterThanToken : Node +>Node : Node } interface LiteralExpression extends PrimaryExpression { >LiteralExpression : LiteralExpression @@ -2420,9 +2429,13 @@ declare module "typescript" { isExportEquals?: boolean; >isExportEquals : boolean - expression: Expression; + expression?: Expression; >expression : Expression >Expression : Expression + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode } interface FileReference extends TextRange { >FileReference : FileReference @@ -4054,12 +4067,6 @@ declare module "typescript" { watch?: boolean; >watch : boolean - stripInternal?: boolean; ->stripInternal : boolean - - preserveNewLines?: boolean; ->preserveNewLines : boolean - [option: string]: string | number | boolean; >option : string } @@ -4843,7 +4850,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; >version : string function createCompilerHost(options: CompilerOptions): CompilerHost; diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 751caba4dbc..8061ff0d424 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -622,6 +622,9 @@ declare module "typescript" { name?: Identifier; body: Block | Expression; } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { + equalsGreaterThanToken: Node; + } interface LiteralExpression extends PrimaryExpression { text: string; isUnterminated?: boolean; @@ -831,7 +834,8 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression: Expression; + expression?: Expression; + type?: TypeNode; } interface FileReference extends TextRange { fileName: string; @@ -1308,8 +1312,6 @@ declare module "typescript" { target?: ScriptTarget; version?: boolean; watch?: boolean; - stripInternal?: boolean; - preserveNewLines?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1551,7 +1553,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; function createCompilerHost(options: CompilerOptions): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index cdd9e516846..7fa6478844d 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -1937,6 +1937,15 @@ declare module "typescript" { >body : Expression | Block >Block : Block >Expression : Expression + } + interface ArrowFunction extends Expression, FunctionLikeDeclaration { +>ArrowFunction : ArrowFunction +>Expression : Expression +>FunctionLikeDeclaration : FunctionLikeDeclaration + + equalsGreaterThanToken: Node; +>equalsGreaterThanToken : Node +>Node : Node } interface LiteralExpression extends PrimaryExpression { >LiteralExpression : LiteralExpression @@ -2593,9 +2602,13 @@ declare module "typescript" { isExportEquals?: boolean; >isExportEquals : boolean - expression: Expression; + expression?: Expression; >expression : Expression >Expression : Expression + + type?: TypeNode; +>type : TypeNode +>TypeNode : TypeNode } interface FileReference extends TextRange { >FileReference : FileReference @@ -4227,12 +4240,6 @@ declare module "typescript" { watch?: boolean; >watch : boolean - stripInternal?: boolean; ->stripInternal : boolean - - preserveNewLines?: boolean; ->preserveNewLines : boolean - [option: string]: string | number | boolean; >option : string } @@ -5016,7 +5023,7 @@ declare module "typescript" { } declare module "typescript" { /** The version of the TypeScript compiler release */ - var version: string; + let version: string; >version : string function createCompilerHost(options: CompilerOptions): CompilerHost; diff --git a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt new file mode 100644 index 00000000000..fbd9be772fa --- /dev/null +++ b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.errors.txt @@ -0,0 +1,131 @@ +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(2,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(4,7): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(6,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(8,7): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(10,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(12,7): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(14,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(16,7): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(18,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(21,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(23,8): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(26,8): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(52,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(54,5): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(59,13): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(63,13): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(68,13): error TS1200: Line terminator not permitted before arrow. +tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts(72,9): error TS1200: Line terminator not permitted before arrow. + + +==== tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts (18 errors) ==== + var f1 = () + => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f2 = (x: string, y: string) /* + */ => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f3 = (x: string, y: number, ...rest) + => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f4 = (x: string, y: number, ...rest) /* + */ => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f5 = (...rest) + => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f6 = (...rest) /* + */ => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f7 = (x: string, y: number, z = 10) + => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f8 = (x: string, y: number, z = 10) /* + */ => { } + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f9 = (a: number): number + => a; + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f10 = (a: number) : + number + => a + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f11 = (a: number): number /* + */ => a; + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + var f12 = (a: number) : + number /* + */ => a + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + + // Should be valid. + var f11 = (a: number + ) => a; + + // Should be valid. + var f12 = (a: number) + : number => a; + + // Should be valid. + var f13 = (a: number): + number => a; + + // Should be valid. + var f14 = () /* */ => {} + + // Should be valid. + var f15 = (a: number): number /* */ => a + + // Should be valid. + var f16 = (a: number, b = 10): + number /* */ => a + b; + + function foo(func: () => boolean) { } + foo(() + => true); + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + foo(() + => { return false; }); + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + + module m { + class City { + constructor(x: number, thing = () + => 100) { + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + } + + public m = () + => 2 * 2 * 2 + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + } + + export enum Enum { + claw = (() + => 10)() + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + } + + export var v = x + => new City(Enum.claw); + ~~ +!!! error TS1200: Line terminator not permitted before arrow. + } + \ No newline at end of file diff --git a/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js new file mode 100644 index 00000000000..610cbe62c1b --- /dev/null +++ b/tests/baselines/reference/disallowLineTerminatorBeforeArrow.js @@ -0,0 +1,178 @@ +//// [disallowLineTerminatorBeforeArrow.ts] +var f1 = () + => { } +var f2 = (x: string, y: string) /* + */ => { } +var f3 = (x: string, y: number, ...rest) + => { } +var f4 = (x: string, y: number, ...rest) /* + */ => { } +var f5 = (...rest) + => { } +var f6 = (...rest) /* + */ => { } +var f7 = (x: string, y: number, z = 10) + => { } +var f8 = (x: string, y: number, z = 10) /* + */ => { } +var f9 = (a: number): number + => a; +var f10 = (a: number) : + number + => a +var f11 = (a: number): number /* + */ => a; +var f12 = (a: number) : + number /* + */ => a + +// Should be valid. +var f11 = (a: number + ) => a; + +// Should be valid. +var f12 = (a: number) + : number => a; + +// Should be valid. +var f13 = (a: number): + number => a; + +// Should be valid. +var f14 = () /* */ => {} + +// Should be valid. +var f15 = (a: number): number /* */ => a + +// Should be valid. +var f16 = (a: number, b = 10): + number /* */ => a + b; + +function foo(func: () => boolean) { } +foo(() + => true); +foo(() + => { return false; }); + +module m { + class City { + constructor(x: number, thing = () + => 100) { + } + + public m = () + => 2 * 2 * 2 + } + + export enum Enum { + claw = (() + => 10)() + } + + export var v = x + => new City(Enum.claw); +} + + +//// [disallowLineTerminatorBeforeArrow.js] +var f1 = function () { +}; +var f2 = function (x, y) { +}; +var f3 = function (x, y) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } +}; +var f4 = function (x, y) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } +}; +var f5 = function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i - 0] = arguments[_i]; + } +}; +var f6 = function () { + var rest = []; + for (var _i = 0; _i < arguments.length; _i++) { + rest[_i - 0] = arguments[_i]; + } +}; +var f7 = function (x, y, z) { + if (z === void 0) { z = 10; } +}; +var f8 = function (x, y, z) { + if (z === void 0) { z = 10; } +}; +var f9 = function (a) { + return a; +}; +var f10 = function (a) { + return a; +}; +var f11 = function (a) { + return a; +}; +var f12 = function (a) { + return a; +}; +// Should be valid. +var f11 = function (a) { + return a; +}; +// Should be valid. +var f12 = function (a) { + return a; +}; +// Should be valid. +var f13 = function (a) { + return a; +}; +// Should be valid. +var f14 = function () { +}; +// Should be valid. +var f15 = function (a) { + return a; +}; +// Should be valid. +var f16 = function (a, b) { + if (b === void 0) { b = 10; } + return a + b; +}; +function foo(func) { +} +foo(function () { + return true; +}); +foo(function () { + return false; +}); +var m; +(function (m) { + var City = (function () { + function City(x, thing) { + if (thing === void 0) { thing = function () { + return 100; + }; } + this.m = function () { + return 2 * 2 * 2; + }; + } + return City; + })(); + (function (Enum) { + Enum[Enum["claw"] = (function () { + return 10; + })()] = "claw"; + })(m.Enum || (m.Enum = {})); + var Enum = m.Enum; + m.v = function (x) { + return new City(Enum.claw); + }; +})(m || (m = {})); diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt b/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt new file mode 100644 index 00000000000..71ff4261ffe --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/exportDefaultTypeAnnoation.ts(2,18): error TS1201: A type annotation on an export statement is only allowed in an ambient external module declaration. + + +==== tests/cases/compiler/exportDefaultTypeAnnoation.ts (1 errors) ==== + + export default : number; + ~~~~~~ +!!! error TS1201: A type annotation on an export statement is only allowed in an ambient external module declaration. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation.js b/tests/baselines/reference/exportDefaultTypeAnnoation.js new file mode 100644 index 00000000000..8adf31a5f18 --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation.js @@ -0,0 +1,6 @@ +//// [exportDefaultTypeAnnoation.ts] + +export default : number; + +//// [exportDefaultTypeAnnoation.js] +module.exports = ; diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation2.js b/tests/baselines/reference/exportDefaultTypeAnnoation2.js new file mode 100644 index 00000000000..2c918954702 --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation2.js @@ -0,0 +1,7 @@ +//// [exportDefaultTypeAnnoation2.ts] + +declare module "mod" { + export default : number; +} + +//// [exportDefaultTypeAnnoation2.js] diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation2.types b/tests/baselines/reference/exportDefaultTypeAnnoation2.types new file mode 100644 index 00000000000..53ca78586cc --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation2.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/exportDefaultTypeAnnoation2.ts === + +No type information for this code.declare module "mod" { +No type information for this code. export default : number; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt b/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt new file mode 100644 index 00000000000..326713e059e --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/reference1.ts(2,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/reference2.ts(2,5): error TS2322: Type 'number' is not assignable to type 'string'. + + +==== tests/cases/compiler/mod.d.ts (0 errors) ==== + + declare module "mod" { + export default : number; + } + +==== tests/cases/compiler/reference1.ts (1 errors) ==== + import d from "mod"; + var s: string = d; // Error + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + +==== tests/cases/compiler/reference2.ts (1 errors) ==== + import { default as d } from "mod"; + var s: string = d; // Error + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation3.js b/tests/baselines/reference/exportDefaultTypeAnnoation3.js new file mode 100644 index 00000000000..069c8385e77 --- /dev/null +++ b/tests/baselines/reference/exportDefaultTypeAnnoation3.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/exportDefaultTypeAnnoation3.ts] //// + +//// [mod.d.ts] + +declare module "mod" { + export default : number; +} + +//// [reference1.ts] +import d from "mod"; +var s: string = d; // Error + +//// [reference2.ts] +import { default as d } from "mod"; +var s: string = d; // Error + +//// [reference1.js] +var d = require("mod"); +var s = d; // Error +//// [reference2.js] +var _mod = require("mod"); +var s = _mod.default; // Error diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js new file mode 100644 index 00000000000..902a23f5886 --- /dev/null +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -0,0 +1,46 @@ +//// [initializePropertiesWithRenamedLet.ts] + +var x0; +if (true) { + let x0; + var obj1 = { x0: x0 }; + var obj2 = { x0 }; +} + +var x, y, z; +if (true) { + let { x: x } = { x: 0 }; + let { y } = { y: 0 }; + let z; + ({ z: z } = { z: 0 }); + ({ z } = { z: 0 }); +} + +//// [initializePropertiesWithRenamedLet.js] +var x0; +if (true) { + var _x0; + var obj1 = { + x0: _x0 + }; + var obj2 = { + x0: _x0 + }; +} +var x, y, z; +if (true) { + var _x = ({ + x: 0 + }).x; + var _y = ({ + y: 0 + }).y; + var _z; + (_a = { + z: 0 + }, _z = _a.z, _a); + (_b = { + z: 0 + }, _z = _b.z, _b); +} +var _a, _b; diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.types b/tests/baselines/reference/initializePropertiesWithRenamedLet.types new file mode 100644 index 00000000000..77f16756fdb --- /dev/null +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.types @@ -0,0 +1,58 @@ +=== tests/cases/compiler/initializePropertiesWithRenamedLet.ts === + +var x0; +>x0 : any + +if (true) { + let x0; +>x0 : any + + var obj1 = { x0: x0 }; +>obj1 : { x0: any; } +>{ x0: x0 } : { x0: any; } +>x0 : any +>x0 : any + + var obj2 = { x0 }; +>obj2 : { x0: any; } +>{ x0 } : { x0: any; } +>x0 : any +} + +var x, y, z; +>x : any +>y : any +>z : any + +if (true) { + let { x: x } = { x: 0 }; +>x : unknown +>x : number +>{ x: 0 } : { x: number; } +>x : number + + let { y } = { y: 0 }; +>y : number +>{ y: 0 } : { y: number; } +>y : number + + let z; +>z : any + + ({ z: z } = { z: 0 }); +>({ z: z } = { z: 0 }) : { z: number; } +>{ z: z } = { z: 0 } : { z: number; } +>{ z: z } : { z: any; } +>z : any +>z : any +>{ z: 0 } : { z: number; } +>z : number + + ({ z } = { z: 0 }); +>({ z } = { z: 0 }) : { z: number; } +>{ z } = { z: 0 } : { z: number; } +>{ z } : { z: any; } +>z : any +>{ z: 0 } : { z: number; } +>z : number +} diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.errors.txt b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.errors.txt new file mode 100644 index 00000000000..4fc1d47c383 --- /dev/null +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts(4,13): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. +tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts(5,15): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. +tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts(6,18): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. +tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts(7,15): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. +tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts(8,18): error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + + +==== tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts (5 errors) ==== + if (true) { + let x; + if (true) { + var x = 0; // Error + ~ +!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + var { x = 0 } = { x: 0 }; // Error + ~ +!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + var { x: x = 0 } = { x: 0 }; // Error + ~ +!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + var { x } = { x: 0 }; // Error + ~ +!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + var { x: x } = { x: 0 }; // Error + ~ +!!! error TS2481: Cannot initialize outer scoped variable 'x' in the same scope as block scoped declaration 'x'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js new file mode 100644 index 00000000000..594ec1ca18e --- /dev/null +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js @@ -0,0 +1,31 @@ +//// [shadowingViaLocalValueOrBindingElement.ts] +if (true) { + let x; + if (true) { + var x = 0; // Error + var { x = 0 } = { x: 0 }; // Error + var { x: x = 0 } = { x: 0 }; // Error + var { x } = { x: 0 }; // Error + var { x: x } = { x: 0 }; // Error + } +} + +//// [shadowingViaLocalValueOrBindingElement.js] +if (true) { + var _x; + if (true) { + var x = 0; // Error + var _a = ({ + x: 0 + }).x, x = _a === void 0 ? 0 : _a; // Error + var _b = ({ + x: 0 + }).x, x = _b === void 0 ? 0 : _b; // Error + var x = ({ + x: 0 + }).x; // Error + var x = ({ + x: 0 + }).x; // Error + } +} diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js index 663969caefc..5b128221aa6 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.js @@ -145,23 +145,16 @@ function someGenerics4(strs, n, f) { // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(strs, n, f) { } -(_n = ["", " ", ""], _n.raw = ["", " ", ""], someGenerics5(_n, 4, function () { +(_o = ["", " ", ""], _o.raw = ["", " ", ""], someGenerics5(_o, 4, function () { return null; })); -(_o = ["", "", ""], _o.raw = ["", "", ""], someGenerics5(_o, '', function () { +(_p = ["", "", ""], _p.raw = ["", "", ""], someGenerics5(_p, '', function () { return 3; })); -(_p = ["", "", ""], _p.raw = ["", "", ""], someGenerics5(_p, null, null)); +(_q = ["", "", ""], _q.raw = ["", "", ""], someGenerics5(_q, null, null)); // Generic tag with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(strs, a, b, c) { } -(_q = ["", "", "", ""], _q.raw = ["", "", "", ""], someGenerics6(_q, function (n) { - return n; -}, function (n) { - return n; -}, function (n) { - return n; -})); (_r = ["", "", "", ""], _r.raw = ["", "", "", ""], someGenerics6(_r, function (n) { return n; }, function (n) { @@ -176,16 +169,16 @@ function someGenerics6(strs, a, b, c) { }, function (n) { return n; })); -// Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs, a, b, c) { -} -(_t = ["", "", "", ""], _t.raw = ["", "", "", ""], someGenerics7(_t, function (n) { +(_t = ["", "", "", ""], _t.raw = ["", "", "", ""], someGenerics6(_t, function (n) { return n; }, function (n) { return n; }, function (n) { return n; })); +// Generic tag with multiple arguments of function types that each have parameters of different generic type +function someGenerics7(strs, a, b, c) { +} (_u = ["", "", "", ""], _u.raw = ["", "", "", ""], someGenerics7(_u, function (n) { return n; }, function (n) { @@ -200,19 +193,26 @@ function someGenerics7(strs, a, b, c) { }, function (n) { return n; })); +(_w = ["", "", "", ""], _w.raw = ["", "", "", ""], someGenerics7(_w, function (n) { + return n; +}, function (n) { + return n; +}, function (n) { + return n; +})); // Generic tag with argument of generic function type function someGenerics8(strs, n) { return n; } -var x = (_w = ["", ""], _w.raw = ["", ""], someGenerics8(_w, someGenerics7)); -(_x = ["", "", "", ""], _x.raw = ["", "", "", ""], x(_x, null, null, null)); +var x = (_x = ["", ""], _x.raw = ["", ""], someGenerics8(_x, someGenerics7)); +(_y = ["", "", "", ""], _y.raw = ["", "", "", ""], x(_y, null, null, null)); // Generic tag with multiple parameters of generic type passed arguments with no best common type function someGenerics9(strs, a, b, c) { return null; } -var a9a = (_y = ["", "", "", ""], _y.raw = ["", "", "", ""], someGenerics9(_y, '', 0, [])); +var a9a = (_z = ["", "", "", ""], _z.raw = ["", "", "", ""], someGenerics9(_z, '', 0, [])); var a9a; -var a9e = (_z = ["", "", "", ""], _z.raw = ["", "", "", ""], someGenerics9(_z, undefined, { +var a9e = (_0 = ["", "", "", ""], _0.raw = ["", "", "", ""], someGenerics9(_0, undefined, { x: 6, z: new Date() }, { @@ -221,7 +221,7 @@ var a9e = (_z = ["", "", "", ""], _z.raw = ["", "", "", ""], someGenerics9(_z, u })); var a9e; // Generic tag with multiple parameters of generic type passed arguments with a single best common type -var a9d = (_0 = ["", "", "", ""], _0.raw = ["", "", "", ""], someGenerics9(_0, { +var a9d = (_1 = ["", "", "", ""], _1.raw = ["", "", "", ""], someGenerics9(_1, { x: 3 }, { x: 6 @@ -231,9 +231,9 @@ var a9d = (_0 = ["", "", "", ""], _0.raw = ["", "", "", ""], someGenerics9(_0, { var a9d; // Generic tag with multiple parameters of generic type where one argument is of type 'any' var anyVar; -var a = (_1 = ["", "", "", ""], _1.raw = ["", "", "", ""], someGenerics9(_1, 7, anyVar, 4)); +var a = (_2 = ["", "", "", ""], _2.raw = ["", "", "", ""], someGenerics9(_2, 7, anyVar, 4)); var a; // Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' -var arr = (_2 = ["", "", "", ""], _2.raw = ["", "", "", ""], someGenerics9(_2, [], null, undefined)); +var arr = (_3 = ["", "", "", ""], _3.raw = ["", "", "", ""], someGenerics9(_3, [], null, undefined)); var arr; -var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js index 1840fed234b..24b0b16ea35 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.js @@ -103,26 +103,26 @@ var s = (_k = ["", ""], _k.raw = ["", ""], fn3(_k, 4)); var s = (_l = ["", "", "", ""], _l.raw = ["", "", "", ""], fn3(_l, '', '', '')); var n = (_m = ["", "", "", ""], _m.raw = ["", "", "", ""], fn3(_m, '', '', 3)); // Generic overloads with differing arity tagging with argument count that doesn't match any overload -(_n = [""], _n.raw = [""], fn3(_n)); // Error +(_o = [""], _o.raw = [""], fn3(_o)); // Error function fn4() { } // Generic overloads with constraints tagged with types that satisfy the constraints -(_o = ["", "", ""], _o.raw = ["", "", ""], fn4(_o, '', 3)); -(_p = ["", "", ""], _p.raw = ["", "", ""], fn4(_p, 3, '')); -(_q = ["", "", ""], _q.raw = ["", "", ""], fn4(_q, 3, undefined)); -(_r = ["", "", ""], _r.raw = ["", "", ""], fn4(_r, '', null)); +(_p = ["", "", ""], _p.raw = ["", "", ""], fn4(_p, '', 3)); +(_q = ["", "", ""], _q.raw = ["", "", ""], fn4(_q, 3, '')); +(_r = ["", "", ""], _r.raw = ["", "", ""], fn4(_r, 3, undefined)); +(_s = ["", "", ""], _s.raw = ["", "", ""], fn4(_s, '', null)); // Generic overloads with constraints called with type arguments that do not satisfy the constraints -(_s = ["", "", ""], _s.raw = ["", "", ""], fn4(_s, null, null)); // Error +(_t = ["", "", ""], _t.raw = ["", "", ""], fn4(_t, null, null)); // Error // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints -(_t = ["", "", ""], _t.raw = ["", "", ""], fn4(_t, true, null)); -(_u = ["", "", ""], _u.raw = ["", "", ""], fn4(_u, null, true)); +(_u = ["", "", ""], _u.raw = ["", "", ""], fn4(_u, true, null)); +(_v = ["", "", ""], _v.raw = ["", "", ""], fn4(_v, null, true)); function fn5() { return undefined; } -(_v = ["", ""], _v.raw = ["", ""], fn5(_v, function (n) { +(_w = ["", ""], _w.raw = ["", ""], fn5(_w, function (n) { return n.toFixed(); })); // will error; 'n' should have type 'string'. -(_w = ["", ""], _w.raw = ["", ""], fn5(_w, function (n) { +(_x = ["", ""], _x.raw = ["", ""], fn5(_x, function (n) { return n.substr(0); })); -var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w; +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; diff --git a/tests/cases/compiler/exportDefaultTypeAnnoation.ts b/tests/cases/compiler/exportDefaultTypeAnnoation.ts new file mode 100644 index 00000000000..d7fd24d5be3 --- /dev/null +++ b/tests/cases/compiler/exportDefaultTypeAnnoation.ts @@ -0,0 +1,4 @@ +// @target: es5 +// @module: commonjs + +export default : number; \ No newline at end of file diff --git a/tests/cases/compiler/exportDefaultTypeAnnoation2.ts b/tests/cases/compiler/exportDefaultTypeAnnoation2.ts new file mode 100644 index 00000000000..ddb317bd8fc --- /dev/null +++ b/tests/cases/compiler/exportDefaultTypeAnnoation2.ts @@ -0,0 +1,6 @@ +// @target: es5 +// @module: commonjs + +declare module "mod" { + export default : number; +} \ No newline at end of file diff --git a/tests/cases/compiler/exportDefaultTypeAnnoation3.ts b/tests/cases/compiler/exportDefaultTypeAnnoation3.ts new file mode 100644 index 00000000000..88a45de2d32 --- /dev/null +++ b/tests/cases/compiler/exportDefaultTypeAnnoation3.ts @@ -0,0 +1,15 @@ +// @target: es5 +// @module: commonjs + +// @fileName: mod.d.ts +declare module "mod" { + export default : number; +} + +// @fileName: reference1.ts +import d from "mod"; +var s: string = d; // Error + +// @fileName: reference2.ts +import { default as d } from "mod"; +var s: string = d; // Error \ No newline at end of file diff --git a/tests/cases/compiler/initializePropertiesWithRenamedLet.ts b/tests/cases/compiler/initializePropertiesWithRenamedLet.ts new file mode 100644 index 00000000000..b30ce609775 --- /dev/null +++ b/tests/cases/compiler/initializePropertiesWithRenamedLet.ts @@ -0,0 +1,17 @@ +// @target: es5 + +var x0; +if (true) { + let x0; + var obj1 = { x0: x0 }; + var obj2 = { x0 }; +} + +var x, y, z; +if (true) { + let { x: x } = { x: 0 }; + let { y } = { y: 0 }; + let z; + ({ z: z } = { z: 0 }); + ({ z } = { z: 0 }); +} \ No newline at end of file diff --git a/tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts b/tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts new file mode 100644 index 00000000000..a5d178e2e47 --- /dev/null +++ b/tests/cases/compiler/shadowingViaLocalValueOrBindingElement.ts @@ -0,0 +1,10 @@ +if (true) { + let x; + if (true) { + var x = 0; // Error + var { x = 0 } = { x: 0 }; // Error + var { x: x = 0 } = { x: 0 }; // Error + var { x } = { x: 0 }; // Error + var { x: x } = { x: 0 }; // Error + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts b/tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts new file mode 100644 index 00000000000..bd984ba4da0 --- /dev/null +++ b/tests/cases/conformance/es6/arrowFunction/disallowLineTerminatorBeforeArrow.ts @@ -0,0 +1,73 @@ +var f1 = () + => { } +var f2 = (x: string, y: string) /* + */ => { } +var f3 = (x: string, y: number, ...rest) + => { } +var f4 = (x: string, y: number, ...rest) /* + */ => { } +var f5 = (...rest) + => { } +var f6 = (...rest) /* + */ => { } +var f7 = (x: string, y: number, z = 10) + => { } +var f8 = (x: string, y: number, z = 10) /* + */ => { } +var f9 = (a: number): number + => a; +var f10 = (a: number) : + number + => a +var f11 = (a: number): number /* + */ => a; +var f12 = (a: number) : + number /* + */ => a + +// Should be valid. +var f11 = (a: number + ) => a; + +// Should be valid. +var f12 = (a: number) + : number => a; + +// Should be valid. +var f13 = (a: number): + number => a; + +// Should be valid. +var f14 = () /* */ => {} + +// Should be valid. +var f15 = (a: number): number /* */ => a + +// Should be valid. +var f16 = (a: number, b = 10): + number /* */ => a + b; + +function foo(func: () => boolean) { } +foo(() + => true); +foo(() + => { return false; }); + +module m { + class City { + constructor(x: number, thing = () + => 100) { + } + + public m = () + => 2 * 2 * 2 + } + + export enum Enum { + claw = (() + => 10)() + } + + export var v = x + => new City(Enum.claw); +} diff --git a/tests/cases/fourslash/navbar_exportDefault.ts b/tests/cases/fourslash/navbar_exportDefault.ts new file mode 100644 index 00000000000..a8fe854fa28 --- /dev/null +++ b/tests/cases/fourslash/navbar_exportDefault.ts @@ -0,0 +1,24 @@ +/// + +// @Filename: a.ts +//// {| "itemName": "default", "kind": "class", "parentName": "" |}export default class { } + +// @Filename: b.ts +//// {| "itemName": "C", "kind": "class", "parentName": "" |}export default class C { } + +// @Filename: c.ts +//// {| "itemName": "default", "kind": "function", "parentName": "" |}export default function { } + +// @Filename: d.ts +//// {| "itemName": "Func", "kind": "function", "parentName": "" |}export default function Func { } + +test.markers().forEach(marker => { + goTo.file(marker.fileName); + verify.getScriptLexicalStructureListContains( + marker.data.itemName, + marker.data.kind, + marker.fileName, + marker.data.parentName, + marker.data.isAdditionalRange, + marker.position); +}); \ No newline at end of file