@@ -67,7 +67,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
67
67
var ts;
68
68
(function (ts) {
69
69
ts.versionMajorMinor = "3.7";
70
- ts.version = ts.versionMajorMinor + ".1-rc ";
70
+ ts.version = ts.versionMajorMinor + ".2 ";
71
71
})(ts || (ts = {}));
72
72
(function (ts) {
73
73
function tryGetNativeMap() {
@@ -11889,6 +11889,10 @@ var ts;
11889
11889
return ts.isOptionalChainRoot(node.parent) && node.parent.expression === node;
11890
11890
}
11891
11891
ts.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot;
11892
+ function isNullishCoalesce(node) {
11893
+ return node.kind === 208 && node.operatorToken.kind === 60;
11894
+ }
11895
+ ts.isNullishCoalesce = isNullishCoalesce;
11892
11896
function isNewExpression(node) {
11893
11897
return node.kind === 196;
11894
11898
}
@@ -24153,11 +24157,10 @@ var ts;
24153
24157
if (!expression) {
24154
24158
return flags & 32 ? antecedent : unreachableFlow;
24155
24159
}
24156
- if (expression.kind === 105 && flags & 64 ||
24157
- expression.kind === 90 && flags & 32) {
24158
- if (!ts.isExpressionOfOptionalChainRoot(expression)) {
24159
- return unreachableFlow;
24160
- }
24160
+ if ((expression.kind === 105 && flags & 64 ||
24161
+ expression.kind === 90 && flags & 32) &&
24162
+ !ts.isExpressionOfOptionalChainRoot(expression) && !ts.isNullishCoalesce(expression.parent)) {
24163
+ return unreachableFlow;
24161
24164
}
24162
24165
if (!isNarrowingExpression(expression)) {
24163
24166
return antecedent;
@@ -24996,7 +24999,12 @@ var ts;
24996
24999
switch (ts.getAssignmentDeclarationPropertyAccessKind(declName.parent)) {
24997
25000
case 1:
24998
25001
case 2:
24999
- container = file;
25002
+ if (!ts.isExternalOrCommonJsModule(file)) {
25003
+ container = undefined;
25004
+ }
25005
+ else {
25006
+ container = file;
25007
+ }
25000
25008
break;
25001
25009
case 4:
25002
25010
container = declName.parent.expression;
@@ -25010,7 +25018,9 @@ var ts;
25010
25018
case 0:
25011
25019
return ts.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration");
25012
25020
}
25013
- declareModuleMember(typeAlias, 524288, 788968);
25021
+ if (container) {
25022
+ declareModuleMember(typeAlias, 524288, 788968);
25023
+ }
25014
25024
container = oldContainer;
25015
25025
}
25016
25026
}
@@ -29990,7 +30000,6 @@ var ts;
29990
30000
else if (context.flags & 2048 &&
29991
30001
type.symbol.valueDeclaration &&
29992
30002
ts.isClassLike(type.symbol.valueDeclaration) &&
29993
- ts.findAncestor(type.symbol.valueDeclaration, function (d) { return d === ts.getSourceFileOfNode(context.enclosingDeclaration); }) &&
29994
30003
!isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
29995
30004
return createAnonymousTypeNode(type);
29996
30005
}
@@ -35247,7 +35256,9 @@ var ts;
35247
35256
&& ts.isCallExpression(decl.initializer)
35248
35257
&& ts.isRequireCall(decl.initializer, true)
35249
35258
&& valueType.symbol;
35250
- if (isRequireAlias) {
35259
+ var isImportType = node.kind === 187;
35260
+ var isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
35261
+ if (isRequireAlias || isImportType || isDelayedMergeClass) {
35251
35262
typeType = getTypeReferenceType(node, valueType.symbol);
35252
35263
}
35253
35264
}
@@ -37870,13 +37881,13 @@ var ts;
37870
37881
}
37871
37882
if (!ignoreReturnTypes) {
37872
37883
var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType
37873
- : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(target.declaration.symbol)
37884
+ : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol( target.declaration.symbol) )
37874
37885
: getReturnTypeOfSignature(target);
37875
37886
if (targetReturnType === voidType) {
37876
37887
return result;
37877
37888
}
37878
37889
var sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType
37879
- : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(source.declaration.symbol)
37890
+ : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol( source.declaration.symbol) )
37880
37891
: getReturnTypeOfSignature(source);
37881
37892
var targetTypePredicate = getTypePredicateOfSignature(target);
37882
37893
if (targetTypePredicate) {
@@ -78958,6 +78969,15 @@ var ts;
78958
78969
function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) {
78959
78970
if (useSourceOfProjectReferenceRedirect) {
78960
78971
var source = getSourceOfProjectReferenceRedirect(fileName);
78972
+ if (!source &&
78973
+ host.realpath &&
78974
+ options.preserveSymlinks &&
78975
+ ts.isDeclarationFileName(fileName) &&
78976
+ ts.stringContains(fileName, ts.nodeModulesPathPart)) {
78977
+ var realPath = host.realpath(fileName);
78978
+ if (realPath !== fileName)
78979
+ source = getSourceOfProjectReferenceRedirect(realPath);
78980
+ }
78961
78981
if (source) {
78962
78982
var file_1 = ts.isString(source) ?
78963
78983
findSourceFile(source, toPath(source), isDefaultLib, ignoreNoDefaultLib, refFile, packageId) :
0 commit comments