mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update LKG
This commit is contained in:
1 parent
6d6f3b1ae6
commit
8ae5b5fe20
7 files changed
+322
-223
No files matched your search
Vendored
-2
@@ -32,7 +32,6 @@ interface MapConstructor {
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
@@ -64,7 +63,6 @@ declare var Set: SetConstructor;
|
||||
|
||||
interface WeakSet<T> {
|
||||
add(value: T): this;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
Vendored
-2
@@ -4672,7 +4672,6 @@ interface MapConstructor {
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
@@ -4704,7 +4703,6 @@ declare var Set: SetConstructor;
|
||||
|
||||
interface WeakSet<T> {
|
||||
add(value: T): this;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
+30
-11
@@ -13316,6 +13316,7 @@ var ts;
|
||||
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
|
||||
var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false);
|
||||
var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, true);
|
||||
var globals = ts.createMap();
|
||||
var patternAmbientModules;
|
||||
@@ -15483,7 +15484,9 @@ var ts;
|
||||
if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) {
|
||||
type = getTypeWithFacts(type, 131072);
|
||||
}
|
||||
return type;
|
||||
return declaration.initializer ?
|
||||
getUnionType([type, checkExpressionCached(declaration.initializer)], true) :
|
||||
type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) {
|
||||
var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
@@ -20336,13 +20339,14 @@ var ts;
|
||||
var isParameter = ts.getRootDeclaration(declaration).kind === 142;
|
||||
var declarationContainer = getControlFlowContainer(declaration);
|
||||
var flowContainer = getControlFlowContainer(node);
|
||||
var isOuterVariable = flowContainer !== declarationContainer;
|
||||
while (flowContainer !== declarationContainer &&
|
||||
(flowContainer.kind === 179 || flowContainer.kind === 180) &&
|
||||
(isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
|
||||
flowContainer = getControlFlowContainer(flowContainer);
|
||||
}
|
||||
var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter ||
|
||||
flowContainer !== declarationContainer || ts.isInAmbientContext(declaration);
|
||||
isOuterVariable || ts.isInAmbientContext(declaration);
|
||||
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
|
||||
if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
|
||||
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
||||
@@ -22572,16 +22576,16 @@ var ts;
|
||||
function getResolvedSignature(node, candidatesOutArray) {
|
||||
var links = getNodeLinks(node);
|
||||
var cached = links.resolvedSignature;
|
||||
if (cached && cached !== anySignature && !candidatesOutArray) {
|
||||
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
|
||||
return cached;
|
||||
}
|
||||
links.resolvedSignature = anySignature;
|
||||
links.resolvedSignature = resolvingSignature;
|
||||
var result = resolveSignature(node, candidatesOutArray);
|
||||
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
|
||||
return result;
|
||||
}
|
||||
function getResolvedOrAnySignature(node) {
|
||||
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
|
||||
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
|
||||
}
|
||||
function getInferredClassType(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
@@ -23533,7 +23537,7 @@ var ts;
|
||||
return maybeTypeOfKind(contextualType, (64 | 256));
|
||||
}
|
||||
if (type.flags & 8) {
|
||||
return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, 128);
|
||||
}
|
||||
if (type.flags & 16) {
|
||||
return typeContainsLiteralFromEnum(contextualType, type);
|
||||
@@ -36535,7 +36539,6 @@ var ts;
|
||||
(function (ts) {
|
||||
ts.version = "2.0.2";
|
||||
var emptyArray = [];
|
||||
var defaultTypeRoots = ["node_modules/@types"];
|
||||
function findConfigFile(searchPath, fileExists) {
|
||||
while (true) {
|
||||
var fileName = ts.combinePaths(searchPath, "tsconfig.json");
|
||||
@@ -36668,11 +36671,27 @@ var ts;
|
||||
else if (host.getCurrentDirectory) {
|
||||
currentDirectory = host.getCurrentDirectory();
|
||||
}
|
||||
if (!currentDirectory) {
|
||||
return undefined;
|
||||
}
|
||||
return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); });
|
||||
return currentDirectory && getDefaultTypeRoots(currentDirectory, host);
|
||||
}
|
||||
function getDefaultTypeRoots(currentDirectory, host) {
|
||||
if (!host.directoryExists) {
|
||||
return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
|
||||
}
|
||||
var typeRoots;
|
||||
while (true) {
|
||||
var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
|
||||
if (host.directoryExists(atTypes)) {
|
||||
(typeRoots || (typeRoots = [])).push(atTypes);
|
||||
}
|
||||
var parent_15 = ts.getDirectoryPath(currentDirectory);
|
||||
if (parent_15 === currentDirectory) {
|
||||
break;
|
||||
}
|
||||
currentDirectory = parent_15;
|
||||
}
|
||||
return typeRoots;
|
||||
}
|
||||
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) {
|
||||
var traceEnabled = isTraceEnabled(options, host);
|
||||
var moduleResolutionState = {
|
||||
|
||||
+71
-52
@@ -14312,6 +14312,7 @@ var ts;
|
||||
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
|
||||
var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false);
|
||||
var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, true);
|
||||
var globals = ts.createMap();
|
||||
var patternAmbientModules;
|
||||
@@ -16479,7 +16480,9 @@ var ts;
|
||||
if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) {
|
||||
type = getTypeWithFacts(type, 131072);
|
||||
}
|
||||
return type;
|
||||
return declaration.initializer ?
|
||||
getUnionType([type, checkExpressionCached(declaration.initializer)], true) :
|
||||
type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) {
|
||||
var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
@@ -21332,13 +21335,14 @@ var ts;
|
||||
var isParameter = ts.getRootDeclaration(declaration).kind === 142;
|
||||
var declarationContainer = getControlFlowContainer(declaration);
|
||||
var flowContainer = getControlFlowContainer(node);
|
||||
var isOuterVariable = flowContainer !== declarationContainer;
|
||||
while (flowContainer !== declarationContainer &&
|
||||
(flowContainer.kind === 179 || flowContainer.kind === 180) &&
|
||||
(isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
|
||||
flowContainer = getControlFlowContainer(flowContainer);
|
||||
}
|
||||
var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter ||
|
||||
flowContainer !== declarationContainer || ts.isInAmbientContext(declaration);
|
||||
isOuterVariable || ts.isInAmbientContext(declaration);
|
||||
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
|
||||
if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
|
||||
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
||||
@@ -23568,16 +23572,16 @@ var ts;
|
||||
function getResolvedSignature(node, candidatesOutArray) {
|
||||
var links = getNodeLinks(node);
|
||||
var cached = links.resolvedSignature;
|
||||
if (cached && cached !== anySignature && !candidatesOutArray) {
|
||||
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
|
||||
return cached;
|
||||
}
|
||||
links.resolvedSignature = anySignature;
|
||||
links.resolvedSignature = resolvingSignature;
|
||||
var result = resolveSignature(node, candidatesOutArray);
|
||||
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
|
||||
return result;
|
||||
}
|
||||
function getResolvedOrAnySignature(node) {
|
||||
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
|
||||
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
|
||||
}
|
||||
function getInferredClassType(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
@@ -24529,7 +24533,7 @@ var ts;
|
||||
return maybeTypeOfKind(contextualType, (64 | 256));
|
||||
}
|
||||
if (type.flags & 8) {
|
||||
return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, 128);
|
||||
}
|
||||
if (type.flags & 16) {
|
||||
return typeContainsLiteralFromEnum(contextualType, type);
|
||||
@@ -37531,7 +37535,6 @@ var ts;
|
||||
(function (ts) {
|
||||
ts.version = "2.0.2";
|
||||
var emptyArray = [];
|
||||
var defaultTypeRoots = ["node_modules/@types"];
|
||||
function findConfigFile(searchPath, fileExists) {
|
||||
while (true) {
|
||||
var fileName = ts.combinePaths(searchPath, "tsconfig.json");
|
||||
@@ -37664,11 +37667,27 @@ var ts;
|
||||
else if (host.getCurrentDirectory) {
|
||||
currentDirectory = host.getCurrentDirectory();
|
||||
}
|
||||
if (!currentDirectory) {
|
||||
return undefined;
|
||||
}
|
||||
return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); });
|
||||
return currentDirectory && getDefaultTypeRoots(currentDirectory, host);
|
||||
}
|
||||
function getDefaultTypeRoots(currentDirectory, host) {
|
||||
if (!host.directoryExists) {
|
||||
return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
|
||||
}
|
||||
var typeRoots;
|
||||
while (true) {
|
||||
var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
|
||||
if (host.directoryExists(atTypes)) {
|
||||
(typeRoots || (typeRoots = [])).push(atTypes);
|
||||
}
|
||||
var parent_15 = ts.getDirectoryPath(currentDirectory);
|
||||
if (parent_15 === currentDirectory) {
|
||||
break;
|
||||
}
|
||||
currentDirectory = parent_15;
|
||||
}
|
||||
return typeRoots;
|
||||
}
|
||||
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) {
|
||||
var traceEnabled = isTraceEnabled(options, host);
|
||||
var moduleResolutionState = {
|
||||
@@ -39877,24 +39896,24 @@ var ts;
|
||||
switch (n.kind) {
|
||||
case 199:
|
||||
if (!ts.isFunctionBlock(n)) {
|
||||
var parent_15 = n.parent;
|
||||
var parent_16 = n.parent;
|
||||
var openBrace = ts.findChildOfKind(n, 15, sourceFile);
|
||||
var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
|
||||
if (parent_15.kind === 204 ||
|
||||
parent_15.kind === 207 ||
|
||||
parent_15.kind === 208 ||
|
||||
parent_15.kind === 206 ||
|
||||
parent_15.kind === 203 ||
|
||||
parent_15.kind === 205 ||
|
||||
parent_15.kind === 212 ||
|
||||
parent_15.kind === 252) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
if (parent_16.kind === 204 ||
|
||||
parent_16.kind === 207 ||
|
||||
parent_16.kind === 208 ||
|
||||
parent_16.kind === 206 ||
|
||||
parent_16.kind === 203 ||
|
||||
parent_16.kind === 205 ||
|
||||
parent_16.kind === 212 ||
|
||||
parent_16.kind === 252) {
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
if (parent_15.kind === 216) {
|
||||
var tryStatement = parent_15;
|
||||
if (parent_16.kind === 216) {
|
||||
var tryStatement = parent_16;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
@@ -45512,8 +45531,8 @@ var ts;
|
||||
if (declaration.kind !== 218 && declaration.kind !== 220) {
|
||||
return false;
|
||||
}
|
||||
for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) {
|
||||
if (parent_16.kind === 256 || parent_16.kind === 226) {
|
||||
for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) {
|
||||
if (parent_17.kind === 256 || parent_17.kind === 226) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -46642,13 +46661,13 @@ var ts;
|
||||
log("Returning an empty list because completion was requested in an invalid position.");
|
||||
return undefined;
|
||||
}
|
||||
var parent_17 = contextToken.parent, kind = contextToken.kind;
|
||||
var parent_18 = contextToken.parent, kind = contextToken.kind;
|
||||
if (kind === 21) {
|
||||
if (parent_17.kind === 172) {
|
||||
if (parent_18.kind === 172) {
|
||||
node = contextToken.parent.expression;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else if (parent_17.kind === 139) {
|
||||
else if (parent_18.kind === 139) {
|
||||
node = contextToken.parent.left;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
@@ -46936,9 +46955,9 @@ var ts;
|
||||
switch (contextToken.kind) {
|
||||
case 15:
|
||||
case 24:
|
||||
var parent_18 = contextToken.parent;
|
||||
if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) {
|
||||
return parent_18;
|
||||
var parent_19 = contextToken.parent;
|
||||
if (parent_19 && (parent_19.kind === 171 || parent_19.kind === 167)) {
|
||||
return parent_19;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -46961,34 +46980,34 @@ var ts;
|
||||
}
|
||||
function tryGetContainingJsxElement(contextToken) {
|
||||
if (contextToken) {
|
||||
var parent_19 = contextToken.parent;
|
||||
var parent_20 = contextToken.parent;
|
||||
switch (contextToken.kind) {
|
||||
case 26:
|
||||
case 39:
|
||||
case 69:
|
||||
case 246:
|
||||
case 247:
|
||||
if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) {
|
||||
return parent_19;
|
||||
if (parent_20 && (parent_20.kind === 242 || parent_20.kind === 243)) {
|
||||
return parent_20;
|
||||
}
|
||||
else if (parent_19.kind === 246) {
|
||||
return parent_19.parent;
|
||||
else if (parent_20.kind === 246) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (parent_19 && ((parent_19.kind === 246) || (parent_19.kind === 247))) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && ((parent_20.kind === 246) || (parent_20.kind === 247))) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (parent_19 &&
|
||||
parent_19.kind === 248 &&
|
||||
parent_19.parent &&
|
||||
(parent_19.parent.kind === 246)) {
|
||||
return parent_19.parent.parent;
|
||||
if (parent_20 &&
|
||||
parent_20.kind === 248 &&
|
||||
parent_20.parent &&
|
||||
(parent_20.parent.kind === 246)) {
|
||||
return parent_20.parent.parent;
|
||||
}
|
||||
if (parent_19 && parent_19.kind === 247) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && parent_20.kind === 247) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -48228,17 +48247,17 @@ var ts;
|
||||
function getThrowStatementOwner(throwStatement) {
|
||||
var child = throwStatement;
|
||||
while (child.parent) {
|
||||
var parent_20 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) {
|
||||
return parent_20;
|
||||
var parent_21 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256) {
|
||||
return parent_21;
|
||||
}
|
||||
if (parent_20.kind === 216) {
|
||||
var tryStatement = parent_20;
|
||||
if (parent_21.kind === 216) {
|
||||
var tryStatement = parent_21;
|
||||
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
child = parent_20;
|
||||
child = parent_21;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+71
-52
@@ -14312,6 +14312,7 @@ var ts;
|
||||
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
|
||||
var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, undefined, 0, false, false);
|
||||
var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, true);
|
||||
var globals = ts.createMap();
|
||||
var patternAmbientModules;
|
||||
@@ -16479,7 +16480,9 @@ var ts;
|
||||
if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048)) {
|
||||
type = getTypeWithFacts(type, 131072);
|
||||
}
|
||||
return type;
|
||||
return declaration.initializer ?
|
||||
getUnionType([type, checkExpressionCached(declaration.initializer)], true) :
|
||||
type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) {
|
||||
var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
@@ -21332,13 +21335,14 @@ var ts;
|
||||
var isParameter = ts.getRootDeclaration(declaration).kind === 142;
|
||||
var declarationContainer = getControlFlowContainer(declaration);
|
||||
var flowContainer = getControlFlowContainer(node);
|
||||
var isOuterVariable = flowContainer !== declarationContainer;
|
||||
while (flowContainer !== declarationContainer &&
|
||||
(flowContainer.kind === 179 || flowContainer.kind === 180) &&
|
||||
(isReadonlySymbol(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
|
||||
flowContainer = getControlFlowContainer(flowContainer);
|
||||
}
|
||||
var assumeInitialized = !strictNullChecks || (type.flags & 1) !== 0 || isParameter ||
|
||||
flowContainer !== declarationContainer || ts.isInAmbientContext(declaration);
|
||||
isOuterVariable || ts.isInAmbientContext(declaration);
|
||||
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
|
||||
if (!assumeInitialized && !(getFalsyFlags(type) & 2048) && getFalsyFlags(flowType) & 2048) {
|
||||
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
|
||||
@@ -23568,16 +23572,16 @@ var ts;
|
||||
function getResolvedSignature(node, candidatesOutArray) {
|
||||
var links = getNodeLinks(node);
|
||||
var cached = links.resolvedSignature;
|
||||
if (cached && cached !== anySignature && !candidatesOutArray) {
|
||||
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
|
||||
return cached;
|
||||
}
|
||||
links.resolvedSignature = anySignature;
|
||||
links.resolvedSignature = resolvingSignature;
|
||||
var result = resolveSignature(node, candidatesOutArray);
|
||||
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
|
||||
return result;
|
||||
}
|
||||
function getResolvedOrAnySignature(node) {
|
||||
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
|
||||
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
|
||||
}
|
||||
function getInferredClassType(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
@@ -24529,7 +24533,7 @@ var ts;
|
||||
return maybeTypeOfKind(contextualType, (64 | 256));
|
||||
}
|
||||
if (type.flags & 8) {
|
||||
return maybeTypeOfKind(contextualType, 128) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, 128);
|
||||
}
|
||||
if (type.flags & 16) {
|
||||
return typeContainsLiteralFromEnum(contextualType, type);
|
||||
@@ -37531,7 +37535,6 @@ var ts;
|
||||
(function (ts) {
|
||||
ts.version = "2.0.2";
|
||||
var emptyArray = [];
|
||||
var defaultTypeRoots = ["node_modules/@types"];
|
||||
function findConfigFile(searchPath, fileExists) {
|
||||
while (true) {
|
||||
var fileName = ts.combinePaths(searchPath, "tsconfig.json");
|
||||
@@ -37664,11 +37667,27 @@ var ts;
|
||||
else if (host.getCurrentDirectory) {
|
||||
currentDirectory = host.getCurrentDirectory();
|
||||
}
|
||||
if (!currentDirectory) {
|
||||
return undefined;
|
||||
}
|
||||
return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); });
|
||||
return currentDirectory && getDefaultTypeRoots(currentDirectory, host);
|
||||
}
|
||||
function getDefaultTypeRoots(currentDirectory, host) {
|
||||
if (!host.directoryExists) {
|
||||
return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
|
||||
}
|
||||
var typeRoots;
|
||||
while (true) {
|
||||
var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
|
||||
if (host.directoryExists(atTypes)) {
|
||||
(typeRoots || (typeRoots = [])).push(atTypes);
|
||||
}
|
||||
var parent_15 = ts.getDirectoryPath(currentDirectory);
|
||||
if (parent_15 === currentDirectory) {
|
||||
break;
|
||||
}
|
||||
currentDirectory = parent_15;
|
||||
}
|
||||
return typeRoots;
|
||||
}
|
||||
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host) {
|
||||
var traceEnabled = isTraceEnabled(options, host);
|
||||
var moduleResolutionState = {
|
||||
@@ -39877,24 +39896,24 @@ var ts;
|
||||
switch (n.kind) {
|
||||
case 199:
|
||||
if (!ts.isFunctionBlock(n)) {
|
||||
var parent_15 = n.parent;
|
||||
var parent_16 = n.parent;
|
||||
var openBrace = ts.findChildOfKind(n, 15, sourceFile);
|
||||
var closeBrace = ts.findChildOfKind(n, 16, sourceFile);
|
||||
if (parent_15.kind === 204 ||
|
||||
parent_15.kind === 207 ||
|
||||
parent_15.kind === 208 ||
|
||||
parent_15.kind === 206 ||
|
||||
parent_15.kind === 203 ||
|
||||
parent_15.kind === 205 ||
|
||||
parent_15.kind === 212 ||
|
||||
parent_15.kind === 252) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
if (parent_16.kind === 204 ||
|
||||
parent_16.kind === 207 ||
|
||||
parent_16.kind === 208 ||
|
||||
parent_16.kind === 206 ||
|
||||
parent_16.kind === 203 ||
|
||||
parent_16.kind === 205 ||
|
||||
parent_16.kind === 212 ||
|
||||
parent_16.kind === 252) {
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
if (parent_15.kind === 216) {
|
||||
var tryStatement = parent_15;
|
||||
if (parent_16.kind === 216) {
|
||||
var tryStatement = parent_16;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
@@ -45512,8 +45531,8 @@ var ts;
|
||||
if (declaration.kind !== 218 && declaration.kind !== 220) {
|
||||
return false;
|
||||
}
|
||||
for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) {
|
||||
if (parent_16.kind === 256 || parent_16.kind === 226) {
|
||||
for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) {
|
||||
if (parent_17.kind === 256 || parent_17.kind === 226) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -46642,13 +46661,13 @@ var ts;
|
||||
log("Returning an empty list because completion was requested in an invalid position.");
|
||||
return undefined;
|
||||
}
|
||||
var parent_17 = contextToken.parent, kind = contextToken.kind;
|
||||
var parent_18 = contextToken.parent, kind = contextToken.kind;
|
||||
if (kind === 21) {
|
||||
if (parent_17.kind === 172) {
|
||||
if (parent_18.kind === 172) {
|
||||
node = contextToken.parent.expression;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else if (parent_17.kind === 139) {
|
||||
else if (parent_18.kind === 139) {
|
||||
node = contextToken.parent.left;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
@@ -46936,9 +46955,9 @@ var ts;
|
||||
switch (contextToken.kind) {
|
||||
case 15:
|
||||
case 24:
|
||||
var parent_18 = contextToken.parent;
|
||||
if (parent_18 && (parent_18.kind === 171 || parent_18.kind === 167)) {
|
||||
return parent_18;
|
||||
var parent_19 = contextToken.parent;
|
||||
if (parent_19 && (parent_19.kind === 171 || parent_19.kind === 167)) {
|
||||
return parent_19;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -46961,34 +46980,34 @@ var ts;
|
||||
}
|
||||
function tryGetContainingJsxElement(contextToken) {
|
||||
if (contextToken) {
|
||||
var parent_19 = contextToken.parent;
|
||||
var parent_20 = contextToken.parent;
|
||||
switch (contextToken.kind) {
|
||||
case 26:
|
||||
case 39:
|
||||
case 69:
|
||||
case 246:
|
||||
case 247:
|
||||
if (parent_19 && (parent_19.kind === 242 || parent_19.kind === 243)) {
|
||||
return parent_19;
|
||||
if (parent_20 && (parent_20.kind === 242 || parent_20.kind === 243)) {
|
||||
return parent_20;
|
||||
}
|
||||
else if (parent_19.kind === 246) {
|
||||
return parent_19.parent;
|
||||
else if (parent_20.kind === 246) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (parent_19 && ((parent_19.kind === 246) || (parent_19.kind === 247))) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && ((parent_20.kind === 246) || (parent_20.kind === 247))) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (parent_19 &&
|
||||
parent_19.kind === 248 &&
|
||||
parent_19.parent &&
|
||||
(parent_19.parent.kind === 246)) {
|
||||
return parent_19.parent.parent;
|
||||
if (parent_20 &&
|
||||
parent_20.kind === 248 &&
|
||||
parent_20.parent &&
|
||||
(parent_20.parent.kind === 246)) {
|
||||
return parent_20.parent.parent;
|
||||
}
|
||||
if (parent_19 && parent_19.kind === 247) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && parent_20.kind === 247) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -48228,17 +48247,17 @@ var ts;
|
||||
function getThrowStatementOwner(throwStatement) {
|
||||
var child = throwStatement;
|
||||
while (child.parent) {
|
||||
var parent_20 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256) {
|
||||
return parent_20;
|
||||
var parent_21 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256) {
|
||||
return parent_21;
|
||||
}
|
||||
if (parent_20.kind === 216) {
|
||||
var tryStatement = parent_20;
|
||||
if (parent_21.kind === 216) {
|
||||
var tryStatement = parent_21;
|
||||
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
child = parent_20;
|
||||
child = parent_21;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+75
-52
@@ -16621,6 +16621,7 @@ var ts;
|
||||
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
|
||||
var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);
|
||||
var globals = ts.createMap();
|
||||
/**
|
||||
@@ -19194,7 +19195,9 @@ var ts;
|
||||
if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048 /* Undefined */)) {
|
||||
type = getTypeWithFacts(type, 131072 /* NEUndefined */);
|
||||
}
|
||||
return type;
|
||||
return declaration.initializer ?
|
||||
getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) :
|
||||
type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) {
|
||||
var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
@@ -24650,6 +24653,7 @@ var ts;
|
||||
var isParameter = ts.getRootDeclaration(declaration).kind === 142 /* Parameter */;
|
||||
var declarationContainer = getControlFlowContainer(declaration);
|
||||
var flowContainer = getControlFlowContainer(node);
|
||||
var isOuterVariable = flowContainer !== declarationContainer;
|
||||
// When the control flow originates in a function expression or arrow function and we are referencing
|
||||
// a const variable or parameter from an outer function, we extend the origin of the control flow
|
||||
// analysis to include the immediately enclosing function.
|
||||
@@ -24662,7 +24666,7 @@ var ts;
|
||||
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
|
||||
// declaration container are the same).
|
||||
var assumeInitialized = !strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isParameter ||
|
||||
flowContainer !== declarationContainer || ts.isInAmbientContext(declaration);
|
||||
isOuterVariable || ts.isInAmbientContext(declaration);
|
||||
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
|
||||
// A variable is considered uninitialized when it is possible to analyze the entire control flow graph
|
||||
// from declaration to use, and when the variable's declared type doesn't include undefined but the
|
||||
@@ -27628,10 +27632,10 @@ var ts;
|
||||
// or that a different candidatesOutArray was passed in. Therefore, we need to redo the work
|
||||
// to correctly fill the candidatesOutArray.
|
||||
var cached = links.resolvedSignature;
|
||||
if (cached && cached !== anySignature && !candidatesOutArray) {
|
||||
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
|
||||
return cached;
|
||||
}
|
||||
links.resolvedSignature = anySignature;
|
||||
links.resolvedSignature = resolvingSignature;
|
||||
var result = resolveSignature(node, candidatesOutArray);
|
||||
// If signature resolution originated in control flow type analysis (for example to compute the
|
||||
// assigned type in a flow assignment) we don't cache the result as it may be based on temporary
|
||||
@@ -27642,7 +27646,7 @@ var ts;
|
||||
function getResolvedOrAnySignature(node) {
|
||||
// If we're already in the process of resolving the given signature, don't resolve again as
|
||||
// that could cause infinite recursion. Instead, return anySignature.
|
||||
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
|
||||
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
|
||||
}
|
||||
function getInferredClassType(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
@@ -28775,7 +28779,7 @@ var ts;
|
||||
return maybeTypeOfKind(contextualType, (64 /* NumberLiteral */ | 256 /* EnumLiteral */));
|
||||
}
|
||||
if (type.flags & 8 /* Boolean */) {
|
||||
return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */);
|
||||
}
|
||||
if (type.flags & 16 /* Enum */) {
|
||||
return typeContainsLiteralFromEnum(contextualType, type);
|
||||
@@ -43942,7 +43946,6 @@ var ts;
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = "2.0.2";
|
||||
var emptyArray = [];
|
||||
var defaultTypeRoots = ["node_modules/@types"];
|
||||
function findConfigFile(searchPath, fileExists) {
|
||||
while (true) {
|
||||
var fileName = ts.combinePaths(searchPath, "tsconfig.json");
|
||||
@@ -44086,11 +44089,31 @@ var ts;
|
||||
else if (host.getCurrentDirectory) {
|
||||
currentDirectory = host.getCurrentDirectory();
|
||||
}
|
||||
if (!currentDirectory) {
|
||||
return undefined;
|
||||
}
|
||||
return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); });
|
||||
return currentDirectory && getDefaultTypeRoots(currentDirectory, host);
|
||||
}
|
||||
/**
|
||||
* Returns the path to every node_modules/@types directory from some ancestor directory.
|
||||
* Returns undefined if there are none.
|
||||
*/
|
||||
function getDefaultTypeRoots(currentDirectory, host) {
|
||||
if (!host.directoryExists) {
|
||||
return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
|
||||
}
|
||||
var typeRoots;
|
||||
while (true) {
|
||||
var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
|
||||
if (host.directoryExists(atTypes)) {
|
||||
(typeRoots || (typeRoots = [])).push(atTypes);
|
||||
}
|
||||
var parent_15 = ts.getDirectoryPath(currentDirectory);
|
||||
if (parent_15 === currentDirectory) {
|
||||
break;
|
||||
}
|
||||
currentDirectory = parent_15;
|
||||
}
|
||||
return typeRoots;
|
||||
}
|
||||
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
@@ -47263,28 +47286,28 @@ var ts;
|
||||
switch (n.kind) {
|
||||
case 199 /* Block */:
|
||||
if (!ts.isFunctionBlock(n)) {
|
||||
var parent_15 = n.parent;
|
||||
var parent_16 = n.parent;
|
||||
var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile);
|
||||
var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile);
|
||||
// Check if the block is standalone, or 'attached' to some parent statement.
|
||||
// If the latter, we want to collapse the block, but consider its hint span
|
||||
// to be the entire span of the parent.
|
||||
if (parent_15.kind === 204 /* DoStatement */ ||
|
||||
parent_15.kind === 207 /* ForInStatement */ ||
|
||||
parent_15.kind === 208 /* ForOfStatement */ ||
|
||||
parent_15.kind === 206 /* ForStatement */ ||
|
||||
parent_15.kind === 203 /* IfStatement */ ||
|
||||
parent_15.kind === 205 /* WhileStatement */ ||
|
||||
parent_15.kind === 212 /* WithStatement */ ||
|
||||
parent_15.kind === 252 /* CatchClause */) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
if (parent_16.kind === 204 /* DoStatement */ ||
|
||||
parent_16.kind === 207 /* ForInStatement */ ||
|
||||
parent_16.kind === 208 /* ForOfStatement */ ||
|
||||
parent_16.kind === 206 /* ForStatement */ ||
|
||||
parent_16.kind === 203 /* IfStatement */ ||
|
||||
parent_16.kind === 205 /* WhileStatement */ ||
|
||||
parent_16.kind === 212 /* WithStatement */ ||
|
||||
parent_16.kind === 252 /* CatchClause */) {
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
if (parent_15.kind === 216 /* TryStatement */) {
|
||||
if (parent_16.kind === 216 /* TryStatement */) {
|
||||
// Could be the try-block, or the finally-block.
|
||||
var tryStatement = parent_15;
|
||||
var tryStatement = parent_16;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
@@ -54114,9 +54137,9 @@ var ts;
|
||||
return false;
|
||||
}
|
||||
// If the parent is not sourceFile or module block it is local variable
|
||||
for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) {
|
||||
for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) {
|
||||
// Reached source file or module block
|
||||
if (parent_16.kind === 256 /* SourceFile */ || parent_16.kind === 226 /* ModuleBlock */) {
|
||||
if (parent_17.kind === 256 /* SourceFile */ || parent_17.kind === 226 /* ModuleBlock */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -55482,13 +55505,13 @@ var ts;
|
||||
log("Returning an empty list because completion was requested in an invalid position.");
|
||||
return undefined;
|
||||
}
|
||||
var parent_17 = contextToken.parent, kind = contextToken.kind;
|
||||
var parent_18 = contextToken.parent, kind = contextToken.kind;
|
||||
if (kind === 21 /* DotToken */) {
|
||||
if (parent_17.kind === 172 /* PropertyAccessExpression */) {
|
||||
if (parent_18.kind === 172 /* PropertyAccessExpression */) {
|
||||
node = contextToken.parent.expression;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else if (parent_17.kind === 139 /* QualifiedName */) {
|
||||
else if (parent_18.kind === 139 /* QualifiedName */) {
|
||||
node = contextToken.parent.left;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
@@ -55866,9 +55889,9 @@ var ts;
|
||||
switch (contextToken.kind) {
|
||||
case 15 /* OpenBraceToken */: // const x = { |
|
||||
case 24 /* CommaToken */:
|
||||
var parent_18 = contextToken.parent;
|
||||
if (parent_18 && (parent_18.kind === 171 /* ObjectLiteralExpression */ || parent_18.kind === 167 /* ObjectBindingPattern */)) {
|
||||
return parent_18;
|
||||
var parent_19 = contextToken.parent;
|
||||
if (parent_19 && (parent_19.kind === 171 /* ObjectLiteralExpression */ || parent_19.kind === 167 /* ObjectBindingPattern */)) {
|
||||
return parent_19;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -55895,37 +55918,37 @@ var ts;
|
||||
}
|
||||
function tryGetContainingJsxElement(contextToken) {
|
||||
if (contextToken) {
|
||||
var parent_19 = contextToken.parent;
|
||||
var parent_20 = contextToken.parent;
|
||||
switch (contextToken.kind) {
|
||||
case 26 /* LessThanSlashToken */:
|
||||
case 39 /* SlashToken */:
|
||||
case 69 /* Identifier */:
|
||||
case 246 /* JsxAttribute */:
|
||||
case 247 /* JsxSpreadAttribute */:
|
||||
if (parent_19 && (parent_19.kind === 242 /* JsxSelfClosingElement */ || parent_19.kind === 243 /* JsxOpeningElement */)) {
|
||||
return parent_19;
|
||||
if (parent_20 && (parent_20.kind === 242 /* JsxSelfClosingElement */ || parent_20.kind === 243 /* JsxOpeningElement */)) {
|
||||
return parent_20;
|
||||
}
|
||||
else if (parent_19.kind === 246 /* JsxAttribute */) {
|
||||
return parent_19.parent;
|
||||
else if (parent_20.kind === 246 /* JsxAttribute */) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
// The context token is the closing } or " of an attribute, which means
|
||||
// its parent is a JsxExpression, whose parent is a JsxAttribute,
|
||||
// whose parent is a JsxOpeningLikeElement
|
||||
case 9 /* StringLiteral */:
|
||||
if (parent_19 && ((parent_19.kind === 246 /* JsxAttribute */) || (parent_19.kind === 247 /* JsxSpreadAttribute */))) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && ((parent_20.kind === 246 /* JsxAttribute */) || (parent_20.kind === 247 /* JsxSpreadAttribute */))) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 16 /* CloseBraceToken */:
|
||||
if (parent_19 &&
|
||||
parent_19.kind === 248 /* JsxExpression */ &&
|
||||
parent_19.parent &&
|
||||
(parent_19.parent.kind === 246 /* JsxAttribute */)) {
|
||||
return parent_19.parent.parent;
|
||||
if (parent_20 &&
|
||||
parent_20.kind === 248 /* JsxExpression */ &&
|
||||
parent_20.parent &&
|
||||
(parent_20.parent.kind === 246 /* JsxAttribute */)) {
|
||||
return parent_20.parent.parent;
|
||||
}
|
||||
if (parent_19 && parent_19.kind === 247 /* JsxSpreadAttribute */) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && parent_20.kind === 247 /* JsxSpreadAttribute */) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -57319,19 +57342,19 @@ var ts;
|
||||
function getThrowStatementOwner(throwStatement) {
|
||||
var child = throwStatement;
|
||||
while (child.parent) {
|
||||
var parent_20 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256 /* SourceFile */) {
|
||||
return parent_20;
|
||||
var parent_21 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256 /* SourceFile */) {
|
||||
return parent_21;
|
||||
}
|
||||
// A throw-statement is only owned by a try-statement if the try-statement has
|
||||
// a catch clause, and if the throw-statement occurs within the try block.
|
||||
if (parent_20.kind === 216 /* TryStatement */) {
|
||||
var tryStatement = parent_20;
|
||||
if (parent_21.kind === 216 /* TryStatement */) {
|
||||
var tryStatement = parent_21;
|
||||
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
child = parent_20;
|
||||
child = parent_21;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+75
-52
@@ -16621,6 +16621,7 @@ var ts;
|
||||
var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
|
||||
var anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);
|
||||
var globals = ts.createMap();
|
||||
/**
|
||||
@@ -19194,7 +19195,9 @@ var ts;
|
||||
if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 2048 /* Undefined */)) {
|
||||
type = getTypeWithFacts(type, 131072 /* NEUndefined */);
|
||||
}
|
||||
return type;
|
||||
return declaration.initializer ?
|
||||
getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) :
|
||||
type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclarationFromJSDocComment(declaration) {
|
||||
var jsDocType = getJSDocTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
@@ -24650,6 +24653,7 @@ var ts;
|
||||
var isParameter = ts.getRootDeclaration(declaration).kind === 142 /* Parameter */;
|
||||
var declarationContainer = getControlFlowContainer(declaration);
|
||||
var flowContainer = getControlFlowContainer(node);
|
||||
var isOuterVariable = flowContainer !== declarationContainer;
|
||||
// When the control flow originates in a function expression or arrow function and we are referencing
|
||||
// a const variable or parameter from an outer function, we extend the origin of the control flow
|
||||
// analysis to include the immediately enclosing function.
|
||||
@@ -24662,7 +24666,7 @@ var ts;
|
||||
// the entire control flow graph from the variable's declaration (i.e. when the flow container and
|
||||
// declaration container are the same).
|
||||
var assumeInitialized = !strictNullChecks || (type.flags & 1 /* Any */) !== 0 || isParameter ||
|
||||
flowContainer !== declarationContainer || ts.isInAmbientContext(declaration);
|
||||
isOuterVariable || ts.isInAmbientContext(declaration);
|
||||
var flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer);
|
||||
// A variable is considered uninitialized when it is possible to analyze the entire control flow graph
|
||||
// from declaration to use, and when the variable's declared type doesn't include undefined but the
|
||||
@@ -27628,10 +27632,10 @@ var ts;
|
||||
// or that a different candidatesOutArray was passed in. Therefore, we need to redo the work
|
||||
// to correctly fill the candidatesOutArray.
|
||||
var cached = links.resolvedSignature;
|
||||
if (cached && cached !== anySignature && !candidatesOutArray) {
|
||||
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
|
||||
return cached;
|
||||
}
|
||||
links.resolvedSignature = anySignature;
|
||||
links.resolvedSignature = resolvingSignature;
|
||||
var result = resolveSignature(node, candidatesOutArray);
|
||||
// If signature resolution originated in control flow type analysis (for example to compute the
|
||||
// assigned type in a flow assignment) we don't cache the result as it may be based on temporary
|
||||
@@ -27642,7 +27646,7 @@ var ts;
|
||||
function getResolvedOrAnySignature(node) {
|
||||
// If we're already in the process of resolving the given signature, don't resolve again as
|
||||
// that could cause infinite recursion. Instead, return anySignature.
|
||||
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
|
||||
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
|
||||
}
|
||||
function getInferredClassType(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
@@ -28775,7 +28779,7 @@ var ts;
|
||||
return maybeTypeOfKind(contextualType, (64 /* NumberLiteral */ | 256 /* EnumLiteral */));
|
||||
}
|
||||
if (type.flags & 8 /* Boolean */) {
|
||||
return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */) && !isTypeAssignableTo(booleanType, contextualType);
|
||||
return maybeTypeOfKind(contextualType, 128 /* BooleanLiteral */);
|
||||
}
|
||||
if (type.flags & 16 /* Enum */) {
|
||||
return typeContainsLiteralFromEnum(contextualType, type);
|
||||
@@ -43942,7 +43946,6 @@ var ts;
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = "2.0.2";
|
||||
var emptyArray = [];
|
||||
var defaultTypeRoots = ["node_modules/@types"];
|
||||
function findConfigFile(searchPath, fileExists) {
|
||||
while (true) {
|
||||
var fileName = ts.combinePaths(searchPath, "tsconfig.json");
|
||||
@@ -44086,11 +44089,31 @@ var ts;
|
||||
else if (host.getCurrentDirectory) {
|
||||
currentDirectory = host.getCurrentDirectory();
|
||||
}
|
||||
if (!currentDirectory) {
|
||||
return undefined;
|
||||
}
|
||||
return ts.map(defaultTypeRoots, function (d) { return ts.combinePaths(currentDirectory, d); });
|
||||
return currentDirectory && getDefaultTypeRoots(currentDirectory, host);
|
||||
}
|
||||
/**
|
||||
* Returns the path to every node_modules/@types directory from some ancestor directory.
|
||||
* Returns undefined if there are none.
|
||||
*/
|
||||
function getDefaultTypeRoots(currentDirectory, host) {
|
||||
if (!host.directoryExists) {
|
||||
return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)];
|
||||
}
|
||||
var typeRoots;
|
||||
while (true) {
|
||||
var atTypes = ts.combinePaths(currentDirectory, nodeModulesAtTypes);
|
||||
if (host.directoryExists(atTypes)) {
|
||||
(typeRoots || (typeRoots = [])).push(atTypes);
|
||||
}
|
||||
var parent_15 = ts.getDirectoryPath(currentDirectory);
|
||||
if (parent_15 === currentDirectory) {
|
||||
break;
|
||||
}
|
||||
currentDirectory = parent_15;
|
||||
}
|
||||
return typeRoots;
|
||||
}
|
||||
var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types");
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
@@ -47263,28 +47286,28 @@ var ts;
|
||||
switch (n.kind) {
|
||||
case 199 /* Block */:
|
||||
if (!ts.isFunctionBlock(n)) {
|
||||
var parent_15 = n.parent;
|
||||
var parent_16 = n.parent;
|
||||
var openBrace = ts.findChildOfKind(n, 15 /* OpenBraceToken */, sourceFile);
|
||||
var closeBrace = ts.findChildOfKind(n, 16 /* CloseBraceToken */, sourceFile);
|
||||
// Check if the block is standalone, or 'attached' to some parent statement.
|
||||
// If the latter, we want to collapse the block, but consider its hint span
|
||||
// to be the entire span of the parent.
|
||||
if (parent_15.kind === 204 /* DoStatement */ ||
|
||||
parent_15.kind === 207 /* ForInStatement */ ||
|
||||
parent_15.kind === 208 /* ForOfStatement */ ||
|
||||
parent_15.kind === 206 /* ForStatement */ ||
|
||||
parent_15.kind === 203 /* IfStatement */ ||
|
||||
parent_15.kind === 205 /* WhileStatement */ ||
|
||||
parent_15.kind === 212 /* WithStatement */ ||
|
||||
parent_15.kind === 252 /* CatchClause */) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
if (parent_16.kind === 204 /* DoStatement */ ||
|
||||
parent_16.kind === 207 /* ForInStatement */ ||
|
||||
parent_16.kind === 208 /* ForOfStatement */ ||
|
||||
parent_16.kind === 206 /* ForStatement */ ||
|
||||
parent_16.kind === 203 /* IfStatement */ ||
|
||||
parent_16.kind === 205 /* WhileStatement */ ||
|
||||
parent_16.kind === 212 /* WithStatement */ ||
|
||||
parent_16.kind === 252 /* CatchClause */) {
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
if (parent_15.kind === 216 /* TryStatement */) {
|
||||
if (parent_16.kind === 216 /* TryStatement */) {
|
||||
// Could be the try-block, or the finally-block.
|
||||
var tryStatement = parent_15;
|
||||
var tryStatement = parent_16;
|
||||
if (tryStatement.tryBlock === n) {
|
||||
addOutliningSpan(parent_15, openBrace, closeBrace, autoCollapse(n));
|
||||
addOutliningSpan(parent_16, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
}
|
||||
else if (tryStatement.finallyBlock === n) {
|
||||
@@ -54114,9 +54137,9 @@ var ts;
|
||||
return false;
|
||||
}
|
||||
// If the parent is not sourceFile or module block it is local variable
|
||||
for (var parent_16 = declaration.parent; !ts.isFunctionBlock(parent_16); parent_16 = parent_16.parent) {
|
||||
for (var parent_17 = declaration.parent; !ts.isFunctionBlock(parent_17); parent_17 = parent_17.parent) {
|
||||
// Reached source file or module block
|
||||
if (parent_16.kind === 256 /* SourceFile */ || parent_16.kind === 226 /* ModuleBlock */) {
|
||||
if (parent_17.kind === 256 /* SourceFile */ || parent_17.kind === 226 /* ModuleBlock */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -55482,13 +55505,13 @@ var ts;
|
||||
log("Returning an empty list because completion was requested in an invalid position.");
|
||||
return undefined;
|
||||
}
|
||||
var parent_17 = contextToken.parent, kind = contextToken.kind;
|
||||
var parent_18 = contextToken.parent, kind = contextToken.kind;
|
||||
if (kind === 21 /* DotToken */) {
|
||||
if (parent_17.kind === 172 /* PropertyAccessExpression */) {
|
||||
if (parent_18.kind === 172 /* PropertyAccessExpression */) {
|
||||
node = contextToken.parent.expression;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else if (parent_17.kind === 139 /* QualifiedName */) {
|
||||
else if (parent_18.kind === 139 /* QualifiedName */) {
|
||||
node = contextToken.parent.left;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
@@ -55866,9 +55889,9 @@ var ts;
|
||||
switch (contextToken.kind) {
|
||||
case 15 /* OpenBraceToken */: // const x = { |
|
||||
case 24 /* CommaToken */:
|
||||
var parent_18 = contextToken.parent;
|
||||
if (parent_18 && (parent_18.kind === 171 /* ObjectLiteralExpression */ || parent_18.kind === 167 /* ObjectBindingPattern */)) {
|
||||
return parent_18;
|
||||
var parent_19 = contextToken.parent;
|
||||
if (parent_19 && (parent_19.kind === 171 /* ObjectLiteralExpression */ || parent_19.kind === 167 /* ObjectBindingPattern */)) {
|
||||
return parent_19;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -55895,37 +55918,37 @@ var ts;
|
||||
}
|
||||
function tryGetContainingJsxElement(contextToken) {
|
||||
if (contextToken) {
|
||||
var parent_19 = contextToken.parent;
|
||||
var parent_20 = contextToken.parent;
|
||||
switch (contextToken.kind) {
|
||||
case 26 /* LessThanSlashToken */:
|
||||
case 39 /* SlashToken */:
|
||||
case 69 /* Identifier */:
|
||||
case 246 /* JsxAttribute */:
|
||||
case 247 /* JsxSpreadAttribute */:
|
||||
if (parent_19 && (parent_19.kind === 242 /* JsxSelfClosingElement */ || parent_19.kind === 243 /* JsxOpeningElement */)) {
|
||||
return parent_19;
|
||||
if (parent_20 && (parent_20.kind === 242 /* JsxSelfClosingElement */ || parent_20.kind === 243 /* JsxOpeningElement */)) {
|
||||
return parent_20;
|
||||
}
|
||||
else if (parent_19.kind === 246 /* JsxAttribute */) {
|
||||
return parent_19.parent;
|
||||
else if (parent_20.kind === 246 /* JsxAttribute */) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
// The context token is the closing } or " of an attribute, which means
|
||||
// its parent is a JsxExpression, whose parent is a JsxAttribute,
|
||||
// whose parent is a JsxOpeningLikeElement
|
||||
case 9 /* StringLiteral */:
|
||||
if (parent_19 && ((parent_19.kind === 246 /* JsxAttribute */) || (parent_19.kind === 247 /* JsxSpreadAttribute */))) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && ((parent_20.kind === 246 /* JsxAttribute */) || (parent_20.kind === 247 /* JsxSpreadAttribute */))) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
case 16 /* CloseBraceToken */:
|
||||
if (parent_19 &&
|
||||
parent_19.kind === 248 /* JsxExpression */ &&
|
||||
parent_19.parent &&
|
||||
(parent_19.parent.kind === 246 /* JsxAttribute */)) {
|
||||
return parent_19.parent.parent;
|
||||
if (parent_20 &&
|
||||
parent_20.kind === 248 /* JsxExpression */ &&
|
||||
parent_20.parent &&
|
||||
(parent_20.parent.kind === 246 /* JsxAttribute */)) {
|
||||
return parent_20.parent.parent;
|
||||
}
|
||||
if (parent_19 && parent_19.kind === 247 /* JsxSpreadAttribute */) {
|
||||
return parent_19.parent;
|
||||
if (parent_20 && parent_20.kind === 247 /* JsxSpreadAttribute */) {
|
||||
return parent_20.parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -57319,19 +57342,19 @@ var ts;
|
||||
function getThrowStatementOwner(throwStatement) {
|
||||
var child = throwStatement;
|
||||
while (child.parent) {
|
||||
var parent_20 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_20) || parent_20.kind === 256 /* SourceFile */) {
|
||||
return parent_20;
|
||||
var parent_21 = child.parent;
|
||||
if (ts.isFunctionBlock(parent_21) || parent_21.kind === 256 /* SourceFile */) {
|
||||
return parent_21;
|
||||
}
|
||||
// A throw-statement is only owned by a try-statement if the try-statement has
|
||||
// a catch clause, and if the throw-statement occurs within the try block.
|
||||
if (parent_20.kind === 216 /* TryStatement */) {
|
||||
var tryStatement = parent_20;
|
||||
if (parent_21.kind === 216 /* TryStatement */) {
|
||||
var tryStatement = parent_21;
|
||||
if (tryStatement.tryBlock === child && tryStatement.catchClause) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
child = parent_20;
|
||||
child = parent_21;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user