Skip to content

Commit

Permalink
Update LKG.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Oct 28, 2019
1 parent 156ec62 commit 787ff34
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 134 deletions.
44 changes: 32 additions & 12 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
var ts;
(function (ts) {
ts.versionMajorMinor = "3.7";
ts.version = ts.versionMajorMinor + ".1-rc";
ts.version = ts.versionMajorMinor + ".2";
})(ts || (ts = {}));
(function (ts) {
function tryGetNativeMap() {
Expand Down Expand Up @@ -11889,6 +11889,10 @@ var ts;
return ts.isOptionalChainRoot(node.parent) && node.parent.expression === node;
}
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
function isNullishCoalesce(node) {
return node.kind === 208 && node.operatorToken.kind === 60;
}
ts.isNullishCoalesce = isNullishCoalesce;
function isNewExpression(node) {
return node.kind === 196;
}
Expand Down Expand Up @@ -24153,11 +24157,10 @@ var ts;
if (!expression) {
return flags & 32 ? antecedent : unreachableFlow;
}
if (expression.kind === 105 && flags & 64 ||
expression.kind === 90 && flags & 32) {
if (!ts.isExpressionOfOptionalChainRoot(expression)) {
return unreachableFlow;
}
if ((expression.kind === 105 && flags & 64 ||
expression.kind === 90 && flags & 32) &&
!ts.isExpressionOfOptionalChainRoot(expression) && !ts.isNullishCoalesce(expression.parent)) {
return unreachableFlow;
}
if (!isNarrowingExpression(expression)) {
return antecedent;
Expand Down Expand Up @@ -24996,7 +24999,12 @@ var ts;
switch (ts.getAssignmentDeclarationPropertyAccessKind(declName.parent)) {
case 1:
case 2:
container = file;
if (!ts.isExternalOrCommonJsModule(file)) {
container = undefined;
}
else {
container = file;
}
break;
case 4:
container = declName.parent.expression;
Expand All @@ -25010,7 +25018,9 @@ var ts;
case 0:
return ts.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration");
}
declareModuleMember(typeAlias, 524288, 788968);
if (container) {
declareModuleMember(typeAlias, 524288, 788968);
}
container = oldContainer;
}
}
Expand Down Expand Up @@ -29990,7 +30000,6 @@ var ts;
else if (context.flags & 2048 &&
type.symbol.valueDeclaration &&
ts.isClassLike(type.symbol.valueDeclaration) &&
ts.findAncestor(type.symbol.valueDeclaration, function (d) { return d === ts.getSourceFileOfNode(context.enclosingDeclaration); }) &&
!isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
return createAnonymousTypeNode(type);
}
Expand Down Expand Up @@ -35247,7 +35256,9 @@ var ts;
&& ts.isCallExpression(decl.initializer)
&& ts.isRequireCall(decl.initializer, true)
&& valueType.symbol;
if (isRequireAlias) {
var isImportType = node.kind === 187;
var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
if (isRequireAlias || isImportType || isDelayedMergeClass) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}
Expand Down Expand Up @@ -37870,13 +37881,13 @@ var ts;
}
if (!ignoreReturnTypes) {
var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType
: target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(target.declaration.symbol)
: target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol))
: getReturnTypeOfSignature(target);
if (targetReturnType === voidType) {
return result;
}
var sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType
: source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(source.declaration.symbol)
: source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(source.declaration.symbol))
: getReturnTypeOfSignature(source);
var targetTypePredicate = getTypePredicateOfSignature(target);
if (targetTypePredicate) {
Expand Down Expand Up @@ -78958,6 +78969,15 @@ var ts;
function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) {
if (useSourceOfProjectReferenceRedirect) {
var source = getSourceOfProjectReferenceRedirect(fileName);
if (!source &&
host.realpath &&
options.preserveSymlinks &&
ts.isDeclarationFileName(fileName) &&
ts.stringContains(fileName, ts.nodeModulesPathPart)) {
var realPath = host.realpath(fileName);
if (realPath !== fileName)
source = getSourceOfProjectReferenceRedirect(realPath);
}
if (source) {
var file_1 = ts.isString(source) ?
findSourceFile(source, toPath(source), isDefaultLib, ignoreNoDefaultLib, refFile, packageId) :
Expand Down

0 comments on commit 787ff34

Please sign in to comment.