mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Update LKG
This commit is contained in:
parent
e10a62857b
commit
271fb83f08
304
lib/tsc.js
304
lib/tsc.js
@ -174,7 +174,7 @@ var ts;
|
||||
var ts;
|
||||
(function (ts) {
|
||||
ts.versionMajorMinor = "2.9";
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
function isExternalModuleNameRelative(moduleName) {
|
||||
@ -2124,6 +2124,23 @@ var ts;
|
||||
return startsWith(str, prefix) ? str.substr(prefix.length) : str;
|
||||
}
|
||||
ts.removePrefix = removePrefix;
|
||||
function tryRemovePrefix(str, prefix) {
|
||||
return startsWith(str, prefix) ? str.substring(prefix.length) : undefined;
|
||||
}
|
||||
ts.tryRemovePrefix = tryRemovePrefix;
|
||||
function tryRemoveDirectoryPrefix(path, dirPath) {
|
||||
var a = tryRemovePrefix(path, dirPath);
|
||||
if (a === undefined)
|
||||
return undefined;
|
||||
switch (a.charCodeAt(0)) {
|
||||
case 47:
|
||||
case 92:
|
||||
return a.slice(1);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
ts.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix;
|
||||
function endsWith(str, suffix) {
|
||||
var expectedPos = str.length - suffix.length;
|
||||
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
||||
@ -2133,6 +2150,10 @@ var ts;
|
||||
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
|
||||
}
|
||||
ts.removeSuffix = removeSuffix;
|
||||
function tryRemoveSuffix(str, suffix) {
|
||||
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : undefined;
|
||||
}
|
||||
ts.tryRemoveSuffix = tryRemoveSuffix;
|
||||
function stringContains(str, substring) {
|
||||
return str.indexOf(substring) !== -1;
|
||||
}
|
||||
@ -2272,14 +2293,17 @@ var ts;
|
||||
};
|
||||
}
|
||||
ts.getFileMatcherPatterns = getFileMatcherPatterns;
|
||||
function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
|
||||
return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
|
||||
}
|
||||
ts.getRegexFromPattern = getRegexFromPattern;
|
||||
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
|
||||
path = normalizePath(path);
|
||||
currentDirectory = normalizePath(currentDirectory);
|
||||
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
|
||||
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
|
||||
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); });
|
||||
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
|
||||
var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag);
|
||||
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
|
||||
var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
|
||||
var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
|
||||
var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];
|
||||
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
|
||||
var basePath = _a[_i];
|
||||
@ -6924,11 +6948,6 @@ var ts;
|
||||
return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);
|
||||
}
|
||||
ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile;
|
||||
function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) {
|
||||
var start = ts.skipTrivia(sourceFile.text, startNode.pos);
|
||||
return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3);
|
||||
}
|
||||
ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan;
|
||||
function createDiagnosticForNodeFromMessageChain(node, messageChain) {
|
||||
var sourceFile = getSourceFileOfNode(node);
|
||||
var span = getErrorSpanForNode(sourceFile, node);
|
||||
@ -7319,7 +7338,7 @@ var ts;
|
||||
}
|
||||
ts.isThisTypePredicate = isThisTypePredicate;
|
||||
function getPropertyAssignment(objectLiteral, key, key2) {
|
||||
return ts.filter(objectLiteral.properties, function (property) {
|
||||
return objectLiteral.properties.filter(function (property) {
|
||||
if (property.kind === 269) {
|
||||
var propName = getTextOfPropertyName(property.name);
|
||||
return key === propName || (key2 && key2 === propName);
|
||||
@ -7335,15 +7354,18 @@ var ts;
|
||||
}
|
||||
ts.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression;
|
||||
function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {
|
||||
var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
|
||||
return jsonObjectLiteral &&
|
||||
ts.firstDefined(getPropertyAssignment(jsonObjectLiteral, propKey), function (property) {
|
||||
return ts.isArrayLiteralExpression(property.initializer) ?
|
||||
ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
|
||||
undefined;
|
||||
});
|
||||
return ts.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function (property) {
|
||||
return ts.isArrayLiteralExpression(property.initializer) ?
|
||||
ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
|
||||
undefined;
|
||||
});
|
||||
}
|
||||
ts.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue;
|
||||
function getTsConfigPropArray(tsConfigSourceFile, propKey) {
|
||||
var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
|
||||
return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts.emptyArray;
|
||||
}
|
||||
ts.getTsConfigPropArray = getTsConfigPropArray;
|
||||
function getContainingFunction(node) {
|
||||
return ts.findAncestor(node.parent, ts.isFunctionLike);
|
||||
}
|
||||
@ -12286,6 +12308,7 @@ var ts;
|
||||
if (languageVersion === void 0) { languageVersion = 2; }
|
||||
initializeState(sourceText, languageVersion, syntaxCursor, 6);
|
||||
sourceFile = createSourceFile(fileName, 2, 6, false);
|
||||
sourceFile.flags = contextFlags;
|
||||
nextToken();
|
||||
var pos = getNodePos();
|
||||
if (token() === 1) {
|
||||
@ -12666,8 +12689,8 @@ var ts;
|
||||
kind === 71 ? new IdentifierConstructor(kind, p, p) :
|
||||
new TokenConstructor(kind, p, p);
|
||||
}
|
||||
function createNodeWithJSDoc(kind) {
|
||||
var node = createNode(kind);
|
||||
function createNodeWithJSDoc(kind, pos) {
|
||||
var node = createNode(kind, pos);
|
||||
if (scanner.getTokenFlags() & 2) {
|
||||
addJSDocComment(node);
|
||||
}
|
||||
@ -13334,6 +13357,21 @@ var ts;
|
||||
}
|
||||
return finishNode(node);
|
||||
}
|
||||
function typeHasArrowFunctionBlockingParseError(node) {
|
||||
switch (node.kind) {
|
||||
case 161:
|
||||
return ts.nodeIsMissing(node.typeName);
|
||||
case 162:
|
||||
case 163: {
|
||||
var _a = node, parameters = _a.parameters, type = _a.type;
|
||||
return parameters.pos === parameters.end || typeHasArrowFunctionBlockingParseError(type);
|
||||
}
|
||||
case 172:
|
||||
return typeHasArrowFunctionBlockingParseError(node.type);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function parseThisTypePredicate(lhs) {
|
||||
nextToken();
|
||||
var node = createNode(160, lhs.pos);
|
||||
@ -13476,12 +13514,13 @@ var ts;
|
||||
if (!(flags & 32)) {
|
||||
signature.typeParameters = parseTypeParameters();
|
||||
}
|
||||
signature.parameters = parseParameterList(flags);
|
||||
var parametersParsedSuccessfully = parseParameterList(signature, flags);
|
||||
if (shouldParseReturnType(returnToken, !!(flags & 4))) {
|
||||
signature.type = parseTypeOrTypePredicate();
|
||||
return signature.type !== undefined;
|
||||
if (typeHasArrowFunctionBlockingParseError(signature.type))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return parametersParsedSuccessfully;
|
||||
}
|
||||
function shouldParseReturnType(returnToken, isType) {
|
||||
if (returnToken === 36) {
|
||||
@ -13498,21 +13537,19 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function parseParameterList(flags) {
|
||||
if (parseExpected(19)) {
|
||||
var savedYieldContext = inYieldContext();
|
||||
var savedAwaitContext = inAwaitContext();
|
||||
setYieldContext(!!(flags & 1));
|
||||
setAwaitContext(!!(flags & 2));
|
||||
var result = parseDelimitedList(16, flags & 32 ? parseJSDocParameter : parseParameter);
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
if (!parseExpected(20) && (flags & 8)) {
|
||||
return undefined;
|
||||
}
|
||||
return result;
|
||||
function parseParameterList(signature, flags) {
|
||||
if (!parseExpected(19)) {
|
||||
signature.parameters = createMissingList();
|
||||
return false;
|
||||
}
|
||||
return (flags & 8) ? undefined : createMissingList();
|
||||
var savedYieldContext = inYieldContext();
|
||||
var savedAwaitContext = inAwaitContext();
|
||||
setYieldContext(!!(flags & 1));
|
||||
setAwaitContext(!!(flags & 2));
|
||||
signature.parameters = parseDelimitedList(16, flags & 32 ? parseJSDocParameter : parseParameter);
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
return parseExpected(20);
|
||||
}
|
||||
function parseTypeMemberSemicolon() {
|
||||
if (parseOptional(26)) {
|
||||
@ -13703,23 +13740,14 @@ var ts;
|
||||
var node = createNode(172);
|
||||
parseExpected(19);
|
||||
node.type = parseType();
|
||||
if (!node.type) {
|
||||
return undefined;
|
||||
}
|
||||
parseExpected(20);
|
||||
return finishNode(node);
|
||||
}
|
||||
function parseFunctionOrConstructorType(kind) {
|
||||
var node = createNodeWithJSDoc(kind);
|
||||
if (kind === 163) {
|
||||
parseExpected(94);
|
||||
}
|
||||
if (!fillSignature(36, 4 | (sourceFile.languageVariant === 1 ? 8 : 0), node)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.parameters) {
|
||||
return undefined;
|
||||
}
|
||||
function parseFunctionOrConstructorType() {
|
||||
var pos = getNodePos();
|
||||
var kind = parseOptional(94) ? 163 : 162;
|
||||
var node = createNodeWithJSDoc(kind, pos);
|
||||
fillSignature(36, 4, node);
|
||||
return finishNode(node);
|
||||
}
|
||||
function parseKeywordAndNoDot() {
|
||||
@ -14018,11 +14046,8 @@ var ts;
|
||||
return doOutsideOfContext(20480, parseTypeWorker);
|
||||
}
|
||||
function parseTypeWorker(noConditionalTypes) {
|
||||
if (isStartOfFunctionType()) {
|
||||
return parseFunctionOrConstructorType(162);
|
||||
}
|
||||
if (token() === 94) {
|
||||
return parseFunctionOrConstructorType(163);
|
||||
if (isStartOfFunctionType() || token() === 94) {
|
||||
return parseFunctionOrConstructorType();
|
||||
}
|
||||
var type = parseUnionTypeOrHigher();
|
||||
if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) {
|
||||
@ -14319,10 +14344,7 @@ var ts;
|
||||
var node = createNodeWithJSDoc(192);
|
||||
node.modifiers = parseModifiersForArrowFunction();
|
||||
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
|
||||
if (!fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.parameters) {
|
||||
if (!fillSignature(56, isAsync, node) && !allowAmbiguity) {
|
||||
return undefined;
|
||||
}
|
||||
if (!allowAmbiguity && token() !== 36 && token() !== 17) {
|
||||
@ -20167,6 +20189,8 @@ var ts;
|
||||
}
|
||||
break;
|
||||
case 224:
|
||||
transformFlags |= 33554432 | 8;
|
||||
break;
|
||||
case 222:
|
||||
case 223:
|
||||
transformFlags |= 33554432;
|
||||
@ -22355,7 +22379,12 @@ var ts;
|
||||
}
|
||||
}
|
||||
if (name !== "default" && (result = lookup(moduleExports, name, meaning & 2623475))) {
|
||||
break loop;
|
||||
if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !result.declarations.some(ts.isJSDocTypeAlias)) {
|
||||
result = undefined;
|
||||
}
|
||||
else {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 237:
|
||||
@ -22451,9 +22480,8 @@ var ts;
|
||||
break;
|
||||
case 296:
|
||||
case 291:
|
||||
lastLocation = location;
|
||||
location = ts.getJSDocHost(location).parent;
|
||||
continue;
|
||||
location = ts.getJSDocHost(location);
|
||||
break;
|
||||
}
|
||||
if (isSelfReferenceLocation(location)) {
|
||||
lastSelfReferenceLocation = location;
|
||||
@ -22711,7 +22739,7 @@ var ts;
|
||||
: resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias);
|
||||
}
|
||||
function isSyntacticDefault(node) {
|
||||
return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512));
|
||||
return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512) || ts.isExportSpecifier(node));
|
||||
}
|
||||
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {
|
||||
if (!allowSyntheticDefaultImports) {
|
||||
@ -23297,6 +23325,38 @@ var ts;
|
||||
function getParentOfSymbol(symbol) {
|
||||
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
||||
}
|
||||
function getContainerOfSymbol(symbol) {
|
||||
var container = getParentOfSymbol(symbol);
|
||||
if (container) {
|
||||
return container;
|
||||
}
|
||||
var candidate = ts.forEach(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; });
|
||||
if (!candidate) {
|
||||
return undefined;
|
||||
}
|
||||
var alias = getAliasForSymbolInContainer(candidate, symbol);
|
||||
return alias ? candidate : undefined;
|
||||
}
|
||||
function getAliasForSymbolInContainer(container, symbol) {
|
||||
if (container === getParentOfSymbol(symbol)) {
|
||||
return symbol;
|
||||
}
|
||||
var exports = getExportsOfSymbol(container);
|
||||
var quick = exports.get(symbol.escapedName);
|
||||
if (quick && symbolRefersToTarget(quick)) {
|
||||
return quick;
|
||||
}
|
||||
return ts.forEachEntry(exports, function (exported) {
|
||||
if (symbolRefersToTarget(exported)) {
|
||||
return exported;
|
||||
}
|
||||
});
|
||||
function symbolRefersToTarget(s) {
|
||||
if (s === symbol || resolveSymbol(s) === symbol || resolveSymbol(s) === resolveSymbol(symbol)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getExportSymbolOfValueSymbolIfExported(symbol) {
|
||||
return symbol && (symbol.flags & 1048576) !== 0
|
||||
? getMergedSymbol(symbol.exportSymbol)
|
||||
@ -23524,7 +23584,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
meaningToLook = getQualifiedLeftMeaning(meaning);
|
||||
symbol = getParentOfSymbol(symbol);
|
||||
symbol = getContainerOfSymbol(symbol);
|
||||
}
|
||||
var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer);
|
||||
if (symbolExternalModule) {
|
||||
@ -24121,9 +24181,12 @@ var ts;
|
||||
context.enclosingDeclaration = undefined;
|
||||
if (ts.getCheckFlags(propertySymbol) & 1024) {
|
||||
var decl = ts.firstOrUndefined(propertySymbol.declarations);
|
||||
var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 67216319);
|
||||
if (name && context.tracker.trackSymbol) {
|
||||
context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319);
|
||||
if (context.tracker.trackSymbol && hasLateBindableName(decl)) {
|
||||
var firstIdentifier = getFirstIdentifier(decl.name.expression);
|
||||
var name = resolveName(firstIdentifier, firstIdentifier.escapedText, 67216319 | 1048576, undefined, undefined, true);
|
||||
if (name) {
|
||||
context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319);
|
||||
}
|
||||
}
|
||||
}
|
||||
var propertyName = symbolToName(propertySymbol, context, 67216319, true);
|
||||
@ -24293,12 +24356,12 @@ var ts;
|
||||
var parentSymbol;
|
||||
if (!accessibleSymbolChain ||
|
||||
needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {
|
||||
var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
|
||||
var parent = getContainerOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
|
||||
if (parent) {
|
||||
var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false);
|
||||
if (parentChain) {
|
||||
parentSymbol = parent;
|
||||
accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]);
|
||||
accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28679,12 +28742,13 @@ var ts;
|
||||
return links.resolvedType;
|
||||
}
|
||||
function resolveImportSymbolType(node, links, symbol, meaning) {
|
||||
links.resolvedSymbol = symbol;
|
||||
var resolvedSymbol = resolveSymbol(symbol);
|
||||
links.resolvedSymbol = resolvedSymbol;
|
||||
if (meaning === 67216319) {
|
||||
return links.resolvedType = getTypeOfSymbol(symbol);
|
||||
}
|
||||
else {
|
||||
return links.resolvedType = getTypeReferenceType(node, symbol);
|
||||
return links.resolvedType = getTypeReferenceType(node, resolvedSymbol);
|
||||
}
|
||||
}
|
||||
function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) {
|
||||
@ -35328,7 +35392,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 188) {
|
||||
argCount = args.length;
|
||||
typeArguments = undefined;
|
||||
typeArguments = node.typeArguments;
|
||||
if (node.template.kind === 201) {
|
||||
var lastSpan = ts.lastOrUndefined(node.template.templateSpans);
|
||||
ts.Debug.assert(lastSpan !== undefined);
|
||||
@ -35890,6 +35954,7 @@ var ts;
|
||||
if (node.expression.kind === 97) {
|
||||
var superType = checkSuperExpression(node.expression);
|
||||
if (isTypeAny(superType)) {
|
||||
ts.forEach(node.arguments, checkExpresionNoReturn);
|
||||
return anySignature;
|
||||
}
|
||||
if (superType !== unknownType) {
|
||||
@ -37551,6 +37616,9 @@ var ts;
|
||||
node.contextualType = saveContextualType;
|
||||
return type;
|
||||
}
|
||||
function checkExpresionNoReturn(node) {
|
||||
checkExpression(node);
|
||||
}
|
||||
function checkExpression(node, checkMode) {
|
||||
var type;
|
||||
if (node.kind === 145) {
|
||||
@ -38981,7 +39049,7 @@ var ts;
|
||||
function errorUnusedLocal(declaration, name, addDiagnostic) {
|
||||
var node = ts.getNameOfDeclaration(declaration) || declaration;
|
||||
var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
|
||||
addDiagnostic(0, ts.createDiagnosticForNodeSpan(ts.getSourceFileOfNode(declaration), declaration, node, message, name));
|
||||
addDiagnostic(0, ts.createDiagnosticForNode(node, message, name));
|
||||
}
|
||||
function parameterNameStartsWithUnderscore(parameterName) {
|
||||
return parameterName && isIdentifierThatStartsWithUnderScore(parameterName);
|
||||
@ -48033,7 +48101,7 @@ var ts;
|
||||
return statements;
|
||||
}
|
||||
return ts.isNodeArray(statements)
|
||||
? ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements)
|
||||
? ts.setTextRange(ts.createNodeArray(ts.prependStatements(statements.slice(), declarations)), statements)
|
||||
: ts.prependStatements(statements, declarations);
|
||||
}
|
||||
ts.mergeLexicalEnvironment = mergeLexicalEnvironment;
|
||||
@ -48989,7 +49057,8 @@ var ts;
|
||||
}
|
||||
function visitSourceFile(node) {
|
||||
var alwaysStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") &&
|
||||
!(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015);
|
||||
!(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&
|
||||
!ts.isJsonSourceFile(node);
|
||||
return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict));
|
||||
}
|
||||
function shouldEmitDecorateCallForClass(node) {
|
||||
@ -49612,6 +49681,7 @@ var ts;
|
||||
case 165:
|
||||
case 119:
|
||||
case 173:
|
||||
case 178:
|
||||
break;
|
||||
default:
|
||||
return ts.Debug.failBadSyntaxKind(node);
|
||||
@ -50864,6 +50934,8 @@ var ts;
|
||||
return visitAwaitExpression(node);
|
||||
case 202:
|
||||
return visitYieldExpression(node);
|
||||
case 224:
|
||||
return visitReturnStatement(node);
|
||||
case 227:
|
||||
return visitLabeledStatement(node);
|
||||
case 183:
|
||||
@ -50922,6 +50994,12 @@ var ts;
|
||||
}
|
||||
return ts.visitEachChild(node, visitor, context);
|
||||
}
|
||||
function visitReturnStatement(node) {
|
||||
if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) {
|
||||
return ts.updateReturn(node, createDownlevelAwait(node.expression ? ts.visitNode(node.expression, visitor, ts.isExpression) : ts.createVoidZero()));
|
||||
}
|
||||
return ts.visitEachChild(node, visitor, context);
|
||||
}
|
||||
function visitLabeledStatement(node) {
|
||||
if (enclosingFunctionFlags & 2) {
|
||||
var statement = ts.unwrapInnermostStatementOfLabel(node);
|
||||
@ -51071,7 +51149,7 @@ var ts;
|
||||
var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([
|
||||
ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, callValues), node.expression),
|
||||
ts.createVariableDeclaration(result)
|
||||
]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, createDownlevelAwait(getValue))), node), 256);
|
||||
]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
|
||||
return ts.createTry(ts.createBlock([
|
||||
ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
|
||||
]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([
|
||||
@ -52648,21 +52726,19 @@ var ts;
|
||||
var singleLine = false;
|
||||
var statementsLocation;
|
||||
var closeBraceLocation;
|
||||
var leadingStatements = [];
|
||||
var statements = [];
|
||||
var body = node.body;
|
||||
var statementOffset;
|
||||
resumeLexicalEnvironment();
|
||||
if (ts.isBlock(body)) {
|
||||
statementOffset = ts.addStandardPrologue(statements, body.statements, false);
|
||||
}
|
||||
addCaptureThisForNodeIfNeeded(statements, node);
|
||||
addDefaultValueAssignmentsIfNeeded(statements, node);
|
||||
addRestParameterIfNeeded(statements, node, false);
|
||||
if (!multiLine && statements.length > 0) {
|
||||
multiLine = true;
|
||||
statementOffset = ts.addStandardPrologue(leadingStatements, body.statements, false);
|
||||
}
|
||||
addCaptureThisForNodeIfNeeded(leadingStatements, node);
|
||||
addDefaultValueAssignmentsIfNeeded(leadingStatements, node);
|
||||
addRestParameterIfNeeded(leadingStatements, node, false);
|
||||
if (ts.isBlock(body)) {
|
||||
statementOffset = ts.addCustomPrologue(statements, body.statements, statementOffset, visitor);
|
||||
statementOffset = ts.addCustomPrologue(leadingStatements, body.statements, statementOffset, visitor);
|
||||
statementsLocation = body.statements;
|
||||
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, statementOffset));
|
||||
if (!multiLine && body.multiLine) {
|
||||
@ -52692,10 +52768,10 @@ var ts;
|
||||
var lexicalEnvironment = context.endLexicalEnvironment();
|
||||
ts.prependStatements(statements, lexicalEnvironment);
|
||||
prependCaptureNewTargetIfNeeded(statements, node, false);
|
||||
if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) {
|
||||
if (ts.some(leadingStatements) || ts.some(lexicalEnvironment)) {
|
||||
multiLine = true;
|
||||
}
|
||||
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), multiLine);
|
||||
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(leadingStatements.concat(statements)), statementsLocation), multiLine);
|
||||
ts.setTextRange(block, node.body);
|
||||
if (!multiLine && singleLine) {
|
||||
ts.setEmitFlags(block, 1);
|
||||
@ -55488,7 +55564,7 @@ var ts;
|
||||
name: "typescript:generator",
|
||||
scoped: false,
|
||||
priority: 6,
|
||||
text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
|
||||
text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
|
||||
};
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
@ -58964,7 +59040,7 @@ var ts;
|
||||
return currentSource.skipTrivia ? currentSource.skipTrivia(pos) : ts.skipTrivia(currentSourceText, pos);
|
||||
}
|
||||
function initialize(filePath, sourceMapFilePath, sourceFileOrBundle, outputSourceMapDataList) {
|
||||
if (disabled) {
|
||||
if (disabled || ts.fileExtensionIs(filePath, ".json")) {
|
||||
return;
|
||||
}
|
||||
if (sourceMapData) {
|
||||
@ -59055,7 +59131,7 @@ var ts;
|
||||
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
|
||||
}
|
||||
function emitPos(pos) {
|
||||
if (disabled || ts.positionIsSynthesized(pos)) {
|
||||
if (disabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(currentSource)) {
|
||||
return;
|
||||
}
|
||||
if (extendedDiagnostics) {
|
||||
@ -59092,7 +59168,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function emitNodeWithSourceMap(hint, node, emitCallback) {
|
||||
if (disabled) {
|
||||
if (disabled || ts.isInJsonFile(node)) {
|
||||
return emitCallback(hint, node);
|
||||
}
|
||||
if (node) {
|
||||
@ -59133,7 +59209,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {
|
||||
if (disabled) {
|
||||
if (disabled || ts.isInJsonFile(node)) {
|
||||
return emitCallback(token, writer, tokenPos);
|
||||
}
|
||||
var emitNode = node && node.emitNode;
|
||||
@ -59151,12 +59227,18 @@ var ts;
|
||||
}
|
||||
return tokenPos;
|
||||
}
|
||||
function isJsonSourceMapSource(sourceFile) {
|
||||
return ts.fileExtensionIs(sourceFile.fileName, ".json");
|
||||
}
|
||||
function setSourceFile(sourceFile) {
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
currentSource = sourceFile;
|
||||
currentSourceText = currentSource.text;
|
||||
if (isJsonSourceMapSource(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
|
||||
var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true);
|
||||
sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source);
|
||||
@ -59170,7 +59252,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function getText() {
|
||||
if (disabled) {
|
||||
if (disabled || isJsonSourceMapSource(currentSource)) {
|
||||
return;
|
||||
}
|
||||
encodeLastRecordedSourceMapSpan();
|
||||
@ -59185,7 +59267,7 @@ var ts;
|
||||
});
|
||||
}
|
||||
function getSourceMappingURL() {
|
||||
if (disabled) {
|
||||
if (disabled || isJsonSourceMapSource(currentSource)) {
|
||||
return;
|
||||
}
|
||||
if (compilerOptions.inlineSourceMap) {
|
||||
@ -59597,7 +59679,7 @@ var ts;
|
||||
}
|
||||
else {
|
||||
var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options));
|
||||
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
|
||||
var sourceMapFilePath = ts.isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options);
|
||||
var isJs = ts.isSourceFileJavaScript(sourceFile);
|
||||
var declarationFilePath = ((forceDtsPaths || options.declaration) && !isJs) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
|
||||
var declarationMapPath = ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
|
||||
@ -60734,7 +60816,7 @@ var ts;
|
||||
increaseIndent();
|
||||
}
|
||||
var preferNewLine = node.multiLine ? 32768 : 0;
|
||||
var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0;
|
||||
var allowTrailingComma = currentSourceFile.languageVersion >= 1 && !ts.isJsonSourceFile(currentSourceFile) ? 32 : 0;
|
||||
emitList(node, node.properties, 263122 | allowTrailingComma | preferNewLine);
|
||||
if (indentedFlag) {
|
||||
decreaseIndent();
|
||||
@ -64120,11 +64202,9 @@ var ts;
|
||||
else if (ts.isLiteralImportTypeNode(node)) {
|
||||
imports = ts.append(imports, node.argument.literal);
|
||||
}
|
||||
else {
|
||||
collectDynamicImportOrRequireCallsForEachChild(node);
|
||||
if (ts.hasJSDocNodes(node)) {
|
||||
ts.forEach(node.jsDoc, collectDynamicImportOrRequireCallsForEachChild);
|
||||
}
|
||||
collectDynamicImportOrRequireCallsForEachChild(node);
|
||||
if (ts.hasJSDocNodes(node)) {
|
||||
ts.forEach(node.jsDoc, collectDynamicImportOrRequireCallsForEachChild);
|
||||
}
|
||||
}
|
||||
function collectDynamicImportOrRequireCallsForEachChild(node) {
|
||||
@ -65609,8 +65689,20 @@ var ts;
|
||||
function isNodeModulesAtTypesDirectory(dirPath) {
|
||||
return ts.endsWith(dirPath, "/node_modules/@types");
|
||||
}
|
||||
function isDirectoryAtleastAtLevelFromFSRoot(dirPath, minLevels) {
|
||||
for (var searchIndex = ts.getRootLength(dirPath); minLevels > 0; minLevels--) {
|
||||
function canWatchDirectory(dirPath) {
|
||||
var rootLength = ts.getRootLength(dirPath);
|
||||
if (dirPath.length === rootLength) {
|
||||
return false;
|
||||
}
|
||||
var nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, rootLength);
|
||||
if (nextDirectorySeparator === -1) {
|
||||
return false;
|
||||
}
|
||||
if (dirPath.charCodeAt(0) !== 47 &&
|
||||
dirPath.substr(rootLength, nextDirectorySeparator).search(/users/i) === -1) {
|
||||
return true;
|
||||
}
|
||||
for (var searchIndex = nextDirectorySeparator + 1, searchLevels = 2; searchLevels > 0; searchLevels--) {
|
||||
searchIndex = dirPath.indexOf(ts.directorySeparator, searchIndex) + 1;
|
||||
if (searchIndex === 0) {
|
||||
return false;
|
||||
@ -65618,9 +65710,6 @@ var ts;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function canWatchDirectory(dirPath) {
|
||||
return isDirectoryAtleastAtLevelFromFSRoot(dirPath, dirPath.charCodeAt(0) === 47 ? 3 : 1);
|
||||
}
|
||||
function filterFSRootDirectoriesToWatch(watchPath, dirPath) {
|
||||
if (!canWatchDirectory(dirPath)) {
|
||||
watchPath.ignore = true;
|
||||
@ -67422,6 +67511,7 @@ var ts;
|
||||
}
|
||||
return optionNameMap.get(optionName);
|
||||
}
|
||||
ts.getOptionFromName = getOptionFromName;
|
||||
function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) {
|
||||
var configFileText;
|
||||
try {
|
||||
|
||||
981
lib/tsserver.js
981
lib/tsserver.js
File diff suppressed because it is too large
Load Diff
18
lib/tsserverlibrary.d.ts
vendored
18
lib/tsserverlibrary.d.ts
vendored
@ -714,10 +714,14 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ThisType;
|
||||
}
|
||||
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
|
||||
interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
|
||||
kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.FunctionType;
|
||||
}
|
||||
interface ConstructorTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.ConstructorType;
|
||||
}
|
||||
interface NodeWithTypeArguments extends TypeNode {
|
||||
@ -4154,18 +4158,18 @@ declare namespace ts {
|
||||
* Create the builder to manage semantic diagnostics and cache them
|
||||
*/
|
||||
function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Create the builder that can handle the changes in program and iterate through changed files
|
||||
* to emit the those files and manage semantic diagnostics cache as well
|
||||
*/
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Creates a builder thats just abstraction over program and can be used with watch
|
||||
*/
|
||||
function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
}
|
||||
declare namespace ts {
|
||||
type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void;
|
||||
@ -4564,7 +4568,7 @@ declare namespace ts {
|
||||
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
||||
organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
@ -8519,9 +8523,7 @@ declare namespace ts.server {
|
||||
private mapCodeAction;
|
||||
private mapCodeFixAction;
|
||||
private mapTextChangesToCodeEdits;
|
||||
private mapTextChangesToCodeEditsUsingScriptinfo;
|
||||
private convertTextChangeToCodeEdit;
|
||||
private convertNewFileTextChangeToCodeEdit;
|
||||
private getBraceMatching;
|
||||
private getDiagnosticsForProject;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
16
lib/typescript.d.ts
vendored
16
lib/typescript.d.ts
vendored
@ -714,10 +714,14 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ThisType;
|
||||
}
|
||||
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
|
||||
interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
|
||||
kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.FunctionType;
|
||||
}
|
||||
interface ConstructorTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.ConstructorType;
|
||||
}
|
||||
interface NodeWithTypeArguments extends TypeNode {
|
||||
@ -4154,18 +4158,18 @@ declare namespace ts {
|
||||
* Create the builder to manage semantic diagnostics and cache them
|
||||
*/
|
||||
function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Create the builder that can handle the changes in program and iterate through changed files
|
||||
* to emit the those files and manage semantic diagnostics cache as well
|
||||
*/
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Creates a builder thats just abstraction over program and can be used with watch
|
||||
*/
|
||||
function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
}
|
||||
declare namespace ts {
|
||||
type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void;
|
||||
@ -4564,7 +4568,7 @@ declare namespace ts {
|
||||
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
||||
organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
16
lib/typescriptServices.d.ts
vendored
16
lib/typescriptServices.d.ts
vendored
@ -714,10 +714,14 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ThisType;
|
||||
}
|
||||
type FunctionOrConstructorTypeNode = FunctionTypeNode | ConstructorTypeNode;
|
||||
interface FunctionTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface FunctionOrConstructorTypeNodeBase extends TypeNode, SignatureDeclarationBase {
|
||||
kind: SyntaxKind.FunctionType | SyntaxKind.ConstructorType;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.FunctionType;
|
||||
}
|
||||
interface ConstructorTypeNode extends TypeNode, SignatureDeclarationBase {
|
||||
interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase {
|
||||
kind: SyntaxKind.ConstructorType;
|
||||
}
|
||||
interface NodeWithTypeArguments extends TypeNode {
|
||||
@ -4154,18 +4158,18 @@ declare namespace ts {
|
||||
* Create the builder to manage semantic diagnostics and cache them
|
||||
*/
|
||||
function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): SemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Create the builder that can handle the changes in program and iterate through changed files
|
||||
* to emit the those files and manage semantic diagnostics cache as well
|
||||
*/
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): EmitAndSemanticDiagnosticsBuilderProgram;
|
||||
/**
|
||||
* Creates a builder thats just abstraction over program and can be used with watch
|
||||
*/
|
||||
function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string>, options: CompilerOptions, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
function createAbstractBuilder(rootNames: ReadonlyArray<string> | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>): BuilderProgram;
|
||||
}
|
||||
declare namespace ts {
|
||||
type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void;
|
||||
@ -4564,7 +4568,7 @@ declare namespace ts {
|
||||
getApplicableRefactors(fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | undefined): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | undefined): RefactorEditInfo | undefined;
|
||||
organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings): ReadonlyArray<FileTextChanges>;
|
||||
getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray<FileTextChanges>;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -180,7 +180,7 @@ var ts;
|
||||
var ts;
|
||||
(function (ts) {
|
||||
ts.versionMajorMinor = "2.9";
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
function isExternalModuleNameRelative(moduleName) {
|
||||
@ -2130,6 +2130,23 @@ var ts;
|
||||
return startsWith(str, prefix) ? str.substr(prefix.length) : str;
|
||||
}
|
||||
ts.removePrefix = removePrefix;
|
||||
function tryRemovePrefix(str, prefix) {
|
||||
return startsWith(str, prefix) ? str.substring(prefix.length) : undefined;
|
||||
}
|
||||
ts.tryRemovePrefix = tryRemovePrefix;
|
||||
function tryRemoveDirectoryPrefix(path, dirPath) {
|
||||
var a = tryRemovePrefix(path, dirPath);
|
||||
if (a === undefined)
|
||||
return undefined;
|
||||
switch (a.charCodeAt(0)) {
|
||||
case 47:
|
||||
case 92:
|
||||
return a.slice(1);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
ts.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix;
|
||||
function endsWith(str, suffix) {
|
||||
var expectedPos = str.length - suffix.length;
|
||||
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
||||
@ -2139,6 +2156,10 @@ var ts;
|
||||
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
|
||||
}
|
||||
ts.removeSuffix = removeSuffix;
|
||||
function tryRemoveSuffix(str, suffix) {
|
||||
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : undefined;
|
||||
}
|
||||
ts.tryRemoveSuffix = tryRemoveSuffix;
|
||||
function stringContains(str, substring) {
|
||||
return str.indexOf(substring) !== -1;
|
||||
}
|
||||
@ -2278,14 +2299,17 @@ var ts;
|
||||
};
|
||||
}
|
||||
ts.getFileMatcherPatterns = getFileMatcherPatterns;
|
||||
function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
|
||||
return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
|
||||
}
|
||||
ts.getRegexFromPattern = getRegexFromPattern;
|
||||
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
|
||||
path = normalizePath(path);
|
||||
currentDirectory = normalizePath(currentDirectory);
|
||||
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
|
||||
var regexFlag = useCaseSensitiveFileNames ? "" : "i";
|
||||
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); });
|
||||
var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
|
||||
var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag);
|
||||
var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
|
||||
var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
|
||||
var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
|
||||
var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];
|
||||
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
|
||||
var basePath = _a[_i];
|
||||
@ -5237,11 +5261,6 @@ var ts;
|
||||
return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);
|
||||
}
|
||||
ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile;
|
||||
function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) {
|
||||
var start = ts.skipTrivia(sourceFile.text, startNode.pos);
|
||||
return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3);
|
||||
}
|
||||
ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan;
|
||||
function createDiagnosticForNodeFromMessageChain(node, messageChain) {
|
||||
var sourceFile = getSourceFileOfNode(node);
|
||||
var span = getErrorSpanForNode(sourceFile, node);
|
||||
@ -5632,7 +5651,7 @@ var ts;
|
||||
}
|
||||
ts.isThisTypePredicate = isThisTypePredicate;
|
||||
function getPropertyAssignment(objectLiteral, key, key2) {
|
||||
return ts.filter(objectLiteral.properties, function (property) {
|
||||
return objectLiteral.properties.filter(function (property) {
|
||||
if (property.kind === 269) {
|
||||
var propName = getTextOfPropertyName(property.name);
|
||||
return key === propName || (key2 && key2 === propName);
|
||||
@ -5648,15 +5667,18 @@ var ts;
|
||||
}
|
||||
ts.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression;
|
||||
function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {
|
||||
var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
|
||||
return jsonObjectLiteral &&
|
||||
ts.firstDefined(getPropertyAssignment(jsonObjectLiteral, propKey), function (property) {
|
||||
return ts.isArrayLiteralExpression(property.initializer) ?
|
||||
ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
|
||||
undefined;
|
||||
});
|
||||
return ts.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function (property) {
|
||||
return ts.isArrayLiteralExpression(property.initializer) ?
|
||||
ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
|
||||
undefined;
|
||||
});
|
||||
}
|
||||
ts.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue;
|
||||
function getTsConfigPropArray(tsConfigSourceFile, propKey) {
|
||||
var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
|
||||
return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts.emptyArray;
|
||||
}
|
||||
ts.getTsConfigPropArray = getTsConfigPropArray;
|
||||
function getContainingFunction(node) {
|
||||
return ts.findAncestor(node.parent, ts.isFunctionLike);
|
||||
}
|
||||
@ -12292,6 +12314,7 @@ var ts;
|
||||
if (languageVersion === void 0) { languageVersion = 2; }
|
||||
initializeState(sourceText, languageVersion, syntaxCursor, 6);
|
||||
sourceFile = createSourceFile(fileName, 2, 6, false);
|
||||
sourceFile.flags = contextFlags;
|
||||
nextToken();
|
||||
var pos = getNodePos();
|
||||
if (token() === 1) {
|
||||
@ -12672,8 +12695,8 @@ var ts;
|
||||
kind === 71 ? new IdentifierConstructor(kind, p, p) :
|
||||
new TokenConstructor(kind, p, p);
|
||||
}
|
||||
function createNodeWithJSDoc(kind) {
|
||||
var node = createNode(kind);
|
||||
function createNodeWithJSDoc(kind, pos) {
|
||||
var node = createNode(kind, pos);
|
||||
if (scanner.getTokenFlags() & 2) {
|
||||
addJSDocComment(node);
|
||||
}
|
||||
@ -13340,6 +13363,21 @@ var ts;
|
||||
}
|
||||
return finishNode(node);
|
||||
}
|
||||
function typeHasArrowFunctionBlockingParseError(node) {
|
||||
switch (node.kind) {
|
||||
case 161:
|
||||
return ts.nodeIsMissing(node.typeName);
|
||||
case 162:
|
||||
case 163: {
|
||||
var _a = node, parameters = _a.parameters, type = _a.type;
|
||||
return parameters.pos === parameters.end || typeHasArrowFunctionBlockingParseError(type);
|
||||
}
|
||||
case 172:
|
||||
return typeHasArrowFunctionBlockingParseError(node.type);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function parseThisTypePredicate(lhs) {
|
||||
nextToken();
|
||||
var node = createNode(160, lhs.pos);
|
||||
@ -13482,12 +13520,13 @@ var ts;
|
||||
if (!(flags & 32)) {
|
||||
signature.typeParameters = parseTypeParameters();
|
||||
}
|
||||
signature.parameters = parseParameterList(flags);
|
||||
var parametersParsedSuccessfully = parseParameterList(signature, flags);
|
||||
if (shouldParseReturnType(returnToken, !!(flags & 4))) {
|
||||
signature.type = parseTypeOrTypePredicate();
|
||||
return signature.type !== undefined;
|
||||
if (typeHasArrowFunctionBlockingParseError(signature.type))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return parametersParsedSuccessfully;
|
||||
}
|
||||
function shouldParseReturnType(returnToken, isType) {
|
||||
if (returnToken === 36) {
|
||||
@ -13504,21 +13543,19 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function parseParameterList(flags) {
|
||||
if (parseExpected(19)) {
|
||||
var savedYieldContext = inYieldContext();
|
||||
var savedAwaitContext = inAwaitContext();
|
||||
setYieldContext(!!(flags & 1));
|
||||
setAwaitContext(!!(flags & 2));
|
||||
var result = parseDelimitedList(16, flags & 32 ? parseJSDocParameter : parseParameter);
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
if (!parseExpected(20) && (flags & 8)) {
|
||||
return undefined;
|
||||
}
|
||||
return result;
|
||||
function parseParameterList(signature, flags) {
|
||||
if (!parseExpected(19)) {
|
||||
signature.parameters = createMissingList();
|
||||
return false;
|
||||
}
|
||||
return (flags & 8) ? undefined : createMissingList();
|
||||
var savedYieldContext = inYieldContext();
|
||||
var savedAwaitContext = inAwaitContext();
|
||||
setYieldContext(!!(flags & 1));
|
||||
setAwaitContext(!!(flags & 2));
|
||||
signature.parameters = parseDelimitedList(16, flags & 32 ? parseJSDocParameter : parseParameter);
|
||||
setYieldContext(savedYieldContext);
|
||||
setAwaitContext(savedAwaitContext);
|
||||
return parseExpected(20);
|
||||
}
|
||||
function parseTypeMemberSemicolon() {
|
||||
if (parseOptional(26)) {
|
||||
@ -13709,23 +13746,14 @@ var ts;
|
||||
var node = createNode(172);
|
||||
parseExpected(19);
|
||||
node.type = parseType();
|
||||
if (!node.type) {
|
||||
return undefined;
|
||||
}
|
||||
parseExpected(20);
|
||||
return finishNode(node);
|
||||
}
|
||||
function parseFunctionOrConstructorType(kind) {
|
||||
var node = createNodeWithJSDoc(kind);
|
||||
if (kind === 163) {
|
||||
parseExpected(94);
|
||||
}
|
||||
if (!fillSignature(36, 4 | (sourceFile.languageVariant === 1 ? 8 : 0), node)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.parameters) {
|
||||
return undefined;
|
||||
}
|
||||
function parseFunctionOrConstructorType() {
|
||||
var pos = getNodePos();
|
||||
var kind = parseOptional(94) ? 163 : 162;
|
||||
var node = createNodeWithJSDoc(kind, pos);
|
||||
fillSignature(36, 4, node);
|
||||
return finishNode(node);
|
||||
}
|
||||
function parseKeywordAndNoDot() {
|
||||
@ -14024,11 +14052,8 @@ var ts;
|
||||
return doOutsideOfContext(20480, parseTypeWorker);
|
||||
}
|
||||
function parseTypeWorker(noConditionalTypes) {
|
||||
if (isStartOfFunctionType()) {
|
||||
return parseFunctionOrConstructorType(162);
|
||||
}
|
||||
if (token() === 94) {
|
||||
return parseFunctionOrConstructorType(163);
|
||||
if (isStartOfFunctionType() || token() === 94) {
|
||||
return parseFunctionOrConstructorType();
|
||||
}
|
||||
var type = parseUnionTypeOrHigher();
|
||||
if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) {
|
||||
@ -14325,10 +14350,7 @@ var ts;
|
||||
var node = createNodeWithJSDoc(192);
|
||||
node.modifiers = parseModifiersForArrowFunction();
|
||||
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
|
||||
if (!fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!node.parameters) {
|
||||
if (!fillSignature(56, isAsync, node) && !allowAmbiguity) {
|
||||
return undefined;
|
||||
}
|
||||
if (!allowAmbiguity && token() !== 36 && token() !== 17) {
|
||||
@ -18305,6 +18327,7 @@ var ts;
|
||||
}
|
||||
return optionNameMap.get(optionName);
|
||||
}
|
||||
ts.getOptionFromName = getOptionFromName;
|
||||
function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) {
|
||||
var configFileText;
|
||||
try {
|
||||
@ -20373,7 +20396,8 @@ var ts;
|
||||
addInferredTypings(module_1, "Inferred typings from unresolved imports");
|
||||
}
|
||||
packageNameToTypingLocation.forEach(function (typing, name) {
|
||||
if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) {
|
||||
var registryEntry = typesRegistry.get(name);
|
||||
if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && registryEntry !== undefined && isTypingUpToDate(typing, registryEntry)) {
|
||||
inferredTypings.set(name, typing.typingLocation);
|
||||
}
|
||||
});
|
||||
@ -20631,6 +20655,7 @@ var ts;
|
||||
this.pendingRunRequests = [];
|
||||
this.installRunCount = 1;
|
||||
this.inFlightRequestCount = 0;
|
||||
this.latestDistTag = "latest";
|
||||
this.toCanonicalFileName = ts.createGetCanonicalFileName(installTypingHost.useCaseSensitiveFileNames);
|
||||
this.globalCacheCanonicalPackageJsonPath = ts.combinePaths(this.toCanonicalFileName(globalCachePath), "package.json");
|
||||
if (this.log.isEnabled()) {
|
||||
@ -20848,7 +20873,7 @@ var ts;
|
||||
continue;
|
||||
}
|
||||
var distTags = _this.typesRegistry.get(packageName);
|
||||
var newVersion = ts.Semver.parse(distTags["ts" + ts.versionMajorMinor] || distTags[latestDistTag]);
|
||||
var newVersion = ts.Semver.parse(distTags["ts" + ts.versionMajorMinor] || distTags[_this.latestDistTag]);
|
||||
var newTyping = { typingLocation: typingFile, version: newVersion };
|
||||
_this.packageNameToTypingLocation.set(packageName, newTyping);
|
||||
installedTypingFiles.push(typingFile);
|
||||
@ -21007,7 +21032,6 @@ var ts;
|
||||
return "@types/" + packageName + "@ts" + ts.versionMajorMinor;
|
||||
}
|
||||
typingsInstaller.typingsName = typingsName;
|
||||
var latestDistTag = "latest";
|
||||
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|
||||
})(server = ts.server || (ts.server = {}));
|
||||
})(ts || (ts = {}));
|
||||
@ -21086,7 +21110,7 @@ var ts;
|
||||
if (_this.log.isEnabled()) {
|
||||
_this.log.writeLine("Updating " + typesRegistryPackageName + " npm package...");
|
||||
}
|
||||
_this.execSyncAndLog(_this.npmPath + " install --ignore-scripts " + typesRegistryPackageName, { cwd: globalTypingsCacheLocation });
|
||||
_this.execSyncAndLog(_this.npmPath + " install --ignore-scripts " + typesRegistryPackageName + "@" + _this.latestDistTag, { cwd: globalTypingsCacheLocation });
|
||||
if (_this.log.isEnabled()) {
|
||||
_this.log.writeLine("Updated " + typesRegistryPackageName + " npm package");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user