typescript 4.6.1-rc → 4.7.0-dev.20220218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cancellationToken.js +1 -1
- package/lib/cs/diagnosticMessages.generated.json +9 -3
- package/lib/de/diagnosticMessages.generated.json +13 -3
- package/lib/es/diagnosticMessages.generated.json +9 -3
- package/lib/fr/diagnosticMessages.generated.json +13 -3
- package/lib/it/diagnosticMessages.generated.json +13 -3
- package/lib/ja/diagnosticMessages.generated.json +9 -3
- package/lib/ko/diagnosticMessages.generated.json +13 -3
- package/lib/lib.es2020.intl.d.ts +4 -0
- package/lib/lib.es2021.intl.d.ts +6 -6
- package/lib/lib.es5.d.ts +3 -1
- package/lib/lib.esnext.intl.d.ts +4 -1
- package/lib/pl/diagnosticMessages.generated.json +13 -3
- package/lib/protocol.d.ts +7 -0
- package/lib/pt-br/diagnosticMessages.generated.json +13 -3
- package/lib/ru/diagnosticMessages.generated.json +13 -3
- package/lib/tr/diagnosticMessages.generated.json +13 -3
- package/lib/tsc.js +963 -789
- package/lib/tsserver.js +1513 -1219
- package/lib/tsserverlibrary.d.ts +32 -26
- package/lib/tsserverlibrary.js +1482 -1189
- package/lib/typescript.d.ts +24 -25
- package/lib/typescript.js +1385 -1092
- package/lib/typescriptServices.d.ts +24 -25
- package/lib/typescriptServices.js +1385 -1092
- package/lib/typingsInstaller.js +1154 -954
- package/lib/zh-cn/diagnosticMessages.generated.json +13 -3
- package/lib/zh-tw/diagnosticMessages.generated.json +13 -3
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
22
|
ar[i] = from[i];
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
return to.concat(ar ||
|
|
25
|
+
return to.concat(ar || from);
|
|
26
26
|
};
|
|
27
27
|
var __assign = (this && this.__assign) || function () {
|
|
28
28
|
__assign = Object.assign || function(t) {
|
|
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
68
68
|
};
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
|
-
ts.versionMajorMinor = "4.
|
|
72
|
-
ts.version =
|
|
71
|
+
ts.versionMajorMinor = "4.7";
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220218";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -94,7 +94,7 @@ var ts;
|
|
|
94
94
|
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
|
|
95
95
|
if (constructor)
|
|
96
96
|
return constructor;
|
|
97
|
-
throw new Error("TypeScript requires an environment that provides a compatible native "
|
|
97
|
+
throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
|
|
98
98
|
}
|
|
99
99
|
})(ts || (ts = {}));
|
|
100
100
|
var ts;
|
|
@@ -1293,7 +1293,7 @@ var ts;
|
|
|
1293
1293
|
function cast(value, test) {
|
|
1294
1294
|
if (value !== undefined && test(value))
|
|
1295
1295
|
return value;
|
|
1296
|
-
return ts.Debug.fail("Invalid cast. The supplied value "
|
|
1296
|
+
return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
|
|
1297
1297
|
}
|
|
1298
1298
|
ts.cast = cast;
|
|
1299
1299
|
function noop(_) { }
|
|
@@ -1343,7 +1343,7 @@ var ts;
|
|
|
1343
1343
|
function memoizeOne(callback) {
|
|
1344
1344
|
var map = new ts.Map();
|
|
1345
1345
|
return function (arg) {
|
|
1346
|
-
var key =
|
|
1346
|
+
var key = typeof arg + ":" + arg;
|
|
1347
1347
|
var value = map.get(key);
|
|
1348
1348
|
if (value === undefined && !map.has(key)) {
|
|
1349
1349
|
value = callback(arg);
|
|
@@ -1678,7 +1678,7 @@ var ts;
|
|
|
1678
1678
|
ts.createGetCanonicalFileName = createGetCanonicalFileName;
|
|
1679
1679
|
function patternText(_a) {
|
|
1680
1680
|
var prefix = _a.prefix, suffix = _a.suffix;
|
|
1681
|
-
return
|
|
1681
|
+
return prefix + "*" + suffix;
|
|
1682
1682
|
}
|
|
1683
1683
|
ts.patternText = patternText;
|
|
1684
1684
|
function matchedText(pattern, candidate) {
|
|
@@ -1947,7 +1947,7 @@ var ts;
|
|
|
1947
1947
|
}
|
|
1948
1948
|
function fail(message, stackCrawlMark) {
|
|
1949
1949
|
debugger;
|
|
1950
|
-
var e = new Error(message ? "Debug Failure. "
|
|
1950
|
+
var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
|
|
1951
1951
|
if (Error.captureStackTrace) {
|
|
1952
1952
|
Error.captureStackTrace(e, stackCrawlMark || fail);
|
|
1953
1953
|
}
|
|
@@ -1955,12 +1955,12 @@ var ts;
|
|
|
1955
1955
|
}
|
|
1956
1956
|
Debug.fail = fail;
|
|
1957
1957
|
function failBadSyntaxKind(node, message, stackCrawlMark) {
|
|
1958
|
-
return fail(
|
|
1958
|
+
return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
|
|
1959
1959
|
}
|
|
1960
1960
|
Debug.failBadSyntaxKind = failBadSyntaxKind;
|
|
1961
1961
|
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
|
|
1962
1962
|
if (!expression) {
|
|
1963
|
-
message = message ? "False expression: "
|
|
1963
|
+
message = message ? "False expression: " + message : "False expression.";
|
|
1964
1964
|
if (verboseDebugInfo) {
|
|
1965
1965
|
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
|
|
1966
1966
|
}
|
|
@@ -1970,26 +1970,26 @@ var ts;
|
|
|
1970
1970
|
Debug.assert = assert;
|
|
1971
1971
|
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
|
|
1972
1972
|
if (a !== b) {
|
|
1973
|
-
var message = msg ? msg2 ?
|
|
1974
|
-
fail("Expected "
|
|
1973
|
+
var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
|
|
1974
|
+
fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
1977
|
Debug.assertEqual = assertEqual;
|
|
1978
1978
|
function assertLessThan(a, b, msg, stackCrawlMark) {
|
|
1979
1979
|
if (a >= b) {
|
|
1980
|
-
fail("Expected "
|
|
1980
|
+
fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
1983
|
Debug.assertLessThan = assertLessThan;
|
|
1984
1984
|
function assertLessThanOrEqual(a, b, stackCrawlMark) {
|
|
1985
1985
|
if (a > b) {
|
|
1986
|
-
fail("Expected "
|
|
1986
|
+
fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
1989
|
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
|
|
1990
1990
|
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
|
|
1991
1991
|
if (a < b) {
|
|
1992
|
-
fail("Expected "
|
|
1992
|
+
fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
|
|
@@ -2018,43 +2018,43 @@ var ts;
|
|
|
2018
2018
|
Debug.checkEachDefined = checkEachDefined;
|
|
2019
2019
|
function assertNever(member, message, stackCrawlMark) {
|
|
2020
2020
|
if (message === void 0) { message = "Illegal value:"; }
|
|
2021
|
-
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos")
|
|
2022
|
-
return fail(
|
|
2021
|
+
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
|
|
2022
|
+
return fail(message + " " + detail, stackCrawlMark || assertNever);
|
|
2023
2023
|
}
|
|
2024
2024
|
Debug.assertNever = assertNever;
|
|
2025
2025
|
function assertEachNode(nodes, test, message, stackCrawlMark) {
|
|
2026
2026
|
if (shouldAssertFunction(1, "assertEachNode")) {
|
|
2027
|
-
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '"
|
|
2027
|
+
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
2030
|
Debug.assertEachNode = assertEachNode;
|
|
2031
2031
|
function assertNode(node, test, message, stackCrawlMark) {
|
|
2032
2032
|
if (shouldAssertFunction(1, "assertNode")) {
|
|
2033
|
-
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node "
|
|
2033
|
+
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
2036
|
Debug.assertNode = assertNode;
|
|
2037
2037
|
function assertNotNode(node, test, message, stackCrawlMark) {
|
|
2038
2038
|
if (shouldAssertFunction(1, "assertNotNode")) {
|
|
2039
|
-
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node "
|
|
2039
|
+
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
2042
|
Debug.assertNotNode = assertNotNode;
|
|
2043
2043
|
function assertOptionalNode(node, test, message, stackCrawlMark) {
|
|
2044
2044
|
if (shouldAssertFunction(1, "assertOptionalNode")) {
|
|
2045
|
-
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node "
|
|
2045
|
+
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
Debug.assertOptionalNode = assertOptionalNode;
|
|
2049
2049
|
function assertOptionalToken(node, kind, message, stackCrawlMark) {
|
|
2050
2050
|
if (shouldAssertFunction(1, "assertOptionalToken")) {
|
|
2051
|
-
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node "
|
|
2051
|
+
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
2054
2054
|
Debug.assertOptionalToken = assertOptionalToken;
|
|
2055
2055
|
function assertMissingNode(node, message, stackCrawlMark) {
|
|
2056
2056
|
if (shouldAssertFunction(1, "assertMissingNode")) {
|
|
2057
|
-
assert(node === undefined, message || "Unexpected node.", function () { return "Node "
|
|
2057
|
+
assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
2060
|
Debug.assertMissingNode = assertMissingNode;
|
|
@@ -2075,7 +2075,7 @@ var ts;
|
|
|
2075
2075
|
}
|
|
2076
2076
|
Debug.getFunctionName = getFunctionName;
|
|
2077
2077
|
function formatSymbol(symbol) {
|
|
2078
|
-
return "{ name: "
|
|
2078
|
+
return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
|
|
2079
2079
|
}
|
|
2080
2080
|
Debug.formatSymbol = formatSymbol;
|
|
2081
2081
|
function formatEnum(value, enumObject, isFlags) {
|
|
@@ -2093,7 +2093,7 @@ var ts;
|
|
|
2093
2093
|
break;
|
|
2094
2094
|
}
|
|
2095
2095
|
if (enumValue !== 0 && enumValue & value) {
|
|
2096
|
-
result = ""
|
|
2096
|
+
result = "" + result + (result ? "|" : "") + enumName;
|
|
2097
2097
|
remainingFlags &= ~enumValue;
|
|
2098
2098
|
}
|
|
2099
2099
|
}
|
|
@@ -2202,7 +2202,7 @@ var ts;
|
|
|
2202
2202
|
this.flags & 1 ? "FlowUnreachable" :
|
|
2203
2203
|
"UnknownFlow";
|
|
2204
2204
|
var remainingFlags = this.flags & ~(2048 - 1);
|
|
2205
|
-
return ""
|
|
2205
|
+
return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
|
|
2206
2206
|
}
|
|
2207
2207
|
},
|
|
2208
2208
|
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, true); } },
|
|
@@ -2232,7 +2232,7 @@ var ts;
|
|
|
2232
2232
|
__tsDebuggerDisplay: {
|
|
2233
2233
|
value: function (defaultValue) {
|
|
2234
2234
|
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
|
|
2235
|
-
return "NodeArray "
|
|
2235
|
+
return "NodeArray " + defaultValue;
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
2238
|
});
|
|
@@ -2278,7 +2278,7 @@ var ts;
|
|
|
2278
2278
|
var symbolHeader = this.flags & 33554432 ? "TransientSymbol" :
|
|
2279
2279
|
"Symbol";
|
|
2280
2280
|
var remainingSymbolFlags = this.flags & ~33554432;
|
|
2281
|
-
return
|
|
2281
|
+
return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
|
|
2282
2282
|
}
|
|
2283
2283
|
},
|
|
2284
2284
|
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
|
|
@@ -2287,11 +2287,11 @@ var ts;
|
|
|
2287
2287
|
__tsDebuggerDisplay: {
|
|
2288
2288
|
value: function () {
|
|
2289
2289
|
var typeHeader = this.flags & 98304 ? "NullableType" :
|
|
2290
|
-
this.flags & 384 ? "LiteralType "
|
|
2291
|
-
this.flags & 2048 ? "LiteralType "
|
|
2290
|
+
this.flags & 384 ? "LiteralType " + JSON.stringify(this.value) :
|
|
2291
|
+
this.flags & 2048 ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
|
|
2292
2292
|
this.flags & 8192 ? "UniqueESSymbolType" :
|
|
2293
2293
|
this.flags & 32 ? "EnumType" :
|
|
2294
|
-
this.flags & 67359327 ? "IntrinsicType "
|
|
2294
|
+
this.flags & 67359327 ? "IntrinsicType " + this.intrinsicName :
|
|
2295
2295
|
this.flags & 1048576 ? "UnionType" :
|
|
2296
2296
|
this.flags & 2097152 ? "IntersectionType" :
|
|
2297
2297
|
this.flags & 4194304 ? "IndexType" :
|
|
@@ -2310,7 +2310,7 @@ var ts;
|
|
|
2310
2310
|
"ObjectType" :
|
|
2311
2311
|
"Type";
|
|
2312
2312
|
var remainingObjectFlags = this.flags & 524288 ? this.objectFlags & ~1343 : 0;
|
|
2313
|
-
return ""
|
|
2313
|
+
return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
|
|
2314
2314
|
}
|
|
2315
2315
|
},
|
|
2316
2316
|
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
|
|
@@ -2344,11 +2344,11 @@ var ts;
|
|
|
2344
2344
|
__tsDebuggerDisplay: {
|
|
2345
2345
|
value: function () {
|
|
2346
2346
|
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
|
|
2347
|
-
ts.isIdentifier(this) ? "Identifier '"
|
|
2348
|
-
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '"
|
|
2349
|
-
ts.isStringLiteral(this) ? "StringLiteral "
|
|
2350
|
-
ts.isNumericLiteral(this) ? "NumericLiteral "
|
|
2351
|
-
ts.isBigIntLiteral(this) ? "BigIntLiteral "
|
|
2347
|
+
ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
|
|
2348
|
+
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
|
|
2349
|
+
ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
|
|
2350
|
+
ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
|
|
2351
|
+
ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
|
|
2352
2352
|
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
|
|
2353
2353
|
ts.isParameter(this) ? "ParameterDeclaration" :
|
|
2354
2354
|
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
|
|
@@ -2380,7 +2380,7 @@ var ts;
|
|
|
2380
2380
|
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
|
|
2381
2381
|
ts.isImportTypeNode(this) ? "ImportTypeNode" :
|
|
2382
2382
|
formatSyntaxKind(this.kind);
|
|
2383
|
-
return ""
|
|
2383
|
+
return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
|
|
2384
2384
|
}
|
|
2385
2385
|
},
|
|
2386
2386
|
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
|
|
@@ -2424,10 +2424,10 @@ var ts;
|
|
|
2424
2424
|
Debug.enableDebugInfo = enableDebugInfo;
|
|
2425
2425
|
function formatDeprecationMessage(name, error, errorAfter, since, message) {
|
|
2426
2426
|
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
|
|
2427
|
-
deprecationMessage += "'"
|
|
2428
|
-
deprecationMessage += since ? "has been deprecated since v"
|
|
2429
|
-
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v"
|
|
2430
|
-
deprecationMessage += message ? " "
|
|
2427
|
+
deprecationMessage += "'" + name + "' ";
|
|
2428
|
+
deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
|
|
2429
|
+
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
|
|
2430
|
+
deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
|
|
2431
2431
|
return deprecationMessage;
|
|
2432
2432
|
}
|
|
2433
2433
|
function createErrorDeprecation(name, errorAfter, since, message) {
|
|
@@ -2524,11 +2524,11 @@ var ts;
|
|
|
2524
2524
|
}
|
|
2525
2525
|
};
|
|
2526
2526
|
Version.prototype.toString = function () {
|
|
2527
|
-
var result =
|
|
2527
|
+
var result = this.major + "." + this.minor + "." + this.patch;
|
|
2528
2528
|
if (ts.some(this.prerelease))
|
|
2529
|
-
result += "-"
|
|
2529
|
+
result += "-" + this.prerelease.join(".");
|
|
2530
2530
|
if (ts.some(this.build))
|
|
2531
|
-
result += "+"
|
|
2531
|
+
result += "+" + this.build.join(".");
|
|
2532
2532
|
return result;
|
|
2533
2533
|
};
|
|
2534
2534
|
Version.zero = new Version(0, 0, 0);
|
|
@@ -2750,7 +2750,7 @@ var ts;
|
|
|
2750
2750
|
return ts.map(comparators, formatComparator).join(" ");
|
|
2751
2751
|
}
|
|
2752
2752
|
function formatComparator(comparator) {
|
|
2753
|
-
return ""
|
|
2753
|
+
return "" + comparator.operator + comparator.operand;
|
|
2754
2754
|
}
|
|
2755
2755
|
})(ts || (ts = {}));
|
|
2756
2756
|
var ts;
|
|
@@ -2979,7 +2979,7 @@ var ts;
|
|
|
2979
2979
|
fs = require("fs");
|
|
2980
2980
|
}
|
|
2981
2981
|
catch (e) {
|
|
2982
|
-
throw new Error("tracing requires having fs\n(original error: "
|
|
2982
|
+
throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
2985
|
mode = tracingMode;
|
|
@@ -2990,11 +2990,11 @@ var ts;
|
|
|
2990
2990
|
if (!fs.existsSync(traceDir)) {
|
|
2991
2991
|
fs.mkdirSync(traceDir, { recursive: true });
|
|
2992
2992
|
}
|
|
2993
|
-
var countPart = mode === "build" ? "."
|
|
2994
|
-
: mode === "server" ? "."
|
|
2993
|
+
var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
|
|
2994
|
+
: mode === "server" ? "." + process.pid
|
|
2995
2995
|
: "";
|
|
2996
|
-
var tracePath = ts.combinePaths(traceDir, "trace"
|
|
2997
|
-
var typesPath = ts.combinePaths(traceDir, "types"
|
|
2996
|
+
var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
|
|
2997
|
+
var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
|
|
2998
2998
|
legend.push({
|
|
2999
2999
|
configFilePath: configFilePath,
|
|
3000
3000
|
tracePath: tracePath,
|
|
@@ -3062,7 +3062,7 @@ var ts;
|
|
|
3062
3062
|
writeEvent("E", phase, name, args, undefined, endTime);
|
|
3063
3063
|
}
|
|
3064
3064
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3065
|
-
writeEvent("X", phase, name, args, "\"dur\":"
|
|
3065
|
+
writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
|
|
3066
3066
|
}
|
|
3067
3067
|
}
|
|
3068
3068
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -3070,11 +3070,11 @@ var ts;
|
|
|
3070
3070
|
if (mode === "server" && phase === "checkTypes")
|
|
3071
3071
|
return;
|
|
3072
3072
|
ts.performance.mark("beginTracing");
|
|
3073
|
-
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\""
|
|
3073
|
+
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
|
|
3074
3074
|
if (extras)
|
|
3075
|
-
fs.writeSync(traceFd, ","
|
|
3075
|
+
fs.writeSync(traceFd, "," + extras);
|
|
3076
3076
|
if (args)
|
|
3077
|
-
fs.writeSync(traceFd, ",\"args\":"
|
|
3077
|
+
fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
|
|
3078
3078
|
fs.writeSync(traceFd, "}");
|
|
3079
3079
|
ts.performance.mark("endTracing");
|
|
3080
3080
|
ts.performance.measure("Tracing", "beginTracing", "endTracing");
|
|
@@ -3306,7 +3306,8 @@ var ts;
|
|
|
3306
3306
|
{ name: "types", optional: true, captureSpan: true },
|
|
3307
3307
|
{ name: "lib", optional: true, captureSpan: true },
|
|
3308
3308
|
{ name: "path", optional: true, captureSpan: true },
|
|
3309
|
-
{ name: "no-default-lib", optional: true }
|
|
3309
|
+
{ name: "no-default-lib", optional: true },
|
|
3310
|
+
{ name: "resolution-mode", optional: true }
|
|
3310
3311
|
],
|
|
3311
3312
|
kind: 1
|
|
3312
3313
|
},
|
|
@@ -3394,7 +3395,7 @@ var ts;
|
|
|
3394
3395
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
3395
3396
|
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
|
|
3396
3397
|
function getLevel(envVar, level) {
|
|
3397
|
-
return system.getEnvironmentVariable(
|
|
3398
|
+
return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
|
|
3398
3399
|
}
|
|
3399
3400
|
function getCustomLevels(baseVariable) {
|
|
3400
3401
|
var customLevels;
|
|
@@ -3818,7 +3819,7 @@ var ts;
|
|
|
3818
3819
|
}
|
|
3819
3820
|
function onTimerToUpdateChildWatches() {
|
|
3820
3821
|
timerToUpdateChildWatches = undefined;
|
|
3821
|
-
sysLog("sysLog:: onTimerToUpdateChildWatches:: "
|
|
3822
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
3822
3823
|
var start = ts.timestamp();
|
|
3823
3824
|
var invokeMap = new ts.Map();
|
|
3824
3825
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -3829,7 +3830,7 @@ var ts;
|
|
|
3829
3830
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
3830
3831
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
3831
3832
|
}
|
|
3832
|
-
sysLog("sysLog:: invokingWatchers:: Elapsed:: "
|
|
3833
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
3833
3834
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
3834
3835
|
var existing = invokeMap.get(rootDirName);
|
|
3835
3836
|
if (existing) {
|
|
@@ -3845,7 +3846,7 @@ var ts;
|
|
|
3845
3846
|
}
|
|
3846
3847
|
});
|
|
3847
3848
|
var elapsed = ts.timestamp() - start;
|
|
3848
|
-
sysLog("sysLog:: Elapsed:: "
|
|
3849
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
3849
3850
|
}
|
|
3850
3851
|
function removeChildWatches(parentWatcher) {
|
|
3851
3852
|
if (!parentWatcher)
|
|
@@ -4237,7 +4238,7 @@ var ts;
|
|
|
4237
4238
|
var externalFileCounter = 0;
|
|
4238
4239
|
var remappedPaths = new ts.Map();
|
|
4239
4240
|
var normalizedDir = ts.normalizeSlashes(__dirname);
|
|
4240
|
-
var fileUrlRoot = "file://"
|
|
4241
|
+
var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
|
|
4241
4242
|
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
|
|
4242
4243
|
var node = _a[_i];
|
|
4243
4244
|
if (node.callFrame.url) {
|
|
@@ -4246,7 +4247,7 @@ var ts;
|
|
|
4246
4247
|
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), true);
|
|
4247
4248
|
}
|
|
4248
4249
|
else if (!nativePattern.test(url)) {
|
|
4249
|
-
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external"
|
|
4250
|
+
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
|
|
4250
4251
|
externalFileCounter++;
|
|
4251
4252
|
}
|
|
4252
4253
|
}
|
|
@@ -4262,7 +4263,7 @@ var ts;
|
|
|
4262
4263
|
if (!err) {
|
|
4263
4264
|
try {
|
|
4264
4265
|
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
4265
|
-
profilePath = _path.join(profilePath,
|
|
4266
|
+
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
4266
4267
|
}
|
|
4267
4268
|
}
|
|
4268
4269
|
catch (_c) {
|
|
@@ -4347,7 +4348,7 @@ var ts;
|
|
|
4347
4348
|
}
|
|
4348
4349
|
};
|
|
4349
4350
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
4350
|
-
sysLog("sysLog:: "
|
|
4351
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
4351
4352
|
callback("rename", "");
|
|
4352
4353
|
if (watcher) {
|
|
4353
4354
|
watcher.close();
|
|
@@ -4364,7 +4365,7 @@ var ts;
|
|
|
4364
4365
|
}
|
|
4365
4366
|
}
|
|
4366
4367
|
if (hitSystemWatcherLimit) {
|
|
4367
|
-
sysLog("sysLog:: "
|
|
4368
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
4368
4369
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4369
4370
|
}
|
|
4370
4371
|
try {
|
|
@@ -4376,7 +4377,7 @@ var ts;
|
|
|
4376
4377
|
}
|
|
4377
4378
|
catch (e) {
|
|
4378
4379
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
4379
|
-
sysLog("sysLog:: "
|
|
4380
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
4380
4381
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4381
4382
|
}
|
|
4382
4383
|
}
|
|
@@ -4885,18 +4886,6 @@ var ts;
|
|
|
4885
4886
|
return getCanonicalFileName(nonCanonicalizedPath);
|
|
4886
4887
|
}
|
|
4887
4888
|
ts.toPath = toPath;
|
|
4888
|
-
function normalizePathAndParts(path) {
|
|
4889
|
-
path = normalizeSlashes(path);
|
|
4890
|
-
var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
|
|
4891
|
-
if (parts.length) {
|
|
4892
|
-
var joinedParts = root + parts.join(ts.directorySeparator);
|
|
4893
|
-
return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
|
|
4894
|
-
}
|
|
4895
|
-
else {
|
|
4896
|
-
return { path: root, parts: parts };
|
|
4897
|
-
}
|
|
4898
|
-
}
|
|
4899
|
-
ts.normalizePathAndParts = normalizePathAndParts;
|
|
4900
4889
|
function removeTrailingDirectorySeparator(path) {
|
|
4901
4890
|
if (hasTrailingDirectorySeparator(path)) {
|
|
4902
4891
|
return path.substr(0, path.length - 1);
|
|
@@ -5295,6 +5284,8 @@ var ts;
|
|
|
5295
5284
|
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
|
|
5296
5285
|
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
|
|
5297
5286
|
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
|
|
5287
|
+
Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
|
|
5288
|
+
Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
|
|
5298
5289
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5299
5290
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5300
5291
|
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
@@ -5363,7 +5354,6 @@ var ts;
|
|
|
5363
5354
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
5364
5355
|
Unexpected_token_Did_you_mean_or_gt: diag(1382, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
|
|
5365
5356
|
Only_named_exports_may_use_export_type: diag(1383, ts.DiagnosticCategory.Error, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
|
|
5366
|
-
A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list: diag(1384, ts.DiagnosticCategory.Error, "A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384", "A 'new' expression with type arguments must always be followed by a parenthesized argument list."),
|
|
5367
5357
|
Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
|
|
5368
5358
|
Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
|
|
5369
5359
|
Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
|
|
@@ -5428,6 +5418,8 @@ var ts;
|
|
|
5428
5418
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
5429
5419
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
5430
5420
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5421
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`."),
|
|
5422
|
+
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
5431
5423
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
5432
5424
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
5433
5425
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -5747,6 +5739,7 @@ var ts;
|
|
|
5747
5739
|
Cannot_assign_to_0_because_it_is_an_import: diag(2632, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."),
|
|
5748
5740
|
JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, ts.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
|
|
5749
5741
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
5742
|
+
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
5750
5743
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
5751
5744
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
5752
5745
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -7082,7 +7075,7 @@ var ts;
|
|
|
7082
7075
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
7083
7076
|
}
|
|
7084
7077
|
else {
|
|
7085
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
7078
|
+
ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
|
|
7086
7079
|
}
|
|
7087
7080
|
}
|
|
7088
7081
|
var res = lineStarts[line] + character;
|
|
@@ -9597,7 +9590,7 @@ var ts;
|
|
|
9597
9590
|
: "linkplain";
|
|
9598
9591
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
9599
9592
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
9600
|
-
return "{@"
|
|
9593
|
+
return "{@" + kind + " " + name + space + link.text + "}";
|
|
9601
9594
|
}
|
|
9602
9595
|
function getEffectiveTypeParameterDeclarations(node) {
|
|
9603
9596
|
if (ts.isJSDocSignature(node)) {
|
|
@@ -10103,6 +10096,7 @@ var ts;
|
|
|
10103
10096
|
case 110:
|
|
10104
10097
|
case 106:
|
|
10105
10098
|
case 229:
|
|
10099
|
+
case 227:
|
|
10106
10100
|
case 230:
|
|
10107
10101
|
case 100:
|
|
10108
10102
|
return true;
|
|
@@ -10691,11 +10685,11 @@ var ts;
|
|
|
10691
10685
|
}
|
|
10692
10686
|
function packageIdToPackageName(_a) {
|
|
10693
10687
|
var name = _a.name, subModuleName = _a.subModuleName;
|
|
10694
|
-
return subModuleName ?
|
|
10688
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
10695
10689
|
}
|
|
10696
10690
|
ts.packageIdToPackageName = packageIdToPackageName;
|
|
10697
10691
|
function packageIdToString(packageId) {
|
|
10698
|
-
return
|
|
10692
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
10699
10693
|
}
|
|
10700
10694
|
ts.packageIdToString = packageIdToString;
|
|
10701
10695
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -10708,7 +10702,10 @@ var ts;
|
|
|
10708
10702
|
ts.Debug.assert(names.length === newResolutions.length);
|
|
10709
10703
|
for (var i = 0; i < names.length; i++) {
|
|
10710
10704
|
var newResolution = newResolutions[i];
|
|
10711
|
-
var
|
|
10705
|
+
var entry = names[i];
|
|
10706
|
+
var name = !ts.isString(entry) ? entry.fileName.toLowerCase() : entry;
|
|
10707
|
+
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.impliedNodeFormat) : oldSourceFile && ts.getModeForResolutionAtIndex(oldSourceFile, i);
|
|
10708
|
+
var oldResolution = oldResolutions && oldResolutions.get(name, mode);
|
|
10712
10709
|
var changed = oldResolution
|
|
10713
10710
|
? !newResolution || !comparer(oldResolution, newResolution)
|
|
10714
10711
|
: newResolution;
|
|
@@ -10769,7 +10766,7 @@ var ts;
|
|
|
10769
10766
|
function nodePosToString(node) {
|
|
10770
10767
|
var file = getSourceFileOfNode(node);
|
|
10771
10768
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
10772
|
-
return
|
|
10769
|
+
return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
|
|
10773
10770
|
}
|
|
10774
10771
|
ts.nodePosToString = nodePosToString;
|
|
10775
10772
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -10870,7 +10867,7 @@ var ts;
|
|
|
10870
10867
|
ts.isPinnedComment = isPinnedComment;
|
|
10871
10868
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
10872
10869
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
10873
|
-
""
|
|
10870
|
+
"" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
|
|
10874
10871
|
commentDirective,
|
|
10875
10872
|
]); }));
|
|
10876
10873
|
var usedLines = new ts.Map();
|
|
@@ -10887,10 +10884,10 @@ var ts;
|
|
|
10887
10884
|
});
|
|
10888
10885
|
}
|
|
10889
10886
|
function markUsed(line) {
|
|
10890
|
-
if (!directivesByLine.has(""
|
|
10887
|
+
if (!directivesByLine.has("" + line)) {
|
|
10891
10888
|
return false;
|
|
10892
10889
|
}
|
|
10893
|
-
usedLines.set(""
|
|
10890
|
+
usedLines.set("" + line, true);
|
|
10894
10891
|
return true;
|
|
10895
10892
|
}
|
|
10896
10893
|
}
|
|
@@ -11089,7 +11086,7 @@ var ts;
|
|
|
11089
11086
|
}
|
|
11090
11087
|
return node.text;
|
|
11091
11088
|
}
|
|
11092
|
-
return ts.Debug.fail("Literal kind '"
|
|
11089
|
+
return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
|
|
11093
11090
|
}
|
|
11094
11091
|
ts.getLiteralText = getLiteralText;
|
|
11095
11092
|
function canUseOriginalText(node, flags) {
|
|
@@ -11628,7 +11625,7 @@ var ts;
|
|
|
11628
11625
|
case 114:
|
|
11629
11626
|
return node.parent.kind !== 216;
|
|
11630
11627
|
case 227:
|
|
11631
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11628
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11632
11629
|
case 162:
|
|
11633
11630
|
return node.parent.kind === 194 || node.parent.kind === 189;
|
|
11634
11631
|
case 79:
|
|
@@ -11654,7 +11651,7 @@ var ts;
|
|
|
11654
11651
|
}
|
|
11655
11652
|
switch (parent.kind) {
|
|
11656
11653
|
case 227:
|
|
11657
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11654
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11658
11655
|
case 162:
|
|
11659
11656
|
return node === parent.constraint;
|
|
11660
11657
|
case 342:
|
|
@@ -12293,7 +12290,7 @@ var ts;
|
|
|
12293
12290
|
case 296:
|
|
12294
12291
|
return true;
|
|
12295
12292
|
case 227:
|
|
12296
|
-
return parent.expression === node &&
|
|
12293
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
12297
12294
|
case 295:
|
|
12298
12295
|
return parent.objectAssignmentInitializer === node;
|
|
12299
12296
|
default:
|
|
@@ -13424,11 +13421,11 @@ var ts;
|
|
|
13424
13421
|
}
|
|
13425
13422
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
13426
13423
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
13427
|
-
return "__@"
|
|
13424
|
+
return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
|
|
13428
13425
|
}
|
|
13429
13426
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
13430
13427
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
13431
|
-
return "__#"
|
|
13428
|
+
return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
|
|
13432
13429
|
}
|
|
13433
13430
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
13434
13431
|
function isKnownSymbol(symbol) {
|
|
@@ -15725,7 +15722,7 @@ var ts;
|
|
|
15725
15722
|
}
|
|
15726
15723
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
15727
15724
|
function getJSXRuntimeImport(base, options) {
|
|
15728
|
-
return base ?
|
|
15725
|
+
return base ? base + "/" + (options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
15729
15726
|
}
|
|
15730
15727
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
15731
15728
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -15823,15 +15820,15 @@ var ts;
|
|
|
15823
15820
|
}
|
|
15824
15821
|
var wildcardCharCodes = [42, 63];
|
|
15825
15822
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
15826
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
15823
|
+
var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
|
|
15827
15824
|
var filesMatcher = {
|
|
15828
15825
|
singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
|
|
15829
|
-
doubleAsteriskRegexFragment: "(/"
|
|
15826
|
+
doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
|
|
15830
15827
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
15831
15828
|
};
|
|
15832
15829
|
var directoriesMatcher = {
|
|
15833
15830
|
singleAsteriskRegexFragment: "[^/]*",
|
|
15834
|
-
doubleAsteriskRegexFragment: "(/"
|
|
15831
|
+
doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
|
|
15835
15832
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
15836
15833
|
};
|
|
15837
15834
|
var excludeMatcher = {
|
|
@@ -15849,9 +15846,9 @@ var ts;
|
|
|
15849
15846
|
if (!patterns || !patterns.length) {
|
|
15850
15847
|
return undefined;
|
|
15851
15848
|
}
|
|
15852
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
15849
|
+
var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
|
|
15853
15850
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
15854
|
-
return "^("
|
|
15851
|
+
return "^(" + pattern + ")" + terminator;
|
|
15855
15852
|
}
|
|
15856
15853
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
15857
15854
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -15869,7 +15866,7 @@ var ts;
|
|
|
15869
15866
|
ts.isImplicitGlob = isImplicitGlob;
|
|
15870
15867
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
15871
15868
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
15872
|
-
return pattern && "^("
|
|
15869
|
+
return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
|
|
15873
15870
|
}
|
|
15874
15871
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
15875
15872
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -15935,7 +15932,7 @@ var ts;
|
|
|
15935
15932
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
15936
15933
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
15937
15934
|
return {
|
|
15938
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
15935
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
|
|
15939
15936
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
15940
15937
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
15941
15938
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -16180,7 +16177,7 @@ var ts;
|
|
|
16180
16177
|
ts.resolutionExtensionIsTSOrJson = resolutionExtensionIsTSOrJson;
|
|
16181
16178
|
function extensionFromPath(path) {
|
|
16182
16179
|
var ext = tryGetExtensionFromPath(path);
|
|
16183
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
16180
|
+
return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
|
|
16184
16181
|
}
|
|
16185
16182
|
ts.extensionFromPath = extensionFromPath;
|
|
16186
16183
|
function isAnySupportedFileExtension(path) {
|
|
@@ -18279,15 +18276,17 @@ var ts;
|
|
|
18279
18276
|
function updateConstructorTypeNode2(node, typeParameters, parameters, type) {
|
|
18280
18277
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
18281
18278
|
}
|
|
18282
|
-
function createTypeQueryNode(exprName) {
|
|
18279
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
18283
18280
|
var node = createBaseNode(180);
|
|
18284
18281
|
node.exprName = exprName;
|
|
18282
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
18285
18283
|
node.transformFlags = 1;
|
|
18286
18284
|
return node;
|
|
18287
18285
|
}
|
|
18288
|
-
function updateTypeQueryNode(node, exprName) {
|
|
18286
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
18289
18287
|
return node.exprName !== exprName
|
|
18290
|
-
|
|
18288
|
+
|| node.typeArguments !== typeArguments
|
|
18289
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
18291
18290
|
: node;
|
|
18292
18291
|
}
|
|
18293
18292
|
function createTypeLiteralNode(members) {
|
|
@@ -21251,7 +21250,7 @@ var ts;
|
|
|
21251
21250
|
case 326: return "augments";
|
|
21252
21251
|
case 327: return "implements";
|
|
21253
21252
|
default:
|
|
21254
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
21253
|
+
return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
|
|
21255
21254
|
}
|
|
21256
21255
|
}
|
|
21257
21256
|
var rawTextScanner;
|
|
@@ -21479,7 +21478,13 @@ var ts;
|
|
|
21479
21478
|
referencedFiles = ts.append(referencedFiles, { pos: -1, end: -1, fileName: section.data });
|
|
21480
21479
|
break;
|
|
21481
21480
|
case "type":
|
|
21482
|
-
typeReferenceDirectives = ts.append(typeReferenceDirectives, section.data);
|
|
21481
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data });
|
|
21482
|
+
break;
|
|
21483
|
+
case "type-import":
|
|
21484
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts.ModuleKind.ESNext });
|
|
21485
|
+
break;
|
|
21486
|
+
case "type-require":
|
|
21487
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts.ModuleKind.CommonJS });
|
|
21483
21488
|
break;
|
|
21484
21489
|
case "lib":
|
|
21485
21490
|
libReferenceDirectives = ts.append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data });
|
|
@@ -21537,6 +21542,8 @@ var ts;
|
|
|
21537
21542
|
case "no-default-lib":
|
|
21538
21543
|
case "reference":
|
|
21539
21544
|
case "type":
|
|
21545
|
+
case "type-import":
|
|
21546
|
+
case "type-require":
|
|
21540
21547
|
case "lib":
|
|
21541
21548
|
syntheticReferences = ts.append(syntheticReferences, ts.setTextRange(ts.factory.createUnparsedSyntheticReference(section), section));
|
|
21542
21549
|
break;
|
|
@@ -21570,7 +21577,7 @@ var ts;
|
|
|
21570
21577
|
};
|
|
21571
21578
|
var definedTextGetter_1 = function (path) {
|
|
21572
21579
|
var result = textGetter_1(path);
|
|
21573
|
-
return result !== undefined ? result : "/* Input file "
|
|
21580
|
+
return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
|
|
21574
21581
|
};
|
|
21575
21582
|
var buildInfo_1;
|
|
21576
21583
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -24121,7 +24128,8 @@ var ts;
|
|
|
24121
24128
|
visitNode(cbNode, node.parameterName) ||
|
|
24122
24129
|
visitNode(cbNode, node.type);
|
|
24123
24130
|
case 180:
|
|
24124
|
-
return visitNode(cbNode, node.exprName)
|
|
24131
|
+
return visitNode(cbNode, node.exprName) ||
|
|
24132
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
24125
24133
|
case 181:
|
|
24126
24134
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
24127
24135
|
case 182:
|
|
@@ -24677,7 +24685,7 @@ var ts;
|
|
|
24677
24685
|
function parseIsolatedEntityName(content, languageVersion) {
|
|
24678
24686
|
initializeState("", content, languageVersion, undefined, 1);
|
|
24679
24687
|
nextToken();
|
|
24680
|
-
var entityName = parseEntityName(true);
|
|
24688
|
+
var entityName = parseEntityName(true, false);
|
|
24681
24689
|
var isInvalid = token() === 1 && !parseDiagnostics.length;
|
|
24682
24690
|
clearState();
|
|
24683
24691
|
return isInvalid ? entityName : undefined;
|
|
@@ -25232,7 +25240,7 @@ var ts;
|
|
|
25232
25240
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
25233
25241
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
25234
25242
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
25235
|
-
return
|
|
25243
|
+
return keyword + " " + expressionText.slice(keyword.length);
|
|
25236
25244
|
}
|
|
25237
25245
|
}
|
|
25238
25246
|
return undefined;
|
|
@@ -25975,7 +25983,7 @@ var ts;
|
|
|
25975
25983
|
}
|
|
25976
25984
|
return createMissingList();
|
|
25977
25985
|
}
|
|
25978
|
-
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
25986
|
+
function parseEntityName(allowReservedWords, allowPrivateIdentifiers, diagnosticMessage) {
|
|
25979
25987
|
var pos = getNodePos();
|
|
25980
25988
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
25981
25989
|
var dotPos = getNodePos();
|
|
@@ -25985,7 +25993,7 @@ var ts;
|
|
|
25985
25993
|
break;
|
|
25986
25994
|
}
|
|
25987
25995
|
dotPos = getNodePos();
|
|
25988
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords,
|
|
25996
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers)), pos);
|
|
25989
25997
|
}
|
|
25990
25998
|
return entity;
|
|
25991
25999
|
}
|
|
@@ -26088,7 +26096,7 @@ var ts;
|
|
|
26088
26096
|
return finishNode(node, pos);
|
|
26089
26097
|
}
|
|
26090
26098
|
function parseEntityNameOfTypeReference() {
|
|
26091
|
-
return parseEntityName(true, ts.Diagnostics.Type_expected);
|
|
26099
|
+
return parseEntityName(true, false, ts.Diagnostics.Type_expected);
|
|
26092
26100
|
}
|
|
26093
26101
|
function parseTypeArgumentsOfTypeReference() {
|
|
26094
26102
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) {
|
|
@@ -26202,7 +26210,9 @@ var ts;
|
|
|
26202
26210
|
function parseTypeQuery() {
|
|
26203
26211
|
var pos = getNodePos();
|
|
26204
26212
|
parseExpected(112);
|
|
26205
|
-
|
|
26213
|
+
var entityName = parseEntityName(true, true);
|
|
26214
|
+
var typeArguments = tryParseTypeArguments();
|
|
26215
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26206
26216
|
}
|
|
26207
26217
|
function parseTypeParameter() {
|
|
26208
26218
|
var pos = getNodePos();
|
|
@@ -27759,19 +27769,28 @@ var ts;
|
|
|
27759
27769
|
expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);
|
|
27760
27770
|
continue;
|
|
27761
27771
|
}
|
|
27762
|
-
if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) {
|
|
27763
|
-
nextToken();
|
|
27764
|
-
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
27765
|
-
continue;
|
|
27766
|
-
}
|
|
27767
27772
|
if ((questionDotToken || !inDecoratorContext()) && parseOptional(22)) {
|
|
27768
27773
|
expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);
|
|
27769
27774
|
continue;
|
|
27770
27775
|
}
|
|
27771
27776
|
if (isTemplateStartOfTaggedTemplate()) {
|
|
27772
|
-
expression =
|
|
27777
|
+
expression = !questionDotToken && expression.kind === 227 ?
|
|
27778
|
+
parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) :
|
|
27779
|
+
parseTaggedTemplateRest(pos, expression, questionDotToken, undefined);
|
|
27773
27780
|
continue;
|
|
27774
27781
|
}
|
|
27782
|
+
if (!questionDotToken) {
|
|
27783
|
+
if (token() === 53 && !scanner.hasPrecedingLineBreak()) {
|
|
27784
|
+
nextToken();
|
|
27785
|
+
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
27786
|
+
continue;
|
|
27787
|
+
}
|
|
27788
|
+
var typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
27789
|
+
if (typeArguments) {
|
|
27790
|
+
expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
27791
|
+
continue;
|
|
27792
|
+
}
|
|
27793
|
+
}
|
|
27775
27794
|
return expression;
|
|
27776
27795
|
}
|
|
27777
27796
|
}
|
|
@@ -27791,27 +27810,24 @@ var ts;
|
|
|
27791
27810
|
function parseCallExpressionRest(pos, expression) {
|
|
27792
27811
|
while (true) {
|
|
27793
27812
|
expression = parseMemberExpressionRest(pos, expression, true);
|
|
27813
|
+
var typeArguments = void 0;
|
|
27794
27814
|
var questionDotToken = parseOptionalToken(28);
|
|
27795
|
-
if (
|
|
27796
|
-
|
|
27797
|
-
if (
|
|
27798
|
-
|
|
27799
|
-
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27800
|
-
continue;
|
|
27801
|
-
}
|
|
27802
|
-
var argumentList = parseArgumentList();
|
|
27803
|
-
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27804
|
-
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27805
|
-
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27806
|
-
expression = finishNode(callExpr, pos);
|
|
27815
|
+
if (questionDotToken) {
|
|
27816
|
+
typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
27817
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
27818
|
+
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27807
27819
|
continue;
|
|
27808
27820
|
}
|
|
27809
27821
|
}
|
|
27810
|
-
|
|
27822
|
+
if (typeArguments || token() === 20) {
|
|
27823
|
+
if (!questionDotToken && expression.kind === 227) {
|
|
27824
|
+
typeArguments = expression.typeArguments;
|
|
27825
|
+
expression = expression.expression;
|
|
27826
|
+
}
|
|
27811
27827
|
var argumentList = parseArgumentList();
|
|
27812
27828
|
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27813
|
-
factory.createCallChain(expression, questionDotToken,
|
|
27814
|
-
factory.createCallExpression(expression,
|
|
27829
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27830
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27815
27831
|
expression = finishNode(callExpr, pos);
|
|
27816
27832
|
continue;
|
|
27817
27833
|
}
|
|
@@ -27841,16 +27857,16 @@ var ts;
|
|
|
27841
27857
|
if (!parseExpected(31)) {
|
|
27842
27858
|
return undefined;
|
|
27843
27859
|
}
|
|
27844
|
-
return typeArguments && canFollowTypeArgumentsInExpression()
|
|
27845
|
-
? typeArguments
|
|
27846
|
-
: undefined;
|
|
27860
|
+
return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined;
|
|
27847
27861
|
}
|
|
27848
27862
|
function canFollowTypeArgumentsInExpression() {
|
|
27849
27863
|
switch (token()) {
|
|
27850
27864
|
case 20:
|
|
27851
27865
|
case 14:
|
|
27852
27866
|
case 15:
|
|
27867
|
+
case 27:
|
|
27853
27868
|
case 24:
|
|
27869
|
+
case 28:
|
|
27854
27870
|
case 21:
|
|
27855
27871
|
case 23:
|
|
27856
27872
|
case 58:
|
|
@@ -27869,11 +27885,8 @@ var ts;
|
|
|
27869
27885
|
case 19:
|
|
27870
27886
|
case 1:
|
|
27871
27887
|
return true;
|
|
27872
|
-
case 27:
|
|
27873
|
-
case 18:
|
|
27874
|
-
default:
|
|
27875
|
-
return false;
|
|
27876
27888
|
}
|
|
27889
|
+
return false;
|
|
27877
27890
|
}
|
|
27878
27891
|
function parsePrimaryExpression() {
|
|
27879
27892
|
switch (token()) {
|
|
@@ -28037,26 +28050,14 @@ var ts;
|
|
|
28037
28050
|
return finishNode(factory.createMetaProperty(103, name), pos);
|
|
28038
28051
|
}
|
|
28039
28052
|
var expressionPos = getNodePos();
|
|
28040
|
-
var expression = parsePrimaryExpression();
|
|
28053
|
+
var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
|
|
28041
28054
|
var typeArguments;
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
if (isTemplateStartOfTaggedTemplate()) {
|
|
28046
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
28047
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, undefined, typeArguments);
|
|
28048
|
-
typeArguments = undefined;
|
|
28049
|
-
}
|
|
28050
|
-
break;
|
|
28051
|
-
}
|
|
28052
|
-
var argumentsArray;
|
|
28053
|
-
if (token() === 20) {
|
|
28054
|
-
argumentsArray = parseArgumentList();
|
|
28055
|
-
}
|
|
28056
|
-
else if (typeArguments) {
|
|
28057
|
-
parseErrorAt(pos, scanner.getStartPos(), ts.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list);
|
|
28055
|
+
if (expression.kind === 227) {
|
|
28056
|
+
typeArguments = expression.typeArguments;
|
|
28057
|
+
expression = expression.expression;
|
|
28058
28058
|
}
|
|
28059
|
-
|
|
28059
|
+
var argumentList = token() === 20 ? parseArgumentList() : undefined;
|
|
28060
|
+
return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos);
|
|
28060
28061
|
}
|
|
28061
28062
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
28062
28063
|
var pos = getNodePos();
|
|
@@ -28213,11 +28214,12 @@ var ts;
|
|
|
28213
28214
|
}
|
|
28214
28215
|
function parseCaseClause() {
|
|
28215
28216
|
var pos = getNodePos();
|
|
28217
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28216
28218
|
parseExpected(82);
|
|
28217
28219
|
var expression = allowInAnd(parseExpression);
|
|
28218
28220
|
parseExpected(58);
|
|
28219
28221
|
var statements = parseList(3, parseStatement);
|
|
28220
|
-
return finishNode(factory.createCaseClause(expression, statements), pos);
|
|
28222
|
+
return withJSDoc(finishNode(factory.createCaseClause(expression, statements), pos), hasJSDoc);
|
|
28221
28223
|
}
|
|
28222
28224
|
function parseDefaultClause() {
|
|
28223
28225
|
var pos = getNodePos();
|
|
@@ -29021,6 +29023,9 @@ var ts;
|
|
|
29021
29023
|
function parseExpressionWithTypeArguments() {
|
|
29022
29024
|
var pos = getNodePos();
|
|
29023
29025
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
29026
|
+
if (expression.kind === 227) {
|
|
29027
|
+
return expression;
|
|
29028
|
+
}
|
|
29024
29029
|
var typeArguments = tryParseTypeArguments();
|
|
29025
29030
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
29026
29031
|
}
|
|
@@ -29240,7 +29245,7 @@ var ts;
|
|
|
29240
29245
|
function parseModuleReference() {
|
|
29241
29246
|
return isExternalModuleReference()
|
|
29242
29247
|
? parseExternalModuleReference()
|
|
29243
|
-
: parseEntityName(false);
|
|
29248
|
+
: parseEntityName(false, false);
|
|
29244
29249
|
}
|
|
29245
29250
|
function parseExternalModuleReference() {
|
|
29246
29251
|
var pos = getNodePos();
|
|
@@ -29448,7 +29453,7 @@ var ts;
|
|
|
29448
29453
|
var pos = getNodePos();
|
|
29449
29454
|
var hasBrace = parseOptional(18);
|
|
29450
29455
|
var p2 = getNodePos();
|
|
29451
|
-
var entityName = parseEntityName(false);
|
|
29456
|
+
var entityName = parseEntityName(false, false);
|
|
29452
29457
|
while (token() === 80) {
|
|
29453
29458
|
reScanHashToken();
|
|
29454
29459
|
nextTokenJSDoc();
|
|
@@ -29850,7 +29855,7 @@ var ts;
|
|
|
29850
29855
|
skipWhitespace();
|
|
29851
29856
|
var p2 = getNodePos();
|
|
29852
29857
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
29853
|
-
? parseEntityName(true)
|
|
29858
|
+
? parseEntityName(true, false)
|
|
29854
29859
|
: undefined;
|
|
29855
29860
|
if (name) {
|
|
29856
29861
|
while (token() === 80) {
|
|
@@ -29875,11 +29880,13 @@ var ts;
|
|
|
29875
29880
|
&& nextTokenJSDoc() === 59
|
|
29876
29881
|
&& ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
29877
29882
|
var kind = scanner.getTokenValue();
|
|
29878
|
-
if (kind
|
|
29883
|
+
if (isJSDocLinkTag(kind))
|
|
29879
29884
|
return kind;
|
|
29880
|
-
}
|
|
29881
29885
|
}
|
|
29882
29886
|
}
|
|
29887
|
+
function isJSDocLinkTag(kind) {
|
|
29888
|
+
return kind === "link" || kind === "linkcode" || kind === "linkplain";
|
|
29889
|
+
}
|
|
29883
29890
|
function parseUnknownTag(start, tagName, indent, indentText) {
|
|
29884
29891
|
return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
|
|
29885
29892
|
}
|
|
@@ -29982,7 +29989,7 @@ var ts;
|
|
|
29982
29989
|
}
|
|
29983
29990
|
function parseSeeTag(start, tagName, indent, indentText) {
|
|
29984
29991
|
var isMarkdownOrJSDocLink = token() === 22
|
|
29985
|
-
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue()
|
|
29992
|
+
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()); });
|
|
29986
29993
|
var nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
|
|
29987
29994
|
var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
|
|
29988
29995
|
return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
|
|
@@ -30637,6 +30644,19 @@ var ts;
|
|
|
30637
30644
|
return ts.fileExtensionIsOneOf(fileName, [".d.ts", ".d.mts", ".d.cts"]);
|
|
30638
30645
|
}
|
|
30639
30646
|
ts.isDeclarationFileName = isDeclarationFileName;
|
|
30647
|
+
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
30648
|
+
if (!mode) {
|
|
30649
|
+
return undefined;
|
|
30650
|
+
}
|
|
30651
|
+
if (mode === "import") {
|
|
30652
|
+
return ts.ModuleKind.ESNext;
|
|
30653
|
+
}
|
|
30654
|
+
if (mode === "require") {
|
|
30655
|
+
return ts.ModuleKind.CommonJS;
|
|
30656
|
+
}
|
|
30657
|
+
reportDiagnostic(pos, end - pos, ts.Diagnostics.resolution_mode_should_be_either_require_or_import);
|
|
30658
|
+
return undefined;
|
|
30659
|
+
}
|
|
30640
30660
|
function processCommentPragmas(context, sourceText) {
|
|
30641
30661
|
var pragmas = [];
|
|
30642
30662
|
for (var _i = 0, _a = ts.getLeadingCommentRanges(sourceText, 0) || ts.emptyArray; _i < _a.length; _i++) {
|
|
@@ -30675,12 +30695,13 @@ var ts;
|
|
|
30675
30695
|
var typeReferenceDirectives_1 = context.typeReferenceDirectives;
|
|
30676
30696
|
var libReferenceDirectives_1 = context.libReferenceDirectives;
|
|
30677
30697
|
ts.forEach(ts.toArray(entryOrList), function (arg) {
|
|
30678
|
-
var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path;
|
|
30698
|
+
var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path, res = _a["resolution-mode"];
|
|
30679
30699
|
if (arg.arguments["no-default-lib"]) {
|
|
30680
30700
|
context.hasNoDefaultLib = true;
|
|
30681
30701
|
}
|
|
30682
30702
|
else if (types) {
|
|
30683
|
-
|
|
30703
|
+
var parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
|
30704
|
+
typeReferenceDirectives_1.push(__assign({ pos: types.pos, end: types.end, fileName: types.value }, (parsed ? { resolutionMode: parsed } : {})));
|
|
30684
30705
|
}
|
|
30685
30706
|
else if (lib) {
|
|
30686
30707
|
libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value });
|
|
@@ -30741,7 +30762,7 @@ var ts;
|
|
|
30741
30762
|
if (namedArgRegExCache.has(name)) {
|
|
30742
30763
|
return namedArgRegExCache.get(name);
|
|
30743
30764
|
}
|
|
30744
|
-
var result = new RegExp("(\\s"
|
|
30765
|
+
var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
|
|
30745
30766
|
namedArgRegExCache.set(name, result);
|
|
30746
30767
|
return result;
|
|
30747
30768
|
}
|
|
@@ -32151,8 +32172,8 @@ var ts;
|
|
|
32151
32172
|
}
|
|
32152
32173
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
32153
32174
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
32154
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
32155
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
32175
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
|
|
32176
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
|
|
32156
32177
|
}
|
|
32157
32178
|
function parseCustomTypeOption(opt, value, errors) {
|
|
32158
32179
|
return convertJsonOptionOfCustomType(opt, ts.trimString(value || ""), errors);
|
|
@@ -32869,10 +32890,10 @@ var ts;
|
|
|
32869
32890
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
32870
32891
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
32871
32892
|
if (newValue !== defaultValue) {
|
|
32872
|
-
result.push(""
|
|
32893
|
+
result.push("" + tab + cmd.name + ": " + newValue);
|
|
32873
32894
|
}
|
|
32874
32895
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
32875
|
-
result.push(""
|
|
32896
|
+
result.push("" + tab + cmd.name + ": " + defaultValue);
|
|
32876
32897
|
}
|
|
32877
32898
|
});
|
|
32878
32899
|
return result.join(newLine) + newLine;
|
|
@@ -32910,19 +32931,19 @@ var ts;
|
|
|
32910
32931
|
if (entries.length !== 0) {
|
|
32911
32932
|
entries.push({ value: "" });
|
|
32912
32933
|
}
|
|
32913
|
-
entries.push({ value: "/* "
|
|
32934
|
+
entries.push({ value: "/* " + category + " */" });
|
|
32914
32935
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
32915
32936
|
var option = options_1[_i];
|
|
32916
32937
|
var optionName = void 0;
|
|
32917
32938
|
if (compilerOptionsMap.has(option.name)) {
|
|
32918
|
-
optionName = "\""
|
|
32939
|
+
optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
32919
32940
|
}
|
|
32920
32941
|
else {
|
|
32921
|
-
optionName = "// \""
|
|
32942
|
+
optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
|
|
32922
32943
|
}
|
|
32923
32944
|
entries.push({
|
|
32924
32945
|
value: optionName,
|
|
32925
|
-
description: "/* "
|
|
32946
|
+
description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
|
|
32926
32947
|
});
|
|
32927
32948
|
marginLength = Math.max(optionName.length, marginLength);
|
|
32928
32949
|
}
|
|
@@ -32930,24 +32951,24 @@ var ts;
|
|
|
32930
32951
|
var tab = makePadding(2);
|
|
32931
32952
|
var result = [];
|
|
32932
32953
|
result.push("{");
|
|
32933
|
-
result.push(
|
|
32934
|
-
result.push(""
|
|
32954
|
+
result.push(tab + "\"compilerOptions\": {");
|
|
32955
|
+
result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
|
|
32935
32956
|
result.push("");
|
|
32936
32957
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
32937
32958
|
var entry = entries_2[_a];
|
|
32938
32959
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
32939
|
-
result.push(value && ""
|
|
32960
|
+
result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
|
|
32940
32961
|
}
|
|
32941
32962
|
if (fileNames.length) {
|
|
32942
|
-
result.push(
|
|
32943
|
-
result.push(
|
|
32963
|
+
result.push(tab + "},");
|
|
32964
|
+
result.push(tab + "\"files\": [");
|
|
32944
32965
|
for (var i = 0; i < fileNames.length; i++) {
|
|
32945
|
-
result.push(""
|
|
32966
|
+
result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
|
|
32946
32967
|
}
|
|
32947
|
-
result.push(
|
|
32968
|
+
result.push(tab + "]");
|
|
32948
32969
|
}
|
|
32949
32970
|
else {
|
|
32950
|
-
result.push(
|
|
32971
|
+
result.push(tab + "}");
|
|
32951
32972
|
}
|
|
32952
32973
|
result.push("}");
|
|
32953
32974
|
return result.join(newLine) + newLine;
|
|
@@ -33297,7 +33318,7 @@ var ts;
|
|
|
33297
33318
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
33298
33319
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
33299
33320
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
|
|
33300
|
-
extendedConfigPath =
|
|
33321
|
+
extendedConfigPath = extendedConfigPath + ".json";
|
|
33301
33322
|
if (!host.fileExists(extendedConfigPath)) {
|
|
33302
33323
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
33303
33324
|
return undefined;
|
|
@@ -33493,7 +33514,7 @@ var ts;
|
|
|
33493
33514
|
if (ts.fileExtensionIs(file, ".json")) {
|
|
33494
33515
|
if (!jsonOnlyIncludeRegexes) {
|
|
33495
33516
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json"); });
|
|
33496
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
33517
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
|
|
33497
33518
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
33498
33519
|
}
|
|
33499
33520
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -33865,7 +33886,7 @@ var ts;
|
|
|
33865
33886
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
33866
33887
|
if (typeof bestVersionPaths !== "object") {
|
|
33867
33888
|
if (state.traceEnabled) {
|
|
33868
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
33889
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
|
|
33869
33890
|
}
|
|
33870
33891
|
return;
|
|
33871
33892
|
}
|
|
@@ -33923,14 +33944,14 @@ var ts;
|
|
|
33923
33944
|
var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
33924
33945
|
return ts.comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0;
|
|
33925
33946
|
}
|
|
33926
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache) {
|
|
33947
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
33927
33948
|
var traceEnabled = isTraceEnabled(options, host);
|
|
33928
33949
|
if (redirectedReference) {
|
|
33929
33950
|
options = redirectedReference.commandLine.options;
|
|
33930
33951
|
}
|
|
33931
33952
|
var containingDirectory = containingFile ? ts.getDirectoryPath(containingFile) : undefined;
|
|
33932
33953
|
var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
|
|
33933
|
-
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName,
|
|
33954
|
+
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, resolutionMode);
|
|
33934
33955
|
if (result) {
|
|
33935
33956
|
if (traceEnabled) {
|
|
33936
33957
|
trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -33965,7 +33986,11 @@ var ts;
|
|
|
33965
33986
|
}
|
|
33966
33987
|
var failedLookupLocations = [];
|
|
33967
33988
|
var features = getDefaultNodeResolutionFeatures(options);
|
|
33968
|
-
|
|
33989
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
33990
|
+
features |= NodeResolutionFeatures.EsmMode;
|
|
33991
|
+
}
|
|
33992
|
+
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
33993
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: conditions };
|
|
33969
33994
|
var resolved = primaryLookup();
|
|
33970
33995
|
var primary = true;
|
|
33971
33996
|
if (!resolved) {
|
|
@@ -33985,7 +34010,7 @@ var ts;
|
|
|
33985
34010
|
};
|
|
33986
34011
|
}
|
|
33987
34012
|
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
|
|
33988
|
-
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName,
|
|
34013
|
+
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, resolutionMode, result);
|
|
33989
34014
|
if (traceEnabled)
|
|
33990
34015
|
traceResult(result);
|
|
33991
34016
|
return result;
|
|
@@ -34034,7 +34059,7 @@ var ts;
|
|
|
34034
34059
|
result_4 = searchResult && searchResult.value;
|
|
34035
34060
|
}
|
|
34036
34061
|
else {
|
|
34037
|
-
var candidate =
|
|
34062
|
+
var candidate = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName).path;
|
|
34038
34063
|
result_4 = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, false, moduleResolutionState, true);
|
|
34039
34064
|
}
|
|
34040
34065
|
return resolvedTypeScriptOnly(result_4);
|
|
@@ -34234,7 +34259,7 @@ var ts;
|
|
|
34234
34259
|
};
|
|
34235
34260
|
return cache;
|
|
34236
34261
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
34237
|
-
var result = mode === undefined ? specifier :
|
|
34262
|
+
var result = mode === undefined ? specifier : mode + "|" + specifier;
|
|
34238
34263
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
34239
34264
|
return result;
|
|
34240
34265
|
}
|
|
@@ -34244,7 +34269,10 @@ var ts;
|
|
|
34244
34269
|
ts.Debug.assert(keys.length === values.length);
|
|
34245
34270
|
var map = createModeAwareCache();
|
|
34246
34271
|
for (var i = 0; i < keys.length; ++i) {
|
|
34247
|
-
|
|
34272
|
+
var entry = keys[i];
|
|
34273
|
+
var name = !ts.isString(entry) ? entry.fileName.toLowerCase() : entry;
|
|
34274
|
+
var mode = !ts.isString(entry) ? entry.resolutionMode || file.impliedNodeFormat : ts.getModeForResolutionAtIndex(file, i);
|
|
34275
|
+
map.set(name, mode, values[i]);
|
|
34248
34276
|
}
|
|
34249
34277
|
return map;
|
|
34250
34278
|
}
|
|
@@ -34264,7 +34292,7 @@ var ts;
|
|
|
34264
34292
|
}
|
|
34265
34293
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
34266
34294
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
34267
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName :
|
|
34295
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
|
|
34268
34296
|
}
|
|
34269
34297
|
function createPerModuleNameCache() {
|
|
34270
34298
|
var directoryPathMap = new ts.Map();
|
|
@@ -34392,10 +34420,10 @@ var ts;
|
|
|
34392
34420
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
34393
34421
|
break;
|
|
34394
34422
|
default:
|
|
34395
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
34423
|
+
return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
|
|
34396
34424
|
}
|
|
34397
34425
|
if (result && result.resolvedModule)
|
|
34398
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
34426
|
+
ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
|
|
34399
34427
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
34400
34428
|
if (perFolderCache) {
|
|
34401
34429
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -34525,7 +34553,7 @@ var ts;
|
|
|
34525
34553
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
34526
34554
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
34527
34555
|
if (!resolvedModule) {
|
|
34528
|
-
throw new Error("Could not resolve JS module '"
|
|
34556
|
+
throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
|
|
34529
34557
|
}
|
|
34530
34558
|
return resolvedModule.resolvedFileName;
|
|
34531
34559
|
}
|
|
@@ -34610,12 +34638,19 @@ var ts;
|
|
|
34610
34638
|
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
|
|
34611
34639
|
}
|
|
34612
34640
|
else {
|
|
34613
|
-
var _a =
|
|
34641
|
+
var _a = normalizePathForCJSResolution(containingDirectory, moduleName), candidate = _a.path, parts = _a.parts;
|
|
34614
34642
|
var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, false, state, true);
|
|
34615
34643
|
return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") });
|
|
34616
34644
|
}
|
|
34617
34645
|
}
|
|
34618
34646
|
}
|
|
34647
|
+
function normalizePathForCJSResolution(containingDirectory, moduleName) {
|
|
34648
|
+
var combined = ts.combinePaths(containingDirectory, moduleName);
|
|
34649
|
+
var parts = ts.getPathComponents(combined);
|
|
34650
|
+
var lastPart = ts.lastOrUndefined(parts);
|
|
34651
|
+
var path = lastPart === "." || lastPart === ".." ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(combined)) : ts.normalizePath(combined);
|
|
34652
|
+
return { path: path, parts: parts };
|
|
34653
|
+
}
|
|
34619
34654
|
function realPath(path, host, traceEnabled) {
|
|
34620
34655
|
if (!host.realpath) {
|
|
34621
34656
|
return path;
|
|
@@ -34624,7 +34659,7 @@ var ts;
|
|
|
34624
34659
|
if (traceEnabled) {
|
|
34625
34660
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
34626
34661
|
}
|
|
34627
|
-
ts.Debug.assert(host.fileExists(real),
|
|
34662
|
+
ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
|
|
34628
34663
|
return real;
|
|
34629
34664
|
}
|
|
34630
34665
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -34657,7 +34692,10 @@ var ts;
|
|
|
34657
34692
|
onlyRecordFailures = true;
|
|
34658
34693
|
}
|
|
34659
34694
|
}
|
|
34660
|
-
|
|
34695
|
+
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
|
|
34696
|
+
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
|
|
34697
|
+
}
|
|
34698
|
+
return undefined;
|
|
34661
34699
|
}
|
|
34662
34700
|
ts.nodeModulesPathPart = "/node_modules/";
|
|
34663
34701
|
function pathContainsNodeModules(path) {
|
|
@@ -34985,7 +35023,13 @@ var ts;
|
|
|
34985
35023
|
}
|
|
34986
35024
|
}
|
|
34987
35025
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
34988
|
-
|
|
35026
|
+
var features = state.features;
|
|
35027
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
35028
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
35029
|
+
}
|
|
35030
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, false);
|
|
35031
|
+
state.features = features;
|
|
35032
|
+
return result;
|
|
34989
35033
|
};
|
|
34990
35034
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
34991
35035
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -35056,7 +35100,7 @@ var ts;
|
|
|
35056
35100
|
return undefined;
|
|
35057
35101
|
}
|
|
35058
35102
|
var trailingParts = parts.slice(nameParts.length);
|
|
35059
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
35103
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
35060
35104
|
}
|
|
35061
35105
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
35062
35106
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -35314,6 +35358,12 @@ var ts;
|
|
|
35314
35358
|
}
|
|
35315
35359
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
35316
35360
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
35361
|
+
if (!pathAndExtension && packageInfo
|
|
35362
|
+
&& packageInfo.packageJsonContent.exports === undefined
|
|
35363
|
+
&& packageInfo.packageJsonContent.main === undefined
|
|
35364
|
+
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
35365
|
+
pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
|
|
35366
|
+
}
|
|
35317
35367
|
return withPackageId(packageInfo, pathAndExtension);
|
|
35318
35368
|
};
|
|
35319
35369
|
if (rest !== "") {
|
|
@@ -35368,7 +35418,7 @@ var ts;
|
|
|
35368
35418
|
return mangled;
|
|
35369
35419
|
}
|
|
35370
35420
|
function getTypesPackageName(packageName) {
|
|
35371
|
-
return "@types/"
|
|
35421
|
+
return "@types/" + mangleScopedPackageName(packageName);
|
|
35372
35422
|
}
|
|
35373
35423
|
ts.getTypesPackageName = getTypesPackageName;
|
|
35374
35424
|
function mangleScopedPackageName(packageName) {
|
|
@@ -35694,7 +35744,7 @@ var ts;
|
|
|
35694
35744
|
if (name) {
|
|
35695
35745
|
if (ts.isAmbientModule(node)) {
|
|
35696
35746
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
35697
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
35747
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
|
|
35698
35748
|
}
|
|
35699
35749
|
if (name.kind === 161) {
|
|
35700
35750
|
var nameExpression = name.expression;
|
|
@@ -35743,7 +35793,7 @@ var ts;
|
|
|
35743
35793
|
case 315:
|
|
35744
35794
|
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
|
|
35745
35795
|
case 163:
|
|
35746
|
-
ts.Debug.assert(node.parent.kind === 315, "Impossible parameter parent kind", function () { return "parent is: "
|
|
35796
|
+
ts.Debug.assert(node.parent.kind === 315, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
|
|
35747
35797
|
var functionType = node.parent;
|
|
35748
35798
|
var index = functionType.parameters.indexOf(node);
|
|
35749
35799
|
return "arg" + index;
|
|
@@ -35809,7 +35859,7 @@ var ts;
|
|
|
35809
35859
|
}
|
|
35810
35860
|
var relatedInformation_1 = [];
|
|
35811
35861
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1) && symbol.flags & (2097152 | 788968 | 1920)) {
|
|
35812
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
35862
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
|
|
35813
35863
|
}
|
|
35814
35864
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
35815
35865
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -37631,7 +37681,7 @@ var ts;
|
|
|
37631
37681
|
}
|
|
37632
37682
|
}
|
|
37633
37683
|
function bindSourceFileAsExternalModule() {
|
|
37634
|
-
bindAnonymousDeclaration(file, 512, "\""
|
|
37684
|
+
bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\"");
|
|
37635
37685
|
}
|
|
37636
37686
|
function bindExportAssignment(node) {
|
|
37637
37687
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -39350,7 +39400,7 @@ var ts;
|
|
|
39350
39400
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
39351
39401
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 ? sourceSymbolFile : targetSymbolFile;
|
|
39352
39402
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
39353
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates,
|
|
39403
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
|
|
39354
39404
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
39355
39405
|
});
|
|
39356
39406
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
@@ -41421,8 +41471,13 @@ var ts;
|
|
|
41421
41471
|
return res;
|
|
41422
41472
|
}
|
|
41423
41473
|
var candidates = ts.mapDefined(symbol.declarations, function (d) {
|
|
41424
|
-
if (!ts.isAmbientModule(d) && d.parent
|
|
41425
|
-
|
|
41474
|
+
if (!ts.isAmbientModule(d) && d.parent) {
|
|
41475
|
+
if (hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
|
|
41476
|
+
return getSymbolOfNode(d.parent);
|
|
41477
|
+
}
|
|
41478
|
+
if (ts.isModuleBlock(d.parent) && d.parent.parent && resolveExternalModuleSymbol(getSymbolOfNode(d.parent.parent)) === symbol) {
|
|
41479
|
+
return getSymbolOfNode(d.parent.parent);
|
|
41480
|
+
}
|
|
41426
41481
|
}
|
|
41427
41482
|
if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
|
|
41428
41483
|
if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
|
|
@@ -41634,7 +41689,7 @@ var ts;
|
|
|
41634
41689
|
var links = getSymbolLinks(symbol);
|
|
41635
41690
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
41636
41691
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
41637
|
-
var key =
|
|
41692
|
+
var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
|
|
41638
41693
|
if (cache.has(key)) {
|
|
41639
41694
|
return cache.get(key);
|
|
41640
41695
|
}
|
|
@@ -41880,7 +41935,7 @@ var ts;
|
|
|
41880
41935
|
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
41881
41936
|
var meaning;
|
|
41882
41937
|
if (entityName.parent.kind === 180 ||
|
|
41883
|
-
ts.
|
|
41938
|
+
entityName.parent.kind === 227 && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
41884
41939
|
entityName.parent.kind === 161) {
|
|
41885
41940
|
meaning = 111551 | 1048576;
|
|
41886
41941
|
}
|
|
@@ -41983,7 +42038,7 @@ var ts;
|
|
|
41983
42038
|
return flags & 814775659;
|
|
41984
42039
|
}
|
|
41985
42040
|
function isClassInstanceSide(type) {
|
|
41986
|
-
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) &
|
|
42041
|
+
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) & 33554432)));
|
|
41987
42042
|
}
|
|
41988
42043
|
function createNodeBuilder() {
|
|
41989
42044
|
return {
|
|
@@ -42402,7 +42457,7 @@ var ts;
|
|
|
42402
42457
|
context.symbolDepth = new ts.Map();
|
|
42403
42458
|
}
|
|
42404
42459
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
42405
|
-
var key =
|
|
42460
|
+
var key = getTypeId(type) + "|" + context.flags;
|
|
42406
42461
|
if (links) {
|
|
42407
42462
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
42408
42463
|
}
|
|
@@ -42657,7 +42712,7 @@ var ts;
|
|
|
42657
42712
|
}
|
|
42658
42713
|
}
|
|
42659
42714
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
42660
|
-
typeElements.push(ts.factory.createPropertySignature(undefined, "... "
|
|
42715
|
+
typeElements.push(ts.factory.createPropertySignature(undefined, "... " + (properties.length - i) + " more ...", undefined, undefined));
|
|
42661
42716
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
42662
42717
|
break;
|
|
42663
42718
|
}
|
|
@@ -42765,7 +42820,7 @@ var ts;
|
|
|
42765
42820
|
else if (types.length > 2) {
|
|
42766
42821
|
return [
|
|
42767
42822
|
typeToTypeNodeHelper(types[0], context),
|
|
42768
|
-
ts.factory.createTypeReferenceNode("... "
|
|
42823
|
+
ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", undefined),
|
|
42769
42824
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
42770
42825
|
];
|
|
42771
42826
|
}
|
|
@@ -42778,7 +42833,7 @@ var ts;
|
|
|
42778
42833
|
var type = types_2[_i];
|
|
42779
42834
|
i++;
|
|
42780
42835
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
42781
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
42836
|
+
result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", undefined));
|
|
42782
42837
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
42783
42838
|
if (typeNode_1) {
|
|
42784
42839
|
result_5.push(typeNode_1);
|
|
@@ -43254,7 +43309,7 @@ var ts;
|
|
|
43254
43309
|
var text = rawtext;
|
|
43255
43310
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
43256
43311
|
i++;
|
|
43257
|
-
text =
|
|
43312
|
+
text = rawtext + "_" + i;
|
|
43258
43313
|
}
|
|
43259
43314
|
if (text !== rawtext) {
|
|
43260
43315
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -43536,7 +43591,7 @@ var ts;
|
|
|
43536
43591
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
43537
43592
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
43538
43593
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
43539
|
-
: "arg"
|
|
43594
|
+
: "arg" + index;
|
|
43540
43595
|
}
|
|
43541
43596
|
function rewriteModuleSpecifier(parent, lit) {
|
|
43542
43597
|
if (bundled) {
|
|
@@ -44345,7 +44400,7 @@ var ts;
|
|
|
44345
44400
|
}
|
|
44346
44401
|
return results_1;
|
|
44347
44402
|
}
|
|
44348
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
44403
|
+
return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
|
|
44349
44404
|
};
|
|
44350
44405
|
}
|
|
44351
44406
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -44415,7 +44470,7 @@ var ts;
|
|
|
44415
44470
|
if (ref) {
|
|
44416
44471
|
return ref;
|
|
44417
44472
|
}
|
|
44418
|
-
var tempName = getUnusedName(
|
|
44473
|
+
var tempName = getUnusedName(rootName + "_base");
|
|
44419
44474
|
var statement = ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList([
|
|
44420
44475
|
ts.factory.createVariableDeclaration(tempName, undefined, typeToTypeNodeHelper(staticType, context))
|
|
44421
44476
|
], 2));
|
|
@@ -44460,7 +44515,7 @@ var ts;
|
|
|
44460
44515
|
var original = input;
|
|
44461
44516
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
44462
44517
|
i++;
|
|
44463
|
-
input =
|
|
44518
|
+
input = original + "_" + i;
|
|
44464
44519
|
}
|
|
44465
44520
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
44466
44521
|
if (id) {
|
|
@@ -44566,15 +44621,15 @@ var ts;
|
|
|
44566
44621
|
if (nameType.flags & 384) {
|
|
44567
44622
|
var name = "" + nameType.value;
|
|
44568
44623
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
44569
|
-
return "\""
|
|
44624
|
+
return "\"" + ts.escapeString(name, 34) + "\"";
|
|
44570
44625
|
}
|
|
44571
44626
|
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
44572
|
-
return "["
|
|
44627
|
+
return "[" + name + "]";
|
|
44573
44628
|
}
|
|
44574
44629
|
return name;
|
|
44575
44630
|
}
|
|
44576
44631
|
if (nameType.flags & 8192) {
|
|
44577
|
-
return "["
|
|
44632
|
+
return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
|
|
44578
44633
|
}
|
|
44579
44634
|
}
|
|
44580
44635
|
}
|
|
@@ -45380,7 +45435,7 @@ var ts;
|
|
|
45380
45435
|
var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
45381
45436
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192);
|
|
45382
45437
|
if (result.symbol && result.symbol.flags & 32 && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
45383
|
-
result.objectFlags |=
|
|
45438
|
+
result.objectFlags |= 33554432;
|
|
45384
45439
|
}
|
|
45385
45440
|
return result;
|
|
45386
45441
|
}
|
|
@@ -47019,7 +47074,7 @@ var ts;
|
|
|
47019
47074
|
!leftName ? rightName :
|
|
47020
47075
|
!rightName ? leftName :
|
|
47021
47076
|
undefined;
|
|
47022
|
-
var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg"
|
|
47077
|
+
var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg" + i);
|
|
47023
47078
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
47024
47079
|
params[i] = paramSymbol;
|
|
47025
47080
|
}
|
|
@@ -47152,81 +47207,81 @@ var ts;
|
|
|
47152
47207
|
return ts.append(indexInfos, newInfo);
|
|
47153
47208
|
}
|
|
47154
47209
|
function resolveAnonymousTypeMembers(type) {
|
|
47155
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
47156
47210
|
if (type.target) {
|
|
47157
47211
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47158
|
-
var
|
|
47212
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false);
|
|
47159
47213
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0), type.mapper);
|
|
47160
47214
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1), type.mapper);
|
|
47161
|
-
var
|
|
47162
|
-
setStructuredTypeMembers(type,
|
|
47215
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
47216
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
47217
|
+
return;
|
|
47163
47218
|
}
|
|
47164
|
-
|
|
47219
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
47220
|
+
if (symbol.flags & 2048) {
|
|
47165
47221
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47166
|
-
var
|
|
47167
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
47168
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
47169
|
-
var
|
|
47170
|
-
setStructuredTypeMembers(type,
|
|
47222
|
+
var members_7 = getMembersOfSymbol(symbol);
|
|
47223
|
+
var callSignatures = getSignaturesOfSymbol(members_7.get("__call"));
|
|
47224
|
+
var constructSignatures = getSignaturesOfSymbol(members_7.get("__new"));
|
|
47225
|
+
var indexInfos_2 = getIndexInfosOfSymbol(symbol);
|
|
47226
|
+
setStructuredTypeMembers(type, members_7, callSignatures, constructSignatures, indexInfos_2);
|
|
47227
|
+
return;
|
|
47171
47228
|
}
|
|
47172
|
-
|
|
47173
|
-
|
|
47174
|
-
|
|
47175
|
-
|
|
47176
|
-
|
|
47177
|
-
|
|
47178
|
-
|
|
47179
|
-
|
|
47180
|
-
|
|
47181
|
-
|
|
47182
|
-
|
|
47183
|
-
|
|
47184
|
-
members = varsOnly_1;
|
|
47185
|
-
}
|
|
47229
|
+
var members = emptySymbols;
|
|
47230
|
+
var indexInfos;
|
|
47231
|
+
if (symbol.exports) {
|
|
47232
|
+
members = getExportsOfSymbol(symbol);
|
|
47233
|
+
if (symbol === globalThisSymbol) {
|
|
47234
|
+
var varsOnly_1 = new ts.Map();
|
|
47235
|
+
members.forEach(function (p) {
|
|
47236
|
+
if (!(p.flags & 418)) {
|
|
47237
|
+
varsOnly_1.set(p.escapedName, p);
|
|
47238
|
+
}
|
|
47239
|
+
});
|
|
47240
|
+
members = varsOnly_1;
|
|
47186
47241
|
}
|
|
47187
|
-
|
|
47188
|
-
|
|
47189
|
-
|
|
47190
|
-
|
|
47191
|
-
|
|
47192
|
-
|
|
47193
|
-
|
|
47194
|
-
|
|
47195
|
-
|
|
47196
|
-
else if (baseConstructorType === anyType) {
|
|
47197
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47198
|
-
}
|
|
47242
|
+
}
|
|
47243
|
+
var baseConstructorIndexInfo;
|
|
47244
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47245
|
+
if (symbol.flags & 32) {
|
|
47246
|
+
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47247
|
+
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
47248
|
+
if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) {
|
|
47249
|
+
members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
|
47250
|
+
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
|
47199
47251
|
}
|
|
47200
|
-
|
|
47201
|
-
|
|
47202
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47252
|
+
else if (baseConstructorType === anyType) {
|
|
47253
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47203
47254
|
}
|
|
47204
|
-
|
|
47205
|
-
|
|
47206
|
-
|
|
47207
|
-
|
|
47208
|
-
|
|
47209
|
-
|
|
47210
|
-
|
|
47211
|
-
|
|
47255
|
+
}
|
|
47256
|
+
var indexSymbol = getIndexSymbolFromSymbolTable(members);
|
|
47257
|
+
if (indexSymbol) {
|
|
47258
|
+
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47259
|
+
}
|
|
47260
|
+
else {
|
|
47261
|
+
if (baseConstructorIndexInfo) {
|
|
47262
|
+
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
47212
47263
|
}
|
|
47213
|
-
|
|
47214
|
-
|
|
47215
|
-
|
|
47264
|
+
if (symbol.flags & 384 && (getDeclaredTypeOfSymbol(symbol).flags & 32 ||
|
|
47265
|
+
ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296); }))) {
|
|
47266
|
+
indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
|
|
47216
47267
|
}
|
|
47217
|
-
|
|
47218
|
-
|
|
47219
|
-
|
|
47220
|
-
|
|
47221
|
-
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
|
|
47225
|
-
|
|
47226
|
-
|
|
47227
|
-
|
|
47228
|
-
|
|
47268
|
+
}
|
|
47269
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
|
|
47270
|
+
if (symbol.flags & (16 | 8192)) {
|
|
47271
|
+
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
47272
|
+
}
|
|
47273
|
+
if (symbol.flags & 32) {
|
|
47274
|
+
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47275
|
+
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor")) : ts.emptyArray;
|
|
47276
|
+
if (symbol.flags & 16) {
|
|
47277
|
+
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
47278
|
+
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, undefined, sig.minArgumentCount, sig.flags & 39) :
|
|
47279
|
+
undefined; }));
|
|
47229
47280
|
}
|
|
47281
|
+
if (!constructSignatures.length) {
|
|
47282
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
47283
|
+
}
|
|
47284
|
+
type.constructSignatures = constructSignatures;
|
|
47230
47285
|
}
|
|
47231
47286
|
}
|
|
47232
47287
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -48086,8 +48141,8 @@ var ts;
|
|
|
48086
48141
|
var stringIndexInfo;
|
|
48087
48142
|
var applicableInfo;
|
|
48088
48143
|
var applicableInfos;
|
|
48089
|
-
for (var _i = 0,
|
|
48090
|
-
var info =
|
|
48144
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
48145
|
+
var info = indexInfos_3[_i];
|
|
48091
48146
|
if (info.keyType === stringType) {
|
|
48092
48147
|
stringIndexInfo = info;
|
|
48093
48148
|
}
|
|
@@ -48576,9 +48631,10 @@ var ts;
|
|
|
48576
48631
|
return signature;
|
|
48577
48632
|
}
|
|
48578
48633
|
function getOrCreateTypeFromSignature(signature) {
|
|
48634
|
+
var _a;
|
|
48579
48635
|
if (!signature.isolatedSignatureType) {
|
|
48580
|
-
var kind = signature.declaration ?
|
|
48581
|
-
var isConstructor = kind === 170 || kind === 174 || kind === 179;
|
|
48636
|
+
var kind = (_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind;
|
|
48637
|
+
var isConstructor = kind === undefined || kind === 170 || kind === 174 || kind === 179;
|
|
48582
48638
|
var type = createObjectType(16);
|
|
48583
48639
|
type.members = emptySymbols;
|
|
48584
48640
|
type.properties = ts.emptyArray;
|
|
@@ -48604,14 +48660,14 @@ var ts;
|
|
|
48604
48660
|
}
|
|
48605
48661
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
48606
48662
|
if (indexSymbol.declarations) {
|
|
48607
|
-
var
|
|
48663
|
+
var indexInfos_4 = [];
|
|
48608
48664
|
var _loop_14 = function (declaration) {
|
|
48609
48665
|
if (declaration.parameters.length === 1) {
|
|
48610
48666
|
var parameter = declaration.parameters[0];
|
|
48611
48667
|
if (parameter.type) {
|
|
48612
48668
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
48613
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
48614
|
-
|
|
48669
|
+
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_4, keyType)) {
|
|
48670
|
+
indexInfos_4.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64), declaration));
|
|
48615
48671
|
}
|
|
48616
48672
|
});
|
|
48617
48673
|
}
|
|
@@ -48621,7 +48677,7 @@ var ts;
|
|
|
48621
48677
|
var declaration = _a[_i];
|
|
48622
48678
|
_loop_14(declaration);
|
|
48623
48679
|
}
|
|
48624
|
-
return
|
|
48680
|
+
return indexInfos_4;
|
|
48625
48681
|
}
|
|
48626
48682
|
return ts.emptyArray;
|
|
48627
48683
|
}
|
|
@@ -48732,7 +48788,7 @@ var ts;
|
|
|
48732
48788
|
return result;
|
|
48733
48789
|
}
|
|
48734
48790
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
48735
|
-
return aliasSymbol ? "@"
|
|
48791
|
+
return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
|
|
48736
48792
|
}
|
|
48737
48793
|
function getPropagatingFlagsOfTypes(types, excludeKinds) {
|
|
48738
48794
|
var result = 0;
|
|
@@ -48895,7 +48951,7 @@ var ts;
|
|
|
48895
48951
|
return undefined;
|
|
48896
48952
|
}
|
|
48897
48953
|
function getSymbolPath(symbol) {
|
|
48898
|
-
return symbol.parent ?
|
|
48954
|
+
return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
|
|
48899
48955
|
}
|
|
48900
48956
|
function getUnresolvedSymbolForEntityName(name) {
|
|
48901
48957
|
var identifier = name.kind === 160 ? name.right :
|
|
@@ -48906,7 +48962,7 @@ var ts;
|
|
|
48906
48962
|
var parentSymbol = name.kind === 160 ? getUnresolvedSymbolForEntityName(name.left) :
|
|
48907
48963
|
name.kind === 205 ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
48908
48964
|
undefined;
|
|
48909
|
-
var path = parentSymbol ?
|
|
48965
|
+
var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
|
|
48910
48966
|
var result = unresolvedSymbols.get(path);
|
|
48911
48967
|
if (!result) {
|
|
48912
48968
|
unresolvedSymbols.set(path, result = createSymbol(524288, text, 1048576));
|
|
@@ -48972,7 +49028,7 @@ var ts;
|
|
|
48972
49028
|
if (substitute.flags & 3 || substitute === baseType) {
|
|
48973
49029
|
return baseType;
|
|
48974
49030
|
}
|
|
48975
|
-
var id =
|
|
49031
|
+
var id = getTypeId(baseType) + ">" + getTypeId(substitute);
|
|
48976
49032
|
var cached = substitutionTypes.get(id);
|
|
48977
49033
|
if (cached) {
|
|
48978
49034
|
return cached;
|
|
@@ -49106,7 +49162,7 @@ var ts;
|
|
|
49106
49162
|
function getTypeFromTypeQueryNode(node) {
|
|
49107
49163
|
var links = getNodeLinks(node);
|
|
49108
49164
|
if (!links.resolvedType) {
|
|
49109
|
-
var type =
|
|
49165
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
49110
49166
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
49111
49167
|
}
|
|
49112
49168
|
return links.resolvedType;
|
|
@@ -49415,7 +49471,7 @@ var ts;
|
|
|
49415
49471
|
}
|
|
49416
49472
|
}
|
|
49417
49473
|
var fixedLength = properties.length;
|
|
49418
|
-
var lengthSymbol = createSymbol(4, "length");
|
|
49474
|
+
var lengthSymbol = createSymbol(4, "length", readonly ? 8 : 0);
|
|
49419
49475
|
if (combinedFlags & 12) {
|
|
49420
49476
|
lengthSymbol.type = numberType;
|
|
49421
49477
|
}
|
|
@@ -49816,9 +49872,9 @@ var ts;
|
|
|
49816
49872
|
return types[0];
|
|
49817
49873
|
}
|
|
49818
49874
|
var typeKey = !origin ? getTypeListId(types) :
|
|
49819
|
-
origin.flags & 1048576 ? "|"
|
|
49820
|
-
origin.flags & 2097152 ? "&"
|
|
49821
|
-
"#"
|
|
49875
|
+
origin.flags & 1048576 ? "|" + getTypeListId(origin.types) :
|
|
49876
|
+
origin.flags & 2097152 ? "&" + getTypeListId(origin.types) :
|
|
49877
|
+
"#" + origin.type.id + "|" + getTypeListId(types);
|
|
49822
49878
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
49823
49879
|
var type = unionTypes.get(id);
|
|
49824
49880
|
if (!type) {
|
|
@@ -50268,7 +50324,7 @@ var ts;
|
|
|
50268
50324
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
|
|
50269
50325
|
return stringType;
|
|
50270
50326
|
}
|
|
50271
|
-
var id =
|
|
50327
|
+
var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
|
|
50272
50328
|
var type = templateLiteralTypes.get(id);
|
|
50273
50329
|
if (!type) {
|
|
50274
50330
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -50328,7 +50384,7 @@ var ts;
|
|
|
50328
50384
|
return str;
|
|
50329
50385
|
}
|
|
50330
50386
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
50331
|
-
var id =
|
|
50387
|
+
var id = getSymbolId(symbol) + "," + getTypeId(type);
|
|
50332
50388
|
var result = stringMappingTypes.get(id);
|
|
50333
50389
|
if (!result) {
|
|
50334
50390
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -51236,7 +51292,7 @@ var ts;
|
|
|
51236
51292
|
function createUniqueESSymbolType(symbol) {
|
|
51237
51293
|
var type = createType(8192);
|
|
51238
51294
|
type.symbol = symbol;
|
|
51239
|
-
type.escapedName = "__@"
|
|
51295
|
+
type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
|
|
51240
51296
|
return type;
|
|
51241
51297
|
}
|
|
51242
51298
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -51532,7 +51588,9 @@ var ts;
|
|
|
51532
51588
|
return result;
|
|
51533
51589
|
}
|
|
51534
51590
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
51535
|
-
var declaration = type.objectFlags & 4 ? type.node :
|
|
51591
|
+
var declaration = type.objectFlags & 4 ? type.node :
|
|
51592
|
+
type.objectFlags & 16777216 ? type.node :
|
|
51593
|
+
type.symbol.declarations[0];
|
|
51536
51594
|
var links = getNodeLinks(declaration);
|
|
51537
51595
|
var target = type.objectFlags & 4 ? links.resolvedType :
|
|
51538
51596
|
type.objectFlags & 64 ? type.target : type;
|
|
@@ -51544,8 +51602,8 @@ var ts;
|
|
|
51544
51602
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
51545
51603
|
}
|
|
51546
51604
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
51547
|
-
var allDeclarations_1 = type.objectFlags & 4 ? [declaration] : type.symbol.declarations;
|
|
51548
|
-
typeParameters = (target.objectFlags & 4 || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ?
|
|
51605
|
+
var allDeclarations_1 = type.objectFlags & (4 | 16777216) ? [declaration] : type.symbol.declarations;
|
|
51606
|
+
typeParameters = (target.objectFlags & (4 | 16777216) || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ?
|
|
51549
51607
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
51550
51608
|
typeParameters;
|
|
51551
51609
|
links.outerTypeParameters = typeParameters;
|
|
@@ -51694,6 +51752,9 @@ var ts;
|
|
|
51694
51752
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
51695
51753
|
freshTypeParameter.mapper = mapper;
|
|
51696
51754
|
}
|
|
51755
|
+
if (type.objectFlags & 16777216) {
|
|
51756
|
+
result.node = type.node;
|
|
51757
|
+
}
|
|
51697
51758
|
result.target = type;
|
|
51698
51759
|
result.mapper = mapper;
|
|
51699
51760
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -52384,9 +52445,6 @@ var ts;
|
|
|
52384
52445
|
if (sourceRestType || targetRestType) {
|
|
52385
52446
|
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
|
|
52386
52447
|
}
|
|
52387
|
-
if (sourceRestType && targetRestType && sourceCount !== targetCount) {
|
|
52388
|
-
return 0;
|
|
52389
|
-
}
|
|
52390
52448
|
var kind = target.declaration ? target.declaration.kind : 0;
|
|
52391
52449
|
var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 168 &&
|
|
52392
52450
|
kind !== 167 && kind !== 170;
|
|
@@ -52592,9 +52650,9 @@ var ts;
|
|
|
52592
52650
|
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
|
|
52593
52651
|
return true;
|
|
52594
52652
|
}
|
|
52595
|
-
if (s & 32768 && (!strictNullChecks || t & (32768 | 16384)))
|
|
52653
|
+
if (s & 32768 && (!strictNullChecks && !(t & 3145728) || t & (32768 | 16384)))
|
|
52596
52654
|
return true;
|
|
52597
|
-
if (s & 65536 && (!strictNullChecks || t & 65536))
|
|
52655
|
+
if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
|
|
52598
52656
|
return true;
|
|
52599
52657
|
if (s & 524288 && t & 67108864)
|
|
52600
52658
|
return true;
|
|
@@ -52669,11 +52727,11 @@ var ts;
|
|
|
52669
52727
|
var overflow = false;
|
|
52670
52728
|
var overrideNextErrorInfo = 0;
|
|
52671
52729
|
var lastSkippedInfo;
|
|
52672
|
-
var incompatibleStack
|
|
52730
|
+
var incompatibleStack;
|
|
52673
52731
|
var inPropertyCheck = false;
|
|
52674
52732
|
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
52675
52733
|
var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
|
|
52676
|
-
if (incompatibleStack
|
|
52734
|
+
if (incompatibleStack) {
|
|
52677
52735
|
reportIncompatibleStack();
|
|
52678
52736
|
}
|
|
52679
52737
|
if (overflow) {
|
|
@@ -52728,19 +52786,19 @@ var ts;
|
|
|
52728
52786
|
return {
|
|
52729
52787
|
errorInfo: errorInfo,
|
|
52730
52788
|
lastSkippedInfo: lastSkippedInfo,
|
|
52731
|
-
incompatibleStack: incompatibleStack.slice(),
|
|
52789
|
+
incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
|
|
52732
52790
|
overrideNextErrorInfo: overrideNextErrorInfo,
|
|
52733
|
-
relatedInfo:
|
|
52791
|
+
relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
|
|
52734
52792
|
};
|
|
52735
52793
|
}
|
|
52736
52794
|
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
|
|
52737
52795
|
overrideNextErrorInfo++;
|
|
52738
52796
|
lastSkippedInfo = undefined;
|
|
52739
|
-
incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
|
|
52797
|
+
(incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
|
|
52740
52798
|
}
|
|
52741
52799
|
function reportIncompatibleStack() {
|
|
52742
|
-
var stack = incompatibleStack;
|
|
52743
|
-
incompatibleStack =
|
|
52800
|
+
var stack = incompatibleStack || [];
|
|
52801
|
+
incompatibleStack = undefined;
|
|
52744
52802
|
var info = lastSkippedInfo;
|
|
52745
52803
|
lastSkippedInfo = undefined;
|
|
52746
52804
|
if (stack.length === 1) {
|
|
@@ -52757,20 +52815,20 @@ var ts;
|
|
|
52757
52815
|
switch (msg.code) {
|
|
52758
52816
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
52759
52817
|
if (path.indexOf("new ") === 0) {
|
|
52760
|
-
path = "("
|
|
52818
|
+
path = "(" + path + ")";
|
|
52761
52819
|
}
|
|
52762
52820
|
var str = "" + args[0];
|
|
52763
52821
|
if (path.length === 0) {
|
|
52764
|
-
path = ""
|
|
52822
|
+
path = "" + str;
|
|
52765
52823
|
}
|
|
52766
52824
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
52767
|
-
path =
|
|
52825
|
+
path = path + "." + str;
|
|
52768
52826
|
}
|
|
52769
52827
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
52770
|
-
path = ""
|
|
52828
|
+
path = "" + path + str;
|
|
52771
52829
|
}
|
|
52772
52830
|
else {
|
|
52773
|
-
path =
|
|
52831
|
+
path = path + "[" + str + "]";
|
|
52774
52832
|
}
|
|
52775
52833
|
break;
|
|
52776
52834
|
}
|
|
@@ -52797,7 +52855,7 @@ var ts;
|
|
|
52797
52855
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
52798
52856
|
? ""
|
|
52799
52857
|
: "...";
|
|
52800
|
-
path = ""
|
|
52858
|
+
path = "" + prefix + path + "(" + params + ")";
|
|
52801
52859
|
}
|
|
52802
52860
|
break;
|
|
52803
52861
|
}
|
|
@@ -52810,7 +52868,7 @@ var ts;
|
|
|
52810
52868
|
break;
|
|
52811
52869
|
}
|
|
52812
52870
|
default:
|
|
52813
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
52871
|
+
return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
|
|
52814
52872
|
}
|
|
52815
52873
|
}
|
|
52816
52874
|
if (path) {
|
|
@@ -52834,7 +52892,7 @@ var ts;
|
|
|
52834
52892
|
}
|
|
52835
52893
|
function reportError(message, arg0, arg1, arg2, arg3) {
|
|
52836
52894
|
ts.Debug.assert(!!errorNode);
|
|
52837
|
-
if (incompatibleStack
|
|
52895
|
+
if (incompatibleStack)
|
|
52838
52896
|
reportIncompatibleStack();
|
|
52839
52897
|
if (message.elidedInCompatabilityPyramid)
|
|
52840
52898
|
return;
|
|
@@ -52850,7 +52908,7 @@ var ts;
|
|
|
52850
52908
|
}
|
|
52851
52909
|
}
|
|
52852
52910
|
function reportRelationError(message, source, target) {
|
|
52853
|
-
if (incompatibleStack
|
|
52911
|
+
if (incompatibleStack)
|
|
52854
52912
|
reportIncompatibleStack();
|
|
52855
52913
|
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
|
|
52856
52914
|
var generalizedSource = source;
|
|
@@ -52941,7 +52999,9 @@ var ts;
|
|
|
52941
52999
|
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
|
|
52942
53000
|
return -1;
|
|
52943
53001
|
}
|
|
52944
|
-
|
|
53002
|
+
if (reportErrors) {
|
|
53003
|
+
reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
|
|
53004
|
+
}
|
|
52945
53005
|
return 0;
|
|
52946
53006
|
}
|
|
52947
53007
|
var source = getNormalizedType(originalSource, false);
|
|
@@ -52949,127 +53009,121 @@ var ts;
|
|
|
52949
53009
|
if (source === target)
|
|
52950
53010
|
return -1;
|
|
52951
53011
|
if (relation === identityRelation) {
|
|
52952
|
-
|
|
53012
|
+
if (source.flags !== target.flags)
|
|
53013
|
+
return 0;
|
|
53014
|
+
if (source.flags & 67358815)
|
|
53015
|
+
return -1;
|
|
53016
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53017
|
+
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
52953
53018
|
}
|
|
52954
53019
|
if (source.flags & 262144 && getConstraintOfType(source) === target) {
|
|
52955
53020
|
return -1;
|
|
52956
53021
|
}
|
|
52957
|
-
if (
|
|
52958
|
-
|
|
52959
|
-
var
|
|
52960
|
-
|
|
52961
|
-
|
|
53022
|
+
if (source.flags & 470302716 && target.flags & 1048576) {
|
|
53023
|
+
var types = target.types;
|
|
53024
|
+
var candidate = types.length === 2 && types[0].flags & 98304 ? types[1] :
|
|
53025
|
+
types.length === 3 && types[0].flags & 98304 && types[1].flags & 98304 ? types[2] :
|
|
53026
|
+
undefined;
|
|
53027
|
+
if (candidate && !(candidate.flags & 98304)) {
|
|
53028
|
+
target = getNormalizedType(candidate, true);
|
|
53029
|
+
if (source === target)
|
|
53030
|
+
return -1;
|
|
52962
53031
|
}
|
|
52963
|
-
if (source === nullStrippedTarget)
|
|
52964
|
-
return -1;
|
|
52965
53032
|
}
|
|
52966
53033
|
if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
|
|
52967
53034
|
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
|
|
52968
53035
|
return -1;
|
|
52969
|
-
|
|
52970
|
-
|
|
52971
|
-
|
|
52972
|
-
|
|
53036
|
+
if (source.flags & 469499904 || target.flags & 469499904) {
|
|
53037
|
+
var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384);
|
|
53038
|
+
if (isPerformingExcessPropertyChecks) {
|
|
53039
|
+
if (hasExcessProperties(source, target, reportErrors)) {
|
|
53040
|
+
if (reportErrors) {
|
|
53041
|
+
reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
|
|
53042
|
+
}
|
|
53043
|
+
return 0;
|
|
53044
|
+
}
|
|
53045
|
+
}
|
|
53046
|
+
var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2) &&
|
|
53047
|
+
source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
|
|
53048
|
+
target.flags & (524288 | 2097152) && isWeakType(target) &&
|
|
53049
|
+
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
|
|
53050
|
+
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
|
|
53051
|
+
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
|
|
52973
53052
|
if (reportErrors) {
|
|
52974
|
-
|
|
53053
|
+
var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
|
|
53054
|
+
var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
|
|
53055
|
+
var calls = getSignaturesOfType(source, 0);
|
|
53056
|
+
var constructs = getSignaturesOfType(source, 1);
|
|
53057
|
+
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
53058
|
+
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
53059
|
+
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
53060
|
+
}
|
|
53061
|
+
else {
|
|
53062
|
+
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
53063
|
+
}
|
|
52975
53064
|
}
|
|
52976
53065
|
return 0;
|
|
52977
53066
|
}
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
52981
|
-
|
|
52982
|
-
|
|
52983
|
-
|
|
52984
|
-
if (
|
|
52985
|
-
|
|
52986
|
-
|
|
52987
|
-
|
|
52988
|
-
|
|
52989
|
-
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
52990
|
-
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
52991
|
-
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
52992
|
-
}
|
|
52993
|
-
else {
|
|
52994
|
-
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
52995
|
-
}
|
|
53067
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53068
|
+
var skipCaching = source.flags & 1048576 && source.types.length < 4 && !(target.flags & 1048576) ||
|
|
53069
|
+
target.flags & 1048576 && target.types.length < 4 && !(source.flags & 469499904);
|
|
53070
|
+
var result_7 = skipCaching ?
|
|
53071
|
+
unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
|
|
53072
|
+
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
|
|
53073
|
+
if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
53074
|
+
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
|
|
53075
|
+
inPropertyCheck = true;
|
|
53076
|
+
result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53077
|
+
inPropertyCheck = false;
|
|
52996
53078
|
}
|
|
52997
|
-
|
|
52998
|
-
|
|
52999
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53000
|
-
var result = 0;
|
|
53001
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
53002
|
-
if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
53003
|
-
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
|
|
53004
|
-
}
|
|
53005
|
-
else if (source.flags & 3145728 || target.flags & 3145728) {
|
|
53006
|
-
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
|
|
53007
|
-
}
|
|
53008
|
-
if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
|
|
53009
|
-
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
53010
|
-
resetErrorInfo(saveErrorInfo);
|
|
53079
|
+
if (result_7) {
|
|
53080
|
+
return result_7;
|
|
53011
53081
|
}
|
|
53012
53082
|
}
|
|
53013
|
-
if (
|
|
53014
|
-
|
|
53015
|
-
|
|
53016
|
-
|
|
53017
|
-
|
|
53018
|
-
|
|
53019
|
-
|
|
53020
|
-
|
|
53083
|
+
if (reportErrors) {
|
|
53084
|
+
reportErrorResults(originalSource, originalTarget, source, target, headMessage);
|
|
53085
|
+
}
|
|
53086
|
+
return 0;
|
|
53087
|
+
}
|
|
53088
|
+
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
53089
|
+
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53090
|
+
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53091
|
+
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53092
|
+
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53093
|
+
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53094
|
+
if (maybeSuppress) {
|
|
53095
|
+
overrideNextErrorInfo--;
|
|
53096
|
+
}
|
|
53097
|
+
if (source.flags & 524288 && target.flags & 524288) {
|
|
53098
|
+
var currentError = errorInfo;
|
|
53099
|
+
tryElaborateArrayLikeErrors(source, target, true);
|
|
53100
|
+
if (errorInfo !== currentError) {
|
|
53101
|
+
maybeSuppress = !!errorInfo;
|
|
53102
|
+
}
|
|
53103
|
+
}
|
|
53104
|
+
if (source.flags & 524288 && target.flags & 131068) {
|
|
53105
|
+
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53106
|
+
}
|
|
53107
|
+
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53108
|
+
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53109
|
+
}
|
|
53110
|
+
else if (ts.getObjectFlags(source) & 2048 && target.flags & 2097152) {
|
|
53111
|
+
var targetTypes = target.types;
|
|
53112
|
+
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53113
|
+
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53114
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53115
|
+
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53116
|
+
return;
|
|
53021
53117
|
}
|
|
53022
53118
|
}
|
|
53023
|
-
|
|
53024
|
-
|
|
53025
|
-
inPropertyCheck = true;
|
|
53026
|
-
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53027
|
-
inPropertyCheck = false;
|
|
53119
|
+
else {
|
|
53120
|
+
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53028
53121
|
}
|
|
53029
|
-
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
if (!result && reportErrors) {
|
|
53033
|
-
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53034
|
-
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53035
|
-
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53036
|
-
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53037
|
-
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53038
|
-
if (maybeSuppress) {
|
|
53039
|
-
overrideNextErrorInfo--;
|
|
53040
|
-
}
|
|
53041
|
-
if (source.flags & 524288 && target.flags & 524288) {
|
|
53042
|
-
var currentError = errorInfo;
|
|
53043
|
-
tryElaborateArrayLikeErrors(source, target, reportErrors);
|
|
53044
|
-
if (errorInfo !== currentError) {
|
|
53045
|
-
maybeSuppress = !!errorInfo;
|
|
53046
|
-
}
|
|
53047
|
-
}
|
|
53048
|
-
if (source.flags & 524288 && target.flags & 131068) {
|
|
53049
|
-
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53050
|
-
}
|
|
53051
|
-
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53052
|
-
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53053
|
-
}
|
|
53054
|
-
else if (isComparingJsxAttributes && target.flags & 2097152) {
|
|
53055
|
-
var targetTypes = target.types;
|
|
53056
|
-
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53057
|
-
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53058
|
-
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53059
|
-
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53060
|
-
return result;
|
|
53061
|
-
}
|
|
53062
|
-
}
|
|
53063
|
-
else {
|
|
53064
|
-
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53065
|
-
}
|
|
53066
|
-
if (!headMessage && maybeSuppress) {
|
|
53067
|
-
lastSkippedInfo = [source, target];
|
|
53068
|
-
return result;
|
|
53069
|
-
}
|
|
53070
|
-
reportRelationError(headMessage, source, target);
|
|
53071
|
-
}
|
|
53122
|
+
if (!headMessage && maybeSuppress) {
|
|
53123
|
+
lastSkippedInfo = [source, target];
|
|
53124
|
+
return;
|
|
53072
53125
|
}
|
|
53126
|
+
reportRelationError(headMessage, source, target);
|
|
53073
53127
|
}
|
|
53074
53128
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
53075
53129
|
if (!ts.tracing) {
|
|
@@ -53095,21 +53149,6 @@ var ts;
|
|
|
53095
53149
|
}
|
|
53096
53150
|
}
|
|
53097
53151
|
}
|
|
53098
|
-
function isIdenticalTo(source, target, recursionFlags) {
|
|
53099
|
-
if (source.flags !== target.flags)
|
|
53100
|
-
return 0;
|
|
53101
|
-
if (source.flags & 67358815)
|
|
53102
|
-
return -1;
|
|
53103
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53104
|
-
if (source.flags & 3145728) {
|
|
53105
|
-
var result_7 = eachTypeRelatedToSomeType(source, target);
|
|
53106
|
-
if (result_7) {
|
|
53107
|
-
result_7 &= eachTypeRelatedToSomeType(target, source);
|
|
53108
|
-
}
|
|
53109
|
-
return result_7;
|
|
53110
|
-
}
|
|
53111
|
-
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
53112
|
-
}
|
|
53113
53152
|
function getTypeOfPropertyInTypes(types, name) {
|
|
53114
53153
|
var appendPropType = function (propTypes, type) {
|
|
53115
53154
|
var _a;
|
|
@@ -53198,6 +53237,29 @@ var ts;
|
|
|
53198
53237
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
53199
53238
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
53200
53239
|
}
|
|
53240
|
+
function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53241
|
+
if (source.flags & 1048576) {
|
|
53242
|
+
return relation === comparableRelation ?
|
|
53243
|
+
someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState) :
|
|
53244
|
+
eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState);
|
|
53245
|
+
}
|
|
53246
|
+
if (target.flags & 1048576) {
|
|
53247
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
|
|
53248
|
+
}
|
|
53249
|
+
if (target.flags & 2097152) {
|
|
53250
|
+
return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2);
|
|
53251
|
+
}
|
|
53252
|
+
if (relation === comparableRelation && target.flags & 131068) {
|
|
53253
|
+
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53254
|
+
if (constraints !== source.types) {
|
|
53255
|
+
source = getIntersectionType(constraints);
|
|
53256
|
+
if (!(source.flags & 2097152)) {
|
|
53257
|
+
return isRelatedTo(source, target, 1, false);
|
|
53258
|
+
}
|
|
53259
|
+
}
|
|
53260
|
+
}
|
|
53261
|
+
return someTypeRelatedToType(source, target, false, 1);
|
|
53262
|
+
}
|
|
53201
53263
|
function eachTypeRelatedToSomeType(source, target) {
|
|
53202
53264
|
var result = -1;
|
|
53203
53265
|
var sourceTypes = source.types;
|
|
@@ -53234,7 +53296,9 @@ var ts;
|
|
|
53234
53296
|
}
|
|
53235
53297
|
if (reportErrors) {
|
|
53236
53298
|
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
|
|
53237
|
-
|
|
53299
|
+
if (bestMatchingType) {
|
|
53300
|
+
isRelatedTo(source, bestMatchingType, 2, true);
|
|
53301
|
+
}
|
|
53238
53302
|
}
|
|
53239
53303
|
return 0;
|
|
53240
53304
|
}
|
|
@@ -53342,7 +53406,7 @@ var ts;
|
|
|
53342
53406
|
if (overflow) {
|
|
53343
53407
|
return 0;
|
|
53344
53408
|
}
|
|
53345
|
-
var keyIntersectionState = intersectionState | (inPropertyCheck ?
|
|
53409
|
+
var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
|
|
53346
53410
|
var id = getRelationKey(source, target, keyIntersectionState, relation, false);
|
|
53347
53411
|
var entry = relation.get(id);
|
|
53348
53412
|
if (entry !== undefined) {
|
|
@@ -53403,6 +53467,7 @@ var ts;
|
|
|
53403
53467
|
return originalHandler(onlyUnreliable);
|
|
53404
53468
|
};
|
|
53405
53469
|
}
|
|
53470
|
+
var result;
|
|
53406
53471
|
if (expandingFlags === 3) {
|
|
53407
53472
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
|
|
53408
53473
|
sourceId: source.id,
|
|
@@ -53412,8 +53477,13 @@ var ts;
|
|
|
53412
53477
|
depth: sourceDepth,
|
|
53413
53478
|
targetDepth: targetDepth
|
|
53414
53479
|
});
|
|
53480
|
+
result = 3;
|
|
53481
|
+
}
|
|
53482
|
+
else {
|
|
53483
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53484
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
|
53485
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53415
53486
|
}
|
|
53416
|
-
var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
|
|
53417
53487
|
if (outofbandVarianceMarkerHandler) {
|
|
53418
53488
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
53419
53489
|
}
|
|
@@ -53441,74 +53511,73 @@ var ts;
|
|
|
53441
53511
|
return result;
|
|
53442
53512
|
}
|
|
53443
53513
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53444
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53445
|
-
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
|
|
53446
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53447
|
-
return result;
|
|
53448
|
-
}
|
|
53449
|
-
function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
|
|
53450
53514
|
if (intersectionState & 4) {
|
|
53451
53515
|
return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
|
|
53452
53516
|
}
|
|
53453
|
-
|
|
53454
|
-
|
|
53455
|
-
|
|
53456
|
-
|
|
53457
|
-
|
|
53458
|
-
|
|
53459
|
-
|
|
53460
|
-
|
|
53461
|
-
|
|
53462
|
-
|
|
53463
|
-
|
|
53464
|
-
}
|
|
53465
|
-
if (relation === comparableRelation && target.flags & 131068) {
|
|
53466
|
-
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53467
|
-
if (constraints !== source.types) {
|
|
53468
|
-
source = getIntersectionType(constraints);
|
|
53469
|
-
if (!(source.flags & 2097152)) {
|
|
53470
|
-
return isRelatedTo(source, target, 1, false);
|
|
53471
|
-
}
|
|
53517
|
+
var result;
|
|
53518
|
+
var originalErrorInfo;
|
|
53519
|
+
var varianceCheckFailed = false;
|
|
53520
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
53521
|
+
var sourceFlags = source.flags;
|
|
53522
|
+
var targetFlags = target.flags;
|
|
53523
|
+
if (relation === identityRelation) {
|
|
53524
|
+
if (sourceFlags & 3145728) {
|
|
53525
|
+
var result_8 = eachTypeRelatedToSomeType(source, target);
|
|
53526
|
+
if (result_8) {
|
|
53527
|
+
result_8 &= eachTypeRelatedToSomeType(target, source);
|
|
53472
53528
|
}
|
|
53529
|
+
return result_8;
|
|
53473
53530
|
}
|
|
53474
|
-
|
|
53475
|
-
}
|
|
53476
|
-
var flags = source.flags & target.flags;
|
|
53477
|
-
if (relation === identityRelation && !(flags & 524288)) {
|
|
53478
|
-
if (flags & 4194304) {
|
|
53531
|
+
if (sourceFlags & 4194304) {
|
|
53479
53532
|
return isRelatedTo(source.type, target.type, 3, false);
|
|
53480
53533
|
}
|
|
53481
|
-
|
|
53482
|
-
|
|
53483
|
-
|
|
53484
|
-
|
|
53485
|
-
return result_8;
|
|
53534
|
+
if (sourceFlags & 8388608) {
|
|
53535
|
+
if (result = isRelatedTo(source.objectType, target.objectType, 3, false)) {
|
|
53536
|
+
if (result &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
|
|
53537
|
+
return result;
|
|
53486
53538
|
}
|
|
53487
53539
|
}
|
|
53488
53540
|
}
|
|
53489
|
-
if (
|
|
53541
|
+
if (sourceFlags & 16777216) {
|
|
53490
53542
|
if (source.root.isDistributive === target.root.isDistributive) {
|
|
53491
|
-
if (
|
|
53492
|
-
if (
|
|
53493
|
-
if (
|
|
53494
|
-
if (
|
|
53495
|
-
return
|
|
53543
|
+
if (result = isRelatedTo(source.checkType, target.checkType, 3, false)) {
|
|
53544
|
+
if (result &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
|
|
53545
|
+
if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
|
|
53546
|
+
if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
|
|
53547
|
+
return result;
|
|
53496
53548
|
}
|
|
53497
53549
|
}
|
|
53498
53550
|
}
|
|
53499
53551
|
}
|
|
53500
53552
|
}
|
|
53501
53553
|
}
|
|
53502
|
-
if (
|
|
53554
|
+
if (sourceFlags & 33554432) {
|
|
53503
53555
|
return isRelatedTo(source.substitute, target.substitute, 3, false);
|
|
53504
53556
|
}
|
|
53505
|
-
|
|
53557
|
+
if (!(sourceFlags & 524288)) {
|
|
53558
|
+
return 0;
|
|
53559
|
+
}
|
|
53506
53560
|
}
|
|
53507
|
-
|
|
53508
|
-
|
|
53509
|
-
|
|
53510
|
-
|
|
53511
|
-
|
|
53561
|
+
else if (sourceFlags & 3145728 || targetFlags & 3145728) {
|
|
53562
|
+
if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
53563
|
+
return result;
|
|
53564
|
+
}
|
|
53565
|
+
if (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576) {
|
|
53566
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
53567
|
+
if (constraint && everyType(constraint, function (c) { return c !== source; })) {
|
|
53568
|
+
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
53569
|
+
resetErrorInfo(saveErrorInfo);
|
|
53570
|
+
return result;
|
|
53571
|
+
}
|
|
53572
|
+
}
|
|
53573
|
+
}
|
|
53574
|
+
if (!(sourceFlags & 465829888 ||
|
|
53575
|
+
sourceFlags & 524288 && targetFlags & 1048576 ||
|
|
53576
|
+
sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) {
|
|
53577
|
+
return 0;
|
|
53578
|
+
}
|
|
53579
|
+
}
|
|
53580
|
+
if (sourceFlags & (524288 | 16777216) && source.aliasSymbol &&
|
|
53512
53581
|
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
|
|
53513
53582
|
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
|
|
53514
53583
|
var variances = getAliasVariances(source.aliasSymbol);
|
|
@@ -53524,7 +53593,7 @@ var ts;
|
|
|
53524
53593
|
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
|
|
53525
53594
|
return result;
|
|
53526
53595
|
}
|
|
53527
|
-
if (
|
|
53596
|
+
if (targetFlags & 262144) {
|
|
53528
53597
|
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
|
|
53529
53598
|
if (!(getMappedTypeModifiers(source) & 4)) {
|
|
53530
53599
|
var templateType = getTemplateTypeFromMappedType(source);
|
|
@@ -53535,9 +53604,9 @@ var ts;
|
|
|
53535
53604
|
}
|
|
53536
53605
|
}
|
|
53537
53606
|
}
|
|
53538
|
-
else if (
|
|
53607
|
+
else if (targetFlags & 4194304) {
|
|
53539
53608
|
var targetType_1 = target.type;
|
|
53540
|
-
if (
|
|
53609
|
+
if (sourceFlags & 4194304) {
|
|
53541
53610
|
if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
|
|
53542
53611
|
return result;
|
|
53543
53612
|
}
|
|
@@ -53573,8 +53642,8 @@ var ts;
|
|
|
53573
53642
|
}
|
|
53574
53643
|
}
|
|
53575
53644
|
}
|
|
53576
|
-
else if (
|
|
53577
|
-
if (
|
|
53645
|
+
else if (targetFlags & 8388608) {
|
|
53646
|
+
if (sourceFlags & 8388608) {
|
|
53578
53647
|
if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
|
|
53579
53648
|
result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
|
|
53580
53649
|
}
|
|
@@ -53653,7 +53722,7 @@ var ts;
|
|
|
53653
53722
|
}
|
|
53654
53723
|
}
|
|
53655
53724
|
}
|
|
53656
|
-
else if (
|
|
53725
|
+
else if (targetFlags & 16777216) {
|
|
53657
53726
|
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
|
|
53658
53727
|
resetErrorInfo(saveErrorInfo);
|
|
53659
53728
|
return 3;
|
|
@@ -53671,8 +53740,8 @@ var ts;
|
|
|
53671
53740
|
}
|
|
53672
53741
|
}
|
|
53673
53742
|
}
|
|
53674
|
-
else if (
|
|
53675
|
-
if (
|
|
53743
|
+
else if (targetFlags & 134217728) {
|
|
53744
|
+
if (sourceFlags & 134217728) {
|
|
53676
53745
|
if (relation === comparableRelation) {
|
|
53677
53746
|
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
|
|
53678
53747
|
}
|
|
@@ -53682,10 +53751,10 @@ var ts;
|
|
|
53682
53751
|
return -1;
|
|
53683
53752
|
}
|
|
53684
53753
|
}
|
|
53685
|
-
if (
|
|
53686
|
-
if (!(
|
|
53754
|
+
if (sourceFlags & 8650752) {
|
|
53755
|
+
if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
|
|
53687
53756
|
var constraint = getConstraintOfType(source);
|
|
53688
|
-
if (!constraint || (
|
|
53757
|
+
if (!constraint || (sourceFlags & 262144 && constraint.flags & 1)) {
|
|
53689
53758
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
|
|
53690
53759
|
resetErrorInfo(saveErrorInfo);
|
|
53691
53760
|
return result;
|
|
@@ -53695,7 +53764,7 @@ var ts;
|
|
|
53695
53764
|
resetErrorInfo(saveErrorInfo);
|
|
53696
53765
|
return result;
|
|
53697
53766
|
}
|
|
53698
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(
|
|
53767
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
|
|
53699
53768
|
resetErrorInfo(saveErrorInfo);
|
|
53700
53769
|
return result;
|
|
53701
53770
|
}
|
|
@@ -53710,14 +53779,14 @@ var ts;
|
|
|
53710
53779
|
}
|
|
53711
53780
|
}
|
|
53712
53781
|
}
|
|
53713
|
-
else if (
|
|
53782
|
+
else if (sourceFlags & 4194304) {
|
|
53714
53783
|
if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
|
|
53715
53784
|
resetErrorInfo(saveErrorInfo);
|
|
53716
53785
|
return result;
|
|
53717
53786
|
}
|
|
53718
53787
|
}
|
|
53719
|
-
else if (
|
|
53720
|
-
if (!(
|
|
53788
|
+
else if (sourceFlags & 134217728 && !(targetFlags & 524288)) {
|
|
53789
|
+
if (!(targetFlags & 134217728)) {
|
|
53721
53790
|
var constraint = getBaseConstraintOfType(source);
|
|
53722
53791
|
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
|
|
53723
53792
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -53725,8 +53794,8 @@ var ts;
|
|
|
53725
53794
|
}
|
|
53726
53795
|
}
|
|
53727
53796
|
}
|
|
53728
|
-
else if (
|
|
53729
|
-
if (
|
|
53797
|
+
else if (sourceFlags & 268435456) {
|
|
53798
|
+
if (targetFlags & 268435456 && source.symbol === target.symbol) {
|
|
53730
53799
|
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
|
|
53731
53800
|
resetErrorInfo(saveErrorInfo);
|
|
53732
53801
|
return result;
|
|
@@ -53740,12 +53809,12 @@ var ts;
|
|
|
53740
53809
|
}
|
|
53741
53810
|
}
|
|
53742
53811
|
}
|
|
53743
|
-
else if (
|
|
53812
|
+
else if (sourceFlags & 16777216) {
|
|
53744
53813
|
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
|
|
53745
53814
|
resetErrorInfo(saveErrorInfo);
|
|
53746
53815
|
return 3;
|
|
53747
53816
|
}
|
|
53748
|
-
if (
|
|
53817
|
+
if (targetFlags & 16777216) {
|
|
53749
53818
|
var sourceParams = source.root.inferTypeParameters;
|
|
53750
53819
|
var sourceExtends = source.extendsType;
|
|
53751
53820
|
var mapper = void 0;
|
|
@@ -53796,15 +53865,19 @@ var ts;
|
|
|
53796
53865
|
}
|
|
53797
53866
|
return 0;
|
|
53798
53867
|
}
|
|
53799
|
-
var sourceIsPrimitive = !!(
|
|
53868
|
+
var sourceIsPrimitive = !!(sourceFlags & 131068);
|
|
53800
53869
|
if (relation !== identityRelation) {
|
|
53801
53870
|
source = getApparentType(source);
|
|
53871
|
+
sourceFlags = source.flags;
|
|
53802
53872
|
}
|
|
53803
53873
|
else if (isGenericMappedType(source)) {
|
|
53804
53874
|
return 0;
|
|
53805
53875
|
}
|
|
53806
53876
|
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target &&
|
|
53807
53877
|
!isTupleType(source) && !(ts.getObjectFlags(source) & 4096 || ts.getObjectFlags(target) & 4096)) {
|
|
53878
|
+
if (isEmptyArrayLiteralType(source)) {
|
|
53879
|
+
return -1;
|
|
53880
|
+
}
|
|
53808
53881
|
var variances = getVariances(source.target);
|
|
53809
53882
|
if (variances === ts.emptyArray) {
|
|
53810
53883
|
return 1;
|
|
@@ -53825,7 +53898,7 @@ var ts;
|
|
|
53825
53898
|
else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 && !isEmptyObjectType(source)) {
|
|
53826
53899
|
return 0;
|
|
53827
53900
|
}
|
|
53828
|
-
if (
|
|
53901
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) {
|
|
53829
53902
|
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
|
|
53830
53903
|
result = propertiesRelatedTo(source, target, reportStructuralErrors, undefined, intersectionState);
|
|
53831
53904
|
if (result) {
|
|
@@ -53844,7 +53917,7 @@ var ts;
|
|
|
53844
53917
|
return result;
|
|
53845
53918
|
}
|
|
53846
53919
|
}
|
|
53847
|
-
if (
|
|
53920
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) {
|
|
53848
53921
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
|
|
53849
53922
|
if (objectOnlyTarget.flags & 1048576) {
|
|
53850
53923
|
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
@@ -54040,6 +54113,10 @@ var ts;
|
|
|
54040
54113
|
}
|
|
54041
54114
|
return 0;
|
|
54042
54115
|
}
|
|
54116
|
+
if ((relation === subtypeRelation || relation === strictSubtypeRelation) &&
|
|
54117
|
+
!!(sourcePropFlags & 64) && !(targetPropFlags & 64)) {
|
|
54118
|
+
return 0;
|
|
54119
|
+
}
|
|
54043
54120
|
var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);
|
|
54044
54121
|
if (!related) {
|
|
54045
54122
|
if (reportErrors) {
|
|
@@ -54290,7 +54367,6 @@ var ts;
|
|
|
54290
54367
|
}
|
|
54291
54368
|
}
|
|
54292
54369
|
var result = -1;
|
|
54293
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
54294
54370
|
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
54295
54371
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
54296
54372
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
@@ -54322,6 +54398,7 @@ var ts;
|
|
|
54322
54398
|
else {
|
|
54323
54399
|
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
|
|
54324
54400
|
var t = targetSignatures_1[_i];
|
|
54401
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
54325
54402
|
var shouldElaborateErrors = reportErrors;
|
|
54326
54403
|
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
|
|
54327
54404
|
var s = sourceSignatures_1[_c];
|
|
@@ -54427,8 +54504,8 @@ var ts;
|
|
|
54427
54504
|
var indexInfos = getIndexInfosOfType(target);
|
|
54428
54505
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
54429
54506
|
var result = -1;
|
|
54430
|
-
for (var _i = 0,
|
|
54431
|
-
var targetInfo =
|
|
54507
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
54508
|
+
var targetInfo = indexInfos_5[_i];
|
|
54432
54509
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
|
|
54433
54510
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
|
|
54434
54511
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -54658,7 +54735,7 @@ var ts;
|
|
|
54658
54735
|
var constraintMarker = "";
|
|
54659
54736
|
var sourceId = getTypeReferenceId(source, 0);
|
|
54660
54737
|
var targetId = getTypeReferenceId(target, 0);
|
|
54661
|
-
return ""
|
|
54738
|
+
return "" + constraintMarker + sourceId + "," + targetId + postFix;
|
|
54662
54739
|
function getTypeReferenceId(type, depth) {
|
|
54663
54740
|
if (depth === void 0) { depth = 0; }
|
|
54664
54741
|
var result = "" + type.target.id;
|
|
@@ -54694,7 +54771,7 @@ var ts;
|
|
|
54694
54771
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
54695
54772
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
54696
54773
|
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
54697
|
-
|
|
54774
|
+
source.id + "," + target.id + postFix;
|
|
54698
54775
|
}
|
|
54699
54776
|
function forEachProperty(prop, callback) {
|
|
54700
54777
|
if (ts.getCheckFlags(prop) & 6) {
|
|
@@ -54937,10 +55014,10 @@ var ts;
|
|
|
54937
55014
|
if (!(ts.getObjectFlags(type) & 4) || !(ts.getObjectFlags(type.target) & 3)) {
|
|
54938
55015
|
return undefined;
|
|
54939
55016
|
}
|
|
54940
|
-
if (ts.getObjectFlags(type) &
|
|
54941
|
-
return ts.getObjectFlags(type) &
|
|
55017
|
+
if (ts.getObjectFlags(type) & 67108864) {
|
|
55018
|
+
return ts.getObjectFlags(type) & 134217728 ? type.cachedEquivalentBaseType : undefined;
|
|
54942
55019
|
}
|
|
54943
|
-
type.objectFlags |=
|
|
55020
|
+
type.objectFlags |= 67108864;
|
|
54944
55021
|
var target = type.target;
|
|
54945
55022
|
if (ts.getObjectFlags(target) & 1) {
|
|
54946
55023
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -54959,7 +55036,7 @@ var ts;
|
|
|
54959
55036
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
54960
55037
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
54961
55038
|
}
|
|
54962
|
-
type.objectFlags |=
|
|
55039
|
+
type.objectFlags |= 134217728;
|
|
54963
55040
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
54964
55041
|
}
|
|
54965
55042
|
function isEmptyLiteralType(type) {
|
|
@@ -55556,7 +55633,7 @@ var ts;
|
|
|
55556
55633
|
var result = !!(type.flags & 465829888 ||
|
|
55557
55634
|
type.flags & 524288 && !isNonGenericTopLevelType(type) && (objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
55558
55635
|
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ||
|
|
55559
|
-
objectFlags & (32 | 1024 | 8388608)) ||
|
|
55636
|
+
objectFlags & (32 | 1024 | 8388608 | 16777216)) ||
|
|
55560
55637
|
type.flags & 3145728 && !(type.flags & 1024) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
55561
55638
|
if (type.flags & 3899393) {
|
|
55562
55639
|
type.objectFlags |= 1048576 | (result ? 2097152 : 0);
|
|
@@ -56323,8 +56400,8 @@ var ts;
|
|
|
56323
56400
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32) ? 8 : 0;
|
|
56324
56401
|
var indexInfos = getIndexInfosOfType(target);
|
|
56325
56402
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
56326
|
-
for (var _i = 0,
|
|
56327
|
-
var targetInfo =
|
|
56403
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
56404
|
+
var targetInfo = indexInfos_6[_i];
|
|
56328
56405
|
var propTypes = [];
|
|
56329
56406
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
56330
56407
|
var prop = _b[_a];
|
|
@@ -56344,8 +56421,8 @@ var ts;
|
|
|
56344
56421
|
}
|
|
56345
56422
|
}
|
|
56346
56423
|
}
|
|
56347
|
-
for (var _e = 0,
|
|
56348
|
-
var targetInfo =
|
|
56424
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
56425
|
+
var targetInfo = indexInfos_7[_e];
|
|
56349
56426
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
56350
56427
|
if (sourceInfo) {
|
|
56351
56428
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -56517,10 +56594,10 @@ var ts;
|
|
|
56517
56594
|
case 79:
|
|
56518
56595
|
if (!ts.isThisInTypeQuery(node)) {
|
|
56519
56596
|
var symbol = getResolvedSymbol(node);
|
|
56520
|
-
return symbol !== unknownSymbol ?
|
|
56597
|
+
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
|
|
56521
56598
|
}
|
|
56522
56599
|
case 108:
|
|
56523
|
-
return "0|"
|
|
56600
|
+
return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
|
|
56524
56601
|
case 229:
|
|
56525
56602
|
case 211:
|
|
56526
56603
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -57110,9 +57187,6 @@ var ts;
|
|
|
57110
57187
|
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) :
|
|
57111
57188
|
mapType(type, mapper);
|
|
57112
57189
|
}
|
|
57113
|
-
function getConstituentCount(type) {
|
|
57114
|
-
return type.flags & 1048576 ? type.types.length : 1;
|
|
57115
|
-
}
|
|
57116
57190
|
function extractTypesOfKind(type, kind) {
|
|
57117
57191
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
57118
57192
|
}
|
|
@@ -59837,7 +59911,7 @@ var ts;
|
|
|
59837
59911
|
!leftName ? rightName :
|
|
59838
59912
|
!rightName ? leftName :
|
|
59839
59913
|
undefined;
|
|
59840
|
-
var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg"
|
|
59914
|
+
var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg" + i);
|
|
59841
59915
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
59842
59916
|
params[i] = paramSymbol;
|
|
59843
59917
|
}
|
|
@@ -61070,6 +61144,9 @@ var ts;
|
|
|
61070
61144
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
61071
61145
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
61072
61146
|
}
|
|
61147
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
61148
|
+
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
61149
|
+
}
|
|
61073
61150
|
}
|
|
61074
61151
|
else {
|
|
61075
61152
|
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
@@ -63305,6 +63382,72 @@ var ts;
|
|
|
63305
63382
|
return node.flags & 32 ? checkNonNullChain(node) :
|
|
63306
63383
|
getNonNullableType(checkExpression(node.expression));
|
|
63307
63384
|
}
|
|
63385
|
+
function checkExpressionWithTypeArguments(node) {
|
|
63386
|
+
checkGrammarExpressionWithTypeArguments(node);
|
|
63387
|
+
var exprType = node.kind === 227 ? checkExpression(node.expression) :
|
|
63388
|
+
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
63389
|
+
checkExpression(node.exprName);
|
|
63390
|
+
var typeArguments = node.typeArguments;
|
|
63391
|
+
if (exprType === silentNeverType || isErrorType(exprType) || !ts.some(typeArguments)) {
|
|
63392
|
+
return exprType;
|
|
63393
|
+
}
|
|
63394
|
+
var hasSomeApplicableSignature = false;
|
|
63395
|
+
var nonApplicableType;
|
|
63396
|
+
var result = getInstantiatedType(exprType);
|
|
63397
|
+
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
63398
|
+
if (errorType) {
|
|
63399
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
63400
|
+
}
|
|
63401
|
+
return result;
|
|
63402
|
+
function getInstantiatedType(type) {
|
|
63403
|
+
var hasSignatures = false;
|
|
63404
|
+
var hasApplicableSignature = false;
|
|
63405
|
+
var result = getInstantiatedTypePart(type);
|
|
63406
|
+
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
63407
|
+
if (hasSignatures && !hasApplicableSignature) {
|
|
63408
|
+
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
63409
|
+
}
|
|
63410
|
+
return result;
|
|
63411
|
+
function getInstantiatedTypePart(type) {
|
|
63412
|
+
if (type.flags & 524288) {
|
|
63413
|
+
var resolved = resolveStructuredTypeMembers(type);
|
|
63414
|
+
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
63415
|
+
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
63416
|
+
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
63417
|
+
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
63418
|
+
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
63419
|
+
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
63420
|
+
result_11.objectFlags |= 16777216;
|
|
63421
|
+
result_11.node = node;
|
|
63422
|
+
return result_11;
|
|
63423
|
+
}
|
|
63424
|
+
}
|
|
63425
|
+
else if (type.flags & 58982400) {
|
|
63426
|
+
var constraint = getBaseConstraintOfType(type);
|
|
63427
|
+
if (constraint) {
|
|
63428
|
+
var instantiated = getInstantiatedTypePart(constraint);
|
|
63429
|
+
if (instantiated !== constraint) {
|
|
63430
|
+
return instantiated;
|
|
63431
|
+
}
|
|
63432
|
+
}
|
|
63433
|
+
}
|
|
63434
|
+
else if (type.flags & 1048576) {
|
|
63435
|
+
return mapType(type, getInstantiatedType);
|
|
63436
|
+
}
|
|
63437
|
+
else if (type.flags & 2097152) {
|
|
63438
|
+
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
|
|
63439
|
+
}
|
|
63440
|
+
return type;
|
|
63441
|
+
}
|
|
63442
|
+
}
|
|
63443
|
+
function getInstantiatedSignatures(signatures) {
|
|
63444
|
+
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
63445
|
+
return ts.sameMap(applicableSignatures, function (sig) {
|
|
63446
|
+
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, true);
|
|
63447
|
+
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
63448
|
+
});
|
|
63449
|
+
}
|
|
63450
|
+
}
|
|
63308
63451
|
function checkMetaProperty(node) {
|
|
63309
63452
|
checkGrammarMetaProperty(node);
|
|
63310
63453
|
if (node.keywordToken === 103) {
|
|
@@ -63621,19 +63764,20 @@ var ts;
|
|
|
63621
63764
|
if (links.type === unknownType) {
|
|
63622
63765
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
63623
63766
|
}
|
|
63624
|
-
assignBindingElementTypes(declaration.name);
|
|
63767
|
+
assignBindingElementTypes(declaration.name, links.type);
|
|
63625
63768
|
}
|
|
63626
63769
|
}
|
|
63627
63770
|
}
|
|
63628
|
-
function assignBindingElementTypes(pattern) {
|
|
63771
|
+
function assignBindingElementTypes(pattern, parentType) {
|
|
63629
63772
|
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
|
|
63630
63773
|
var element = _a[_i];
|
|
63631
63774
|
if (!ts.isOmittedExpression(element)) {
|
|
63775
|
+
var type = getBindingElementTypeFromParentType(element, parentType);
|
|
63632
63776
|
if (element.name.kind === 79) {
|
|
63633
|
-
getSymbolLinks(getSymbolOfNode(element)).type =
|
|
63777
|
+
getSymbolLinks(getSymbolOfNode(element)).type = type;
|
|
63634
63778
|
}
|
|
63635
63779
|
else {
|
|
63636
|
-
assignBindingElementTypes(element.name);
|
|
63780
|
+
assignBindingElementTypes(element.name, type);
|
|
63637
63781
|
}
|
|
63638
63782
|
}
|
|
63639
63783
|
}
|
|
@@ -64622,7 +64766,7 @@ var ts;
|
|
|
64622
64766
|
if (operator === 55 || operator === 56 || operator === 60) {
|
|
64623
64767
|
if (operator === 55) {
|
|
64624
64768
|
var parent = ts.walkUpParenthesizedExpressions(node.parent);
|
|
64625
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.left,
|
|
64769
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.left, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
|
|
64626
64770
|
}
|
|
64627
64771
|
checkTruthinessOfType(leftType, node.left);
|
|
64628
64772
|
}
|
|
@@ -65085,8 +65229,8 @@ var ts;
|
|
|
65085
65229
|
return type;
|
|
65086
65230
|
}
|
|
65087
65231
|
function checkConditionalExpression(node, checkMode) {
|
|
65088
|
-
|
|
65089
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.condition,
|
|
65232
|
+
checkTruthinessExpression(node.condition);
|
|
65233
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.condition, node.whenTrue);
|
|
65090
65234
|
var type1 = checkExpression(node.whenTrue, checkMode);
|
|
65091
65235
|
var type2 = checkExpression(node.whenFalse, checkMode);
|
|
65092
65236
|
return getUnionType([type1, type2], 2);
|
|
@@ -65541,6 +65685,8 @@ var ts;
|
|
|
65541
65685
|
return checkAssertion(node);
|
|
65542
65686
|
case 229:
|
|
65543
65687
|
return checkNonNullAssertion(node);
|
|
65688
|
+
case 227:
|
|
65689
|
+
return checkExpressionWithTypeArguments(node);
|
|
65544
65690
|
case 230:
|
|
65545
65691
|
return checkMetaProperty(node);
|
|
65546
65692
|
case 214:
|
|
@@ -66623,12 +66769,12 @@ var ts;
|
|
|
66623
66769
|
case 264:
|
|
66624
66770
|
case 267:
|
|
66625
66771
|
case 266:
|
|
66626
|
-
var
|
|
66772
|
+
var result_12 = 0;
|
|
66627
66773
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
66628
66774
|
ts.forEach(target.declarations, function (d) {
|
|
66629
|
-
|
|
66775
|
+
result_12 |= getDeclarationSpaces(d);
|
|
66630
66776
|
});
|
|
66631
|
-
return
|
|
66777
|
+
return result_12;
|
|
66632
66778
|
case 253:
|
|
66633
66779
|
case 202:
|
|
66634
66780
|
case 255:
|
|
@@ -66828,26 +66974,24 @@ var ts;
|
|
|
66828
66974
|
if (returnType.flags & 1) {
|
|
66829
66975
|
return;
|
|
66830
66976
|
}
|
|
66977
|
+
var headMessage;
|
|
66831
66978
|
var expectedReturnType;
|
|
66832
|
-
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
|
|
66833
|
-
var errorInfo;
|
|
66834
66979
|
switch (node.parent.kind) {
|
|
66835
66980
|
case 256:
|
|
66981
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66836
66982
|
var classSymbol = getSymbolOfNode(node.parent);
|
|
66837
66983
|
var classConstructorType = getTypeOfSymbol(classSymbol);
|
|
66838
66984
|
expectedReturnType = getUnionType([classConstructorType, voidType]);
|
|
66839
66985
|
break;
|
|
66840
|
-
case 163:
|
|
66841
|
-
expectedReturnType = voidType;
|
|
66842
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
|
|
66843
|
-
break;
|
|
66844
66986
|
case 166:
|
|
66987
|
+
case 163:
|
|
66988
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
|
|
66845
66989
|
expectedReturnType = voidType;
|
|
66846
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
|
|
66847
66990
|
break;
|
|
66848
66991
|
case 168:
|
|
66849
66992
|
case 171:
|
|
66850
66993
|
case 172:
|
|
66994
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66851
66995
|
var methodType = getTypeOfNode(node.parent);
|
|
66852
66996
|
var descriptorType = createTypedPropertyDescriptorType(methodType);
|
|
66853
66997
|
expectedReturnType = getUnionType([descriptorType, voidType]);
|
|
@@ -66855,7 +66999,7 @@ var ts;
|
|
|
66855
66999
|
default:
|
|
66856
67000
|
return ts.Debug.fail();
|
|
66857
67001
|
}
|
|
66858
|
-
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage
|
|
67002
|
+
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
|
|
66859
67003
|
}
|
|
66860
67004
|
function markTypeNodeAsReferenced(node) {
|
|
66861
67005
|
markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node));
|
|
@@ -67757,44 +67901,53 @@ var ts;
|
|
|
67757
67901
|
}
|
|
67758
67902
|
function checkIfStatement(node) {
|
|
67759
67903
|
checkGrammarStatementInAmbientContext(node);
|
|
67760
|
-
|
|
67761
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.expression,
|
|
67904
|
+
checkTruthinessExpression(node.expression);
|
|
67905
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, node.thenStatement);
|
|
67762
67906
|
checkSourceElement(node.thenStatement);
|
|
67763
67907
|
if (node.thenStatement.kind === 235) {
|
|
67764
67908
|
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
|
|
67765
67909
|
}
|
|
67766
67910
|
checkSourceElement(node.elseStatement);
|
|
67767
67911
|
}
|
|
67768
|
-
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr,
|
|
67912
|
+
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, body) {
|
|
67769
67913
|
if (!strictNullChecks)
|
|
67770
67914
|
return;
|
|
67771
|
-
|
|
67772
|
-
|
|
67773
|
-
|
|
67774
|
-
|
|
67775
|
-
|
|
67776
|
-
|
|
67777
|
-
|
|
67778
|
-
|
|
67779
|
-
|
|
67780
|
-
|
|
67781
|
-
|
|
67782
|
-
|
|
67783
|
-
|
|
67784
|
-
|
|
67785
|
-
|
|
67786
|
-
|
|
67787
|
-
|
|
67788
|
-
|
|
67789
|
-
}
|
|
67790
|
-
var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|
|
67791
|
-
|| testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
|
|
67792
|
-
if (!isUsed) {
|
|
67793
|
-
if (isPromise) {
|
|
67794
|
-
errorAndMaybeSuggestAwait(location, true, ts.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, getTypeNameForErrorDisplay(type));
|
|
67915
|
+
helper(condExpr, body);
|
|
67916
|
+
while (ts.isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56) {
|
|
67917
|
+
condExpr = condExpr.left;
|
|
67918
|
+
helper(condExpr, body);
|
|
67919
|
+
}
|
|
67920
|
+
function helper(condExpr, body) {
|
|
67921
|
+
var location = ts.isBinaryExpression(condExpr) &&
|
|
67922
|
+
(condExpr.operatorToken.kind === 56 || condExpr.operatorToken.kind === 55)
|
|
67923
|
+
? condExpr.right
|
|
67924
|
+
: condExpr;
|
|
67925
|
+
var type = checkTruthinessExpression(location);
|
|
67926
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
67927
|
+
if (getFalsyFlags(type) || isPropertyExpressionCast)
|
|
67928
|
+
return;
|
|
67929
|
+
var callSignatures = getSignaturesOfType(type, 0);
|
|
67930
|
+
var isPromise = !!getAwaitedTypeOfPromise(type);
|
|
67931
|
+
if (callSignatures.length === 0 && !isPromise) {
|
|
67932
|
+
return;
|
|
67795
67933
|
}
|
|
67796
|
-
|
|
67797
|
-
|
|
67934
|
+
var testedNode = ts.isIdentifier(location) ? location
|
|
67935
|
+
: ts.isPropertyAccessExpression(location) ? location.name
|
|
67936
|
+
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
67937
|
+
: undefined;
|
|
67938
|
+
var testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
67939
|
+
if (!testedSymbol && !isPromise) {
|
|
67940
|
+
return;
|
|
67941
|
+
}
|
|
67942
|
+
var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|
|
67943
|
+
|| testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
|
|
67944
|
+
if (!isUsed) {
|
|
67945
|
+
if (isPromise) {
|
|
67946
|
+
errorAndMaybeSuggestAwait(location, true, ts.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, getTypeNameForErrorDisplay(type));
|
|
67947
|
+
}
|
|
67948
|
+
else {
|
|
67949
|
+
error(location, ts.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead);
|
|
67950
|
+
}
|
|
67798
67951
|
}
|
|
67799
67952
|
}
|
|
67800
67953
|
}
|
|
@@ -68256,7 +68409,7 @@ var ts;
|
|
|
68256
68409
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
68257
68410
|
var ctorType = getGlobalESSymbolConstructorSymbol(false);
|
|
68258
68411
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
68259
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
68412
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
|
|
68260
68413
|
}
|
|
68261
68414
|
function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
|
|
68262
68415
|
var _a;
|
|
@@ -68627,8 +68780,8 @@ var ts;
|
|
|
68627
68780
|
}
|
|
68628
68781
|
}
|
|
68629
68782
|
if (indexInfos.length > 1) {
|
|
68630
|
-
for (var _d = 0,
|
|
68631
|
-
var info =
|
|
68783
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
68784
|
+
var info = indexInfos_8[_d];
|
|
68632
68785
|
checkIndexConstraintForIndexSignature(type, info);
|
|
68633
68786
|
}
|
|
68634
68787
|
}
|
|
@@ -68651,8 +68804,8 @@ var ts;
|
|
|
68651
68804
|
error(errorNode, ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
|
|
68652
68805
|
}
|
|
68653
68806
|
};
|
|
68654
|
-
for (var _i = 0,
|
|
68655
|
-
var info =
|
|
68807
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
68808
|
+
var info = indexInfos_9[_i];
|
|
68656
68809
|
_loop_27(info);
|
|
68657
68810
|
}
|
|
68658
68811
|
}
|
|
@@ -68671,8 +68824,8 @@ var ts;
|
|
|
68671
68824
|
error(errorNode, ts.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
|
|
68672
68825
|
}
|
|
68673
68826
|
};
|
|
68674
|
-
for (var _i = 0,
|
|
68675
|
-
var info =
|
|
68827
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
68828
|
+
var info = indexInfos_10[_i];
|
|
68676
68829
|
_loop_28(info);
|
|
68677
68830
|
}
|
|
68678
68831
|
}
|
|
@@ -70162,10 +70315,10 @@ var ts;
|
|
|
70162
70315
|
if (id === "__export") {
|
|
70163
70316
|
return;
|
|
70164
70317
|
}
|
|
70165
|
-
if (flags & (1920 |
|
|
70318
|
+
if (flags & (1920 | 384)) {
|
|
70166
70319
|
return;
|
|
70167
70320
|
}
|
|
70168
|
-
var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverloadAndNotAccessor);
|
|
70321
|
+
var exportedDeclarationsCount = ts.countWhere(declarations, ts.and(isNotOverloadAndNotAccessor, ts.not(ts.isInterfaceDeclaration)));
|
|
70169
70322
|
if (flags & 524288 && exportedDeclarationsCount <= 2) {
|
|
70170
70323
|
return;
|
|
70171
70324
|
}
|
|
@@ -71640,13 +71793,13 @@ var ts;
|
|
|
71640
71793
|
var fileToDirective;
|
|
71641
71794
|
if (resolvedTypeReferenceDirectives) {
|
|
71642
71795
|
fileToDirective = new ts.Map();
|
|
71643
|
-
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) {
|
|
71796
|
+
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key, mode) {
|
|
71644
71797
|
if (!resolvedDirective || !resolvedDirective.resolvedFileName) {
|
|
71645
71798
|
return;
|
|
71646
71799
|
}
|
|
71647
71800
|
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
|
|
71648
71801
|
if (file) {
|
|
71649
|
-
addReferencedFilesToTypeDirective(file, key);
|
|
71802
|
+
addReferencedFilesToTypeDirective(file, key, mode);
|
|
71650
71803
|
}
|
|
71651
71804
|
});
|
|
71652
71805
|
}
|
|
@@ -71824,16 +71977,16 @@ var ts;
|
|
|
71824
71977
|
}
|
|
71825
71978
|
return false;
|
|
71826
71979
|
}
|
|
71827
|
-
function addReferencedFilesToTypeDirective(file, key) {
|
|
71980
|
+
function addReferencedFilesToTypeDirective(file, key, mode) {
|
|
71828
71981
|
if (fileToDirective.has(file.path))
|
|
71829
71982
|
return;
|
|
71830
|
-
fileToDirective.set(file.path, key);
|
|
71983
|
+
fileToDirective.set(file.path, [key, mode]);
|
|
71831
71984
|
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
|
|
71832
|
-
var
|
|
71985
|
+
var _b = _a[_i], fileName = _b.fileName, resolutionMode = _b.resolutionMode;
|
|
71833
71986
|
var resolvedFile = ts.resolveTripleslashReference(fileName, file.fileName);
|
|
71834
71987
|
var referencedFile = host.getSourceFile(resolvedFile);
|
|
71835
71988
|
if (referencedFile) {
|
|
71836
|
-
addReferencedFilesToTypeDirective(referencedFile, key);
|
|
71989
|
+
addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat);
|
|
71837
71990
|
}
|
|
71838
71991
|
}
|
|
71839
71992
|
}
|
|
@@ -73424,25 +73577,24 @@ var ts;
|
|
|
73424
73577
|
}
|
|
73425
73578
|
function findMostOverlappyType(source, unionTarget) {
|
|
73426
73579
|
var bestMatch;
|
|
73427
|
-
|
|
73428
|
-
|
|
73429
|
-
var
|
|
73430
|
-
|
|
73431
|
-
|
|
73432
|
-
|
|
73433
|
-
|
|
73434
|
-
|
|
73435
|
-
|
|
73436
|
-
|
|
73437
|
-
|
|
73438
|
-
|
|
73439
|
-
|
|
73580
|
+
if (!(source.flags & (131068 | 406847488))) {
|
|
73581
|
+
var matchingCount = 0;
|
|
73582
|
+
for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
|
|
73583
|
+
var target = _a[_i];
|
|
73584
|
+
if (!(target.flags & (131068 | 406847488))) {
|
|
73585
|
+
var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
|
|
73586
|
+
if (overlap.flags & 4194304) {
|
|
73587
|
+
return target;
|
|
73588
|
+
}
|
|
73589
|
+
else if (isUnitType(overlap) || overlap.flags & 1048576) {
|
|
73590
|
+
var len = overlap.flags & 1048576 ? ts.countWhere(overlap.types, isUnitType) : 1;
|
|
73591
|
+
if (len >= matchingCount) {
|
|
73592
|
+
bestMatch = target;
|
|
73593
|
+
matchingCount = len;
|
|
73594
|
+
}
|
|
73595
|
+
}
|
|
73440
73596
|
}
|
|
73441
73597
|
}
|
|
73442
|
-
else if (isUnitType(overlap) && 1 >= matchingCount) {
|
|
73443
|
-
bestMatch = target;
|
|
73444
|
-
matchingCount = 1;
|
|
73445
|
-
}
|
|
73446
73598
|
}
|
|
73447
73599
|
return bestMatch;
|
|
73448
73600
|
}
|
|
@@ -73767,7 +73919,7 @@ var ts;
|
|
|
73767
73919
|
return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
73768
73920
|
case 180:
|
|
73769
73921
|
ts.Debug.type(node);
|
|
73770
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
73922
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
73771
73923
|
case 181:
|
|
73772
73924
|
ts.Debug.type(node);
|
|
73773
73925
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -74582,7 +74734,7 @@ var ts;
|
|
|
74582
74734
|
value >= 52 && value < 62 ? 48 + value - 52 :
|
|
74583
74735
|
value === 62 ? 43 :
|
|
74584
74736
|
value === 63 ? 47 :
|
|
74585
|
-
ts.Debug.fail(
|
|
74737
|
+
ts.Debug.fail(value + ": not a base64 value");
|
|
74586
74738
|
}
|
|
74587
74739
|
function base64FormatDecode(ch) {
|
|
74588
74740
|
return ch >= 65 && ch <= 90 ? ch - 65 :
|
|
@@ -74655,7 +74807,7 @@ var ts;
|
|
|
74655
74807
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
74656
74808
|
if (decoder.error !== undefined) {
|
|
74657
74809
|
if (host.log) {
|
|
74658
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
74810
|
+
host.log("Encountered error while decoding sourcemap: " + decoder.error);
|
|
74659
74811
|
}
|
|
74660
74812
|
decodedMappings = ts.emptyArray;
|
|
74661
74813
|
}
|
|
@@ -75986,8 +76138,8 @@ var ts;
|
|
|
75986
76138
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
75987
76139
|
var members = getDecoratedClassElements(node, isStatic);
|
|
75988
76140
|
var expressions;
|
|
75989
|
-
for (var _i = 0,
|
|
75990
|
-
var member =
|
|
76141
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
76142
|
+
var member = members_8[_i];
|
|
75991
76143
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
75992
76144
|
if (expression) {
|
|
75993
76145
|
if (!expressions) {
|
|
@@ -77098,7 +77250,7 @@ var ts;
|
|
|
77098
77250
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
77099
77251
|
? ts.declarationNameToString(originalNode.name)
|
|
77100
77252
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
77101
|
-
ts.addSyntheticTrailingComment(substitute, 3, " "
|
|
77253
|
+
ts.addSyntheticTrailingComment(substitute, 3, " " + propertyName + " ");
|
|
77102
77254
|
}
|
|
77103
77255
|
return substitute;
|
|
77104
77256
|
}
|
|
@@ -78348,8 +78500,8 @@ var ts;
|
|
|
78348
78500
|
}
|
|
78349
78501
|
function createHoistedVariableForClass(name, node) {
|
|
78350
78502
|
var className = getPrivateIdentifierEnvironment().className;
|
|
78351
|
-
var prefix = className ? "_"
|
|
78352
|
-
var identifier = factory.createUniqueName(
|
|
78503
|
+
var prefix = className ? "_" + className : "";
|
|
78504
|
+
var identifier = factory.createUniqueName(prefix + "_" + name, 16);
|
|
78353
78505
|
if (resolver.getNodeCheckFlags(node) & 524288) {
|
|
78354
78506
|
addBlockScopedVariable(identifier);
|
|
78355
78507
|
}
|
|
@@ -80007,7 +80159,7 @@ var ts;
|
|
|
80007
80159
|
specifierSourceImports = new ts.Map();
|
|
80008
80160
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
80009
80161
|
}
|
|
80010
|
-
var generatedName = factory.createUniqueName("_"
|
|
80162
|
+
var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64);
|
|
80011
80163
|
var specifier = factory.createImportSpecifier(false, factory.createIdentifier(name), generatedName);
|
|
80012
80164
|
generatedName.generatedImportReference = specifier;
|
|
80013
80165
|
specifierSourceImports.set(name, specifier);
|
|
@@ -80124,8 +80276,8 @@ var ts;
|
|
|
80124
80276
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
80125
80277
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
80126
80278
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
80127
|
-
var
|
|
80128
|
-
return
|
|
80279
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
80280
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
80129
80281
|
}
|
|
80130
80282
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
80131
80283
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -80948,11 +81100,11 @@ var ts;
|
|
|
80948
81100
|
}
|
|
80949
81101
|
else {
|
|
80950
81102
|
if (node.kind === 245) {
|
|
80951
|
-
labelMarker = "break-"
|
|
81103
|
+
labelMarker = "break-" + label.escapedText;
|
|
80952
81104
|
setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker);
|
|
80953
81105
|
}
|
|
80954
81106
|
else {
|
|
80955
|
-
labelMarker = "continue-"
|
|
81107
|
+
labelMarker = "continue-" + label.escapedText;
|
|
80956
81108
|
setLabeledJump(convertedLoopState, false, ts.idText(label), labelMarker);
|
|
80957
81109
|
}
|
|
80958
81110
|
}
|
|
@@ -86607,7 +86759,7 @@ var ts;
|
|
|
86607
86759
|
return getTypeAliasDeclarationVisibilityError;
|
|
86608
86760
|
}
|
|
86609
86761
|
else {
|
|
86610
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
86762
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
|
|
86611
86763
|
}
|
|
86612
86764
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
86613
86765
|
if (node.kind === 253 || node.kind === 202) {
|
|
@@ -86804,7 +86956,7 @@ var ts;
|
|
|
86804
86956
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
86805
86957
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
86806
86958
|
default:
|
|
86807
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
86959
|
+
return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
|
|
86808
86960
|
}
|
|
86809
86961
|
}
|
|
86810
86962
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -87126,7 +87278,7 @@ var ts;
|
|
|
87126
87278
|
var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
|
|
87127
87279
|
hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
|
|
87128
87280
|
collectReferences(sourceFile, refs);
|
|
87129
|
-
recordTypeReferenceDirectivesIfNecessary(sourceFile.typeReferenceDirectives);
|
|
87281
|
+
recordTypeReferenceDirectivesIfNecessary(ts.map(sourceFile.typeReferenceDirectives, function (ref) { return [ref.fileName, ref.resolutionMode]; }));
|
|
87130
87282
|
collectLibs(sourceFile, libs);
|
|
87131
87283
|
return sourceFile;
|
|
87132
87284
|
}
|
|
@@ -87180,9 +87332,10 @@ var ts;
|
|
|
87180
87332
|
return ts.map(ts.arrayFrom(libs.keys()), function (lib) { return ({ fileName: lib, pos: -1, end: -1 }); });
|
|
87181
87333
|
}
|
|
87182
87334
|
function getFileReferencesForUsedTypeReferences() {
|
|
87183
|
-
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()),
|
|
87335
|
+
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : [];
|
|
87184
87336
|
}
|
|
87185
|
-
function
|
|
87337
|
+
function getFileReferenceForSpecifierModeTuple(_a) {
|
|
87338
|
+
var typeName = _a[0], mode = _a[1];
|
|
87186
87339
|
if (emittedImports) {
|
|
87187
87340
|
for (var _i = 0, emittedImports_1 = emittedImports; _i < emittedImports_1.length; _i++) {
|
|
87188
87341
|
var importStatement = emittedImports_1[_i];
|
|
@@ -87197,7 +87350,7 @@ var ts;
|
|
|
87197
87350
|
}
|
|
87198
87351
|
}
|
|
87199
87352
|
}
|
|
87200
|
-
return { fileName: typeName, pos: -1, end: -1 };
|
|
87353
|
+
return __assign({ fileName: typeName, pos: -1, end: -1 }, (mode ? { resolutionMode: mode } : undefined));
|
|
87201
87354
|
}
|
|
87202
87355
|
function mapReferencesIntoArray(references, outputFilePath) {
|
|
87203
87356
|
return function (file) {
|
|
@@ -87214,7 +87367,7 @@ var ts;
|
|
|
87214
87367
|
if (declFileName) {
|
|
87215
87368
|
var specifier = ts.moduleSpecifiers.getModuleSpecifier(options, currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host);
|
|
87216
87369
|
if (!ts.pathIsRelative(specifier)) {
|
|
87217
|
-
recordTypeReferenceDirectivesIfNecessary([specifier]);
|
|
87370
|
+
recordTypeReferenceDirectivesIfNecessary([[specifier, undefined]]);
|
|
87218
87371
|
return;
|
|
87219
87372
|
}
|
|
87220
87373
|
var fileName = ts.getRelativePathToDirectoryOrUrl(outputFilePath, declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false);
|
|
@@ -87491,7 +87644,7 @@ var ts;
|
|
|
87491
87644
|
while (ts.length(lateMarkedStatements)) {
|
|
87492
87645
|
var i = lateMarkedStatements.shift();
|
|
87493
87646
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
87494
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
87647
|
+
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
|
|
87495
87648
|
}
|
|
87496
87649
|
var priorNeedsDeclare = needsDeclare;
|
|
87497
87650
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -87656,7 +87809,7 @@ var ts;
|
|
|
87656
87809
|
return cleanup(input);
|
|
87657
87810
|
return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
|
|
87658
87811
|
}
|
|
87659
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
87812
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
|
|
87660
87813
|
}
|
|
87661
87814
|
}
|
|
87662
87815
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -87900,7 +88053,7 @@ var ts;
|
|
|
87900
88053
|
var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
|
|
87901
88054
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104) {
|
|
87902
88055
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
87903
|
-
var newId_1 = factory.createUniqueName(
|
|
88056
|
+
var newId_1 = factory.createUniqueName(oldId + "_base", 16);
|
|
87904
88057
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
87905
88058
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
87906
88059
|
errorNode: extendsClause_1,
|
|
@@ -87937,7 +88090,7 @@ var ts;
|
|
|
87937
88090
|
}))));
|
|
87938
88091
|
}
|
|
87939
88092
|
}
|
|
87940
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
88093
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
|
|
87941
88094
|
function cleanup(node) {
|
|
87942
88095
|
if (isEnclosingDeclaration(input)) {
|
|
87943
88096
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -88706,13 +88859,13 @@ var ts;
|
|
|
88706
88859
|
if (ts.fileExtensionIs(inputFileName, ".json"))
|
|
88707
88860
|
return;
|
|
88708
88861
|
if (js && configFile.options.sourceMap) {
|
|
88709
|
-
addOutput(
|
|
88862
|
+
addOutput(js + ".map");
|
|
88710
88863
|
}
|
|
88711
88864
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
88712
88865
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
88713
88866
|
addOutput(dts);
|
|
88714
88867
|
if (configFile.options.declarationMap) {
|
|
88715
|
-
addOutput(
|
|
88868
|
+
addOutput(dts + ".map");
|
|
88716
88869
|
}
|
|
88717
88870
|
}
|
|
88718
88871
|
}
|
|
@@ -88772,7 +88925,7 @@ var ts;
|
|
|
88772
88925
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
88773
88926
|
if (ts.outFile(configFile.options)) {
|
|
88774
88927
|
var jsFilePath = getOutputPathsForBundle(configFile.options, false).jsFilePath;
|
|
88775
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
88928
|
+
return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
|
|
88776
88929
|
}
|
|
88777
88930
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
88778
88931
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -88791,7 +88944,7 @@ var ts;
|
|
|
88791
88944
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
88792
88945
|
if (buildInfoPath)
|
|
88793
88946
|
return buildInfoPath;
|
|
88794
|
-
return ts.Debug.fail("project "
|
|
88947
|
+
return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
|
|
88795
88948
|
}
|
|
88796
88949
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
88797
88950
|
function emitFiles(resolver, host, targetSourceFile, _a, emitOnlyDtsFiles, onlyBuildInfo, forceDtsEmit) {
|
|
@@ -89001,7 +89154,7 @@ var ts;
|
|
|
89001
89154
|
if (sourceMappingURL) {
|
|
89002
89155
|
if (!writer.isAtStartOfLine())
|
|
89003
89156
|
writer.rawWrite(newLine);
|
|
89004
|
-
writer.writeComment("//# "
|
|
89157
|
+
writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL);
|
|
89005
89158
|
}
|
|
89006
89159
|
if (sourceMapFilePath) {
|
|
89007
89160
|
var sourceMap = sourceMapGenerator.toString();
|
|
@@ -89041,7 +89194,7 @@ var ts;
|
|
|
89041
89194
|
if (mapOptions.inlineSourceMap) {
|
|
89042
89195
|
var sourceMapText = sourceMapGenerator.toString();
|
|
89043
89196
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
89044
|
-
return "data:application/json;base64,"
|
|
89197
|
+
return "data:application/json;base64," + base64SourceMapText;
|
|
89045
89198
|
}
|
|
89046
89199
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
89047
89200
|
if (mapOptions.mapRoot) {
|
|
@@ -89205,7 +89358,7 @@ var ts;
|
|
|
89205
89358
|
return;
|
|
89206
89359
|
break;
|
|
89207
89360
|
default:
|
|
89208
|
-
ts.Debug.fail("Unexpected path: "
|
|
89361
|
+
ts.Debug.fail("Unexpected path: " + name);
|
|
89209
89362
|
}
|
|
89210
89363
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
89211
89364
|
},
|
|
@@ -89984,6 +90137,8 @@ var ts;
|
|
|
89984
90137
|
return emitAsExpression(node);
|
|
89985
90138
|
case 229:
|
|
89986
90139
|
return emitNonNullExpression(node);
|
|
90140
|
+
case 227:
|
|
90141
|
+
return emitExpressionWithTypeArguments(node);
|
|
89987
90142
|
case 230:
|
|
89988
90143
|
return emitMetaProperty(node);
|
|
89989
90144
|
case 231:
|
|
@@ -90013,7 +90168,7 @@ var ts;
|
|
|
90013
90168
|
return writeTokenNode(node, writeKeyword);
|
|
90014
90169
|
if (ts.isTokenKind(node.kind))
|
|
90015
90170
|
return writeTokenNode(node, writePunctuation);
|
|
90016
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
90171
|
+
ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
90017
90172
|
}
|
|
90018
90173
|
function emitMappedTypeParameter(node) {
|
|
90019
90174
|
emit(node.name);
|
|
@@ -90153,14 +90308,14 @@ var ts;
|
|
|
90153
90308
|
}
|
|
90154
90309
|
}
|
|
90155
90310
|
function emitPlaceholder(hint, node, snippet) {
|
|
90156
|
-
nonEscapingWrite("${"
|
|
90311
|
+
nonEscapingWrite("${" + snippet.order + ":");
|
|
90157
90312
|
pipelineEmitWithHintWorker(hint, node, false);
|
|
90158
90313
|
nonEscapingWrite("}");
|
|
90159
90314
|
}
|
|
90160
90315
|
function emitTabStop(hint, node, snippet) {
|
|
90161
|
-
ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind "
|
|
90316
|
+
ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
90162
90317
|
ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
|
|
90163
|
-
nonEscapingWrite("$"
|
|
90318
|
+
nonEscapingWrite("$" + snippet.order);
|
|
90164
90319
|
}
|
|
90165
90320
|
function emitIdentifier(node) {
|
|
90166
90321
|
var writeText = node.symbol ? writeSymbol : write;
|
|
@@ -90377,6 +90532,7 @@ var ts;
|
|
|
90377
90532
|
writeKeyword("typeof");
|
|
90378
90533
|
writeSpace();
|
|
90379
90534
|
emit(node.exprName);
|
|
90535
|
+
emitTypeArguments(node, node.typeArguments);
|
|
90380
90536
|
}
|
|
90381
90537
|
function emitTypeLiteral(node) {
|
|
90382
90538
|
writePunctuation("{");
|
|
@@ -91823,17 +91979,17 @@ var ts;
|
|
|
91823
91979
|
writeLine();
|
|
91824
91980
|
}
|
|
91825
91981
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
91826
|
-
writeComment("/// <amd-module name=\""
|
|
91982
|
+
writeComment("/// <amd-module name=\"" + currentSourceFile.moduleName + "\" />");
|
|
91827
91983
|
writeLine();
|
|
91828
91984
|
}
|
|
91829
91985
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
91830
91986
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
91831
91987
|
var dep = _b[_a];
|
|
91832
91988
|
if (dep.name) {
|
|
91833
|
-
writeComment("/// <amd-dependency name=\""
|
|
91989
|
+
writeComment("/// <amd-dependency name=\"" + dep.name + "\" path=\"" + dep.path + "\" />");
|
|
91834
91990
|
}
|
|
91835
91991
|
else {
|
|
91836
|
-
writeComment("/// <amd-dependency path=\""
|
|
91992
|
+
writeComment("/// <amd-dependency path=\"" + dep.path + "\" />");
|
|
91837
91993
|
}
|
|
91838
91994
|
writeLine();
|
|
91839
91995
|
}
|
|
@@ -91841,7 +91997,7 @@ var ts;
|
|
|
91841
91997
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
91842
91998
|
var directive = files_2[_c];
|
|
91843
91999
|
var pos = writer.getTextPos();
|
|
91844
|
-
writeComment("/// <reference path=\""
|
|
92000
|
+
writeComment("/// <reference path=\"" + directive.fileName + "\" />");
|
|
91845
92001
|
if (bundleFileInfo)
|
|
91846
92002
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName });
|
|
91847
92003
|
writeLine();
|
|
@@ -91849,15 +92005,18 @@ var ts;
|
|
|
91849
92005
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
91850
92006
|
var directive = types_24[_d];
|
|
91851
92007
|
var pos = writer.getTextPos();
|
|
91852
|
-
|
|
92008
|
+
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
92009
|
+
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
92010
|
+
: "";
|
|
92011
|
+
writeComment("/// <reference types=\"" + directive.fileName + "\" " + resolutionMode + "/>");
|
|
91853
92012
|
if (bundleFileInfo)
|
|
91854
|
-
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type", data: directive.fileName });
|
|
92013
|
+
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" : directive.resolutionMode === ts.ModuleKind.ESNext ? "type-import" : "type-require", data: directive.fileName });
|
|
91855
92014
|
writeLine();
|
|
91856
92015
|
}
|
|
91857
92016
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
91858
92017
|
var directive = libs_1[_e];
|
|
91859
92018
|
var pos = writer.getTextPos();
|
|
91860
|
-
writeComment("/// <reference lib=\""
|
|
92019
|
+
writeComment("/// <reference lib=\"" + directive.fileName + "\" />");
|
|
91861
92020
|
if (bundleFileInfo)
|
|
91862
92021
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib", data: directive.fileName });
|
|
91863
92022
|
writeLine();
|
|
@@ -92556,9 +92715,9 @@ var ts;
|
|
|
92556
92715
|
var textSourceNode = node.textSourceNode;
|
|
92557
92716
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
92558
92717
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
92559
|
-
return jsxAttributeEscape ? "\""
|
|
92560
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216) ? "\""
|
|
92561
|
-
"\""
|
|
92718
|
+
return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
|
|
92719
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216) ? "\"" + ts.escapeString(text) + "\"" :
|
|
92720
|
+
"\"" + ts.escapeNonAsciiString(text) + "\"";
|
|
92562
92721
|
}
|
|
92563
92722
|
else {
|
|
92564
92723
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -92957,8 +93116,8 @@ var ts;
|
|
|
92957
93116
|
}
|
|
92958
93117
|
function formatSynthesizedComment(comment) {
|
|
92959
93118
|
return comment.kind === 3
|
|
92960
|
-
? "/*"
|
|
92961
|
-
: "//"
|
|
93119
|
+
? "/*" + comment.text + "*/"
|
|
93120
|
+
: "//" + comment.text;
|
|
92962
93121
|
}
|
|
92963
93122
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
92964
93123
|
enterComment();
|
|
@@ -93572,18 +93731,18 @@ var ts;
|
|
|
93572
93731
|
var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog, toPath = _a.toPath;
|
|
93573
93732
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
93574
93733
|
if (!newPath) {
|
|
93575
|
-
writeLog("Project: "
|
|
93734
|
+
writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
|
|
93576
93735
|
return true;
|
|
93577
93736
|
}
|
|
93578
93737
|
fileOrDirectoryPath = newPath;
|
|
93579
93738
|
if (fileOrDirectoryPath === watchedDirPath)
|
|
93580
93739
|
return false;
|
|
93581
93740
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
93582
|
-
writeLog("Project: "
|
|
93741
|
+
writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
|
|
93583
93742
|
return true;
|
|
93584
93743
|
}
|
|
93585
93744
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
93586
|
-
writeLog("Project: "
|
|
93745
|
+
writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
|
|
93587
93746
|
return true;
|
|
93588
93747
|
}
|
|
93589
93748
|
if (!program)
|
|
@@ -93602,7 +93761,7 @@ var ts;
|
|
|
93602
93761
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
93603
93762
|
if (hasSourceFile((filePathWithoutExtension + ".ts")) ||
|
|
93604
93763
|
hasSourceFile((filePathWithoutExtension + ".tsx"))) {
|
|
93605
|
-
writeLog("Project: "
|
|
93764
|
+
writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
|
|
93606
93765
|
return true;
|
|
93607
93766
|
}
|
|
93608
93767
|
return false;
|
|
@@ -93670,36 +93829,36 @@ var ts;
|
|
|
93670
93829
|
host.useCaseSensitiveFileNames();
|
|
93671
93830
|
}
|
|
93672
93831
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
93673
|
-
log("ExcludeWatcher:: Added:: "
|
|
93832
|
+
log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
93674
93833
|
return {
|
|
93675
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
93834
|
+
close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
|
|
93676
93835
|
};
|
|
93677
93836
|
}
|
|
93678
93837
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
93679
|
-
log("FileWatcher:: Added:: "
|
|
93838
|
+
log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
93680
93839
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
93681
93840
|
return {
|
|
93682
93841
|
close: function () {
|
|
93683
|
-
log("FileWatcher:: Close:: "
|
|
93842
|
+
log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
93684
93843
|
watcher.close();
|
|
93685
93844
|
}
|
|
93686
93845
|
};
|
|
93687
93846
|
}
|
|
93688
93847
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
93689
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
93848
|
+
var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
93690
93849
|
log(watchInfo);
|
|
93691
93850
|
var start = ts.timestamp();
|
|
93692
93851
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
93693
93852
|
var elapsed = ts.timestamp() - start;
|
|
93694
|
-
log("Elapsed:: "
|
|
93853
|
+
log("Elapsed:: " + elapsed + "ms " + watchInfo);
|
|
93695
93854
|
return {
|
|
93696
93855
|
close: function () {
|
|
93697
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
93856
|
+
var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
93698
93857
|
log(watchInfo);
|
|
93699
93858
|
var start = ts.timestamp();
|
|
93700
93859
|
watcher.close();
|
|
93701
93860
|
var elapsed = ts.timestamp() - start;
|
|
93702
|
-
log("Elapsed:: "
|
|
93861
|
+
log("Elapsed:: " + elapsed + "ms " + watchInfo);
|
|
93703
93862
|
}
|
|
93704
93863
|
};
|
|
93705
93864
|
}
|
|
@@ -93709,16 +93868,16 @@ var ts;
|
|
|
93709
93868
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
93710
93869
|
args[_i] = arguments[_i];
|
|
93711
93870
|
}
|
|
93712
|
-
var triggerredInfo =
|
|
93871
|
+
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
93713
93872
|
log(triggerredInfo);
|
|
93714
93873
|
var start = ts.timestamp();
|
|
93715
93874
|
cb.call.apply(cb, __spreadArray([undefined], args, false));
|
|
93716
93875
|
var elapsed = ts.timestamp() - start;
|
|
93717
|
-
log("Elapsed:: "
|
|
93876
|
+
log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
|
|
93718
93877
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
93719
93878
|
}
|
|
93720
93879
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
93721
|
-
return "WatchInfo: "
|
|
93880
|
+
return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
|
|
93722
93881
|
}
|
|
93723
93882
|
}
|
|
93724
93883
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -94008,12 +94167,12 @@ var ts;
|
|
|
94008
94167
|
}
|
|
94009
94168
|
ts.formatDiagnostics = formatDiagnostics;
|
|
94010
94169
|
function formatDiagnostic(diagnostic, host) {
|
|
94011
|
-
var errorMessage =
|
|
94170
|
+
var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
|
|
94012
94171
|
if (diagnostic.file) {
|
|
94013
94172
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character;
|
|
94014
94173
|
var fileName = diagnostic.file.fileName;
|
|
94015
94174
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
94016
|
-
return
|
|
94175
|
+
return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
|
|
94017
94176
|
}
|
|
94018
94177
|
return errorMessage;
|
|
94019
94178
|
}
|
|
@@ -94091,9 +94250,9 @@ var ts;
|
|
|
94091
94250
|
var output = "";
|
|
94092
94251
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
94093
94252
|
output += ":";
|
|
94094
|
-
output += color(""
|
|
94253
|
+
output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
94095
94254
|
output += ":";
|
|
94096
|
-
output += color(""
|
|
94255
|
+
output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
94097
94256
|
return output;
|
|
94098
94257
|
}
|
|
94099
94258
|
ts.formatLocation = formatLocation;
|
|
@@ -94107,7 +94266,7 @@ var ts;
|
|
|
94107
94266
|
output += " - ";
|
|
94108
94267
|
}
|
|
94109
94268
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
94110
|
-
output += formatColorAndReset(" TS"
|
|
94269
|
+
output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
|
|
94111
94270
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
94112
94271
|
if (diagnostic.file) {
|
|
94113
94272
|
output += host.getNewLine();
|
|
@@ -94157,7 +94316,7 @@ var ts;
|
|
|
94157
94316
|
return result;
|
|
94158
94317
|
}
|
|
94159
94318
|
ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText;
|
|
94160
|
-
function
|
|
94319
|
+
function loadWithTypeDirectiveCache(names, containingFile, redirectedReference, containingFileMode, loader) {
|
|
94161
94320
|
if (names.length === 0) {
|
|
94162
94321
|
return [];
|
|
94163
94322
|
}
|
|
@@ -94166,18 +94325,25 @@ var ts;
|
|
|
94166
94325
|
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
|
|
94167
94326
|
var name = names_2[_i];
|
|
94168
94327
|
var result = void 0;
|
|
94169
|
-
|
|
94170
|
-
|
|
94328
|
+
var mode = getModeForFileReference(name, containingFileMode);
|
|
94329
|
+
var strName = ts.isString(name) ? name : name.fileName.toLowerCase();
|
|
94330
|
+
var cacheKey = mode !== undefined ? mode + "|" + strName : strName;
|
|
94331
|
+
if (cache.has(cacheKey)) {
|
|
94332
|
+
result = cache.get(cacheKey);
|
|
94171
94333
|
}
|
|
94172
94334
|
else {
|
|
94173
|
-
cache.set(
|
|
94335
|
+
cache.set(cacheKey, result = loader(strName, containingFile, redirectedReference, mode));
|
|
94174
94336
|
}
|
|
94175
94337
|
resolutions.push(result);
|
|
94176
94338
|
}
|
|
94177
94339
|
return resolutions;
|
|
94178
94340
|
}
|
|
94179
|
-
ts.
|
|
94341
|
+
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
94180
94342
|
;
|
|
94343
|
+
function getModeForFileReference(ref, containingFileMode) {
|
|
94344
|
+
return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
94345
|
+
}
|
|
94346
|
+
ts.getModeForFileReference = getModeForFileReference;
|
|
94181
94347
|
function getModeForResolutionAtIndex(file, index) {
|
|
94182
94348
|
if (file.impliedNodeFormat === undefined)
|
|
94183
94349
|
return undefined;
|
|
@@ -94207,7 +94373,7 @@ var ts;
|
|
|
94207
94373
|
var result = void 0;
|
|
94208
94374
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
94209
94375
|
i++;
|
|
94210
|
-
var cacheKey = mode !== undefined ?
|
|
94376
|
+
var cacheKey = mode !== undefined ? mode + "|" + name : name;
|
|
94211
94377
|
if (cache.has(cacheKey)) {
|
|
94212
94378
|
result = cache.get(cacheKey);
|
|
94213
94379
|
}
|
|
@@ -94266,7 +94432,7 @@ var ts;
|
|
|
94266
94432
|
var _d, _e, _f, _g;
|
|
94267
94433
|
var file = ts.Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
94268
94434
|
var kind = ref.kind, index = ref.index;
|
|
94269
|
-
var pos, end, packageId;
|
|
94435
|
+
var pos, end, packageId, resolutionMode;
|
|
94270
94436
|
switch (kind) {
|
|
94271
94437
|
case ts.FileIncludeKind.Import:
|
|
94272
94438
|
var importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
@@ -94280,8 +94446,8 @@ var ts;
|
|
|
94280
94446
|
(_a = file.referencedFiles[index], pos = _a.pos, end = _a.end);
|
|
94281
94447
|
break;
|
|
94282
94448
|
case ts.FileIncludeKind.TypeReferenceDirective:
|
|
94283
|
-
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
|
|
94284
|
-
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
94449
|
+
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end, resolutionMode = _b.resolutionMode);
|
|
94450
|
+
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
94285
94451
|
break;
|
|
94286
94452
|
case ts.FileIncludeKind.LibReferenceDirective:
|
|
94287
94453
|
(_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
|
|
@@ -94487,7 +94653,7 @@ var ts;
|
|
|
94487
94653
|
var fileReasons = ts.createMultiMap();
|
|
94488
94654
|
var cachedBindAndCheckDiagnosticsForFile = {};
|
|
94489
94655
|
var cachedDeclarationDiagnosticsForFile = {};
|
|
94490
|
-
var resolvedTypeReferenceDirectives =
|
|
94656
|
+
var resolvedTypeReferenceDirectives = ts.createModeAwareCache();
|
|
94491
94657
|
var fileProcessingDiagnostics;
|
|
94492
94658
|
var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
94493
94659
|
var currentNodeModulesDepth = 0;
|
|
@@ -94528,12 +94694,12 @@ var ts;
|
|
|
94528
94694
|
}
|
|
94529
94695
|
var actualResolveTypeReferenceDirectiveNamesWorker;
|
|
94530
94696
|
if (host.resolveTypeReferenceDirectives) {
|
|
94531
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options); };
|
|
94697
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference, containingFileMode) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options, containingFileMode); };
|
|
94532
94698
|
}
|
|
94533
94699
|
else {
|
|
94534
94700
|
typeReferenceDirectiveResolutionCache = ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
94535
|
-
var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
94536
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return
|
|
94701
|
+
var loader_2 = function (typesRef, containingFile, redirectedReference, resolutionMode) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode).resolvedTypeReferenceDirective; };
|
|
94702
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference, containingFileMode) { return loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_2); };
|
|
94537
94703
|
}
|
|
94538
94704
|
var packageIdToSourceFile = new ts.Map();
|
|
94539
94705
|
var sourceFileToPackageName = new ts.Map();
|
|
@@ -94612,7 +94778,7 @@ var ts;
|
|
|
94612
94778
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
94613
94779
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
94614
94780
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
94615
|
-
processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
94781
|
+
processTypeReferenceDirective(typeReferences[i], undefined, resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
94616
94782
|
}
|
|
94617
94783
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
94618
94784
|
}
|
|
@@ -94760,9 +94926,10 @@ var ts;
|
|
|
94760
94926
|
return [];
|
|
94761
94927
|
var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
|
|
94762
94928
|
var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;
|
|
94929
|
+
var containingFileMode = !ts.isString(containingFile) ? containingFile.impliedNodeFormat : undefined;
|
|
94763
94930
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName });
|
|
94764
94931
|
ts.performance.mark("beforeResolveTypeReference");
|
|
94765
|
-
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);
|
|
94932
|
+
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, containingFileMode);
|
|
94766
94933
|
ts.performance.mark("afterResolveTypeReference");
|
|
94767
94934
|
ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
|
|
94768
94935
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -94839,15 +95006,15 @@ var ts;
|
|
|
94839
95006
|
}
|
|
94840
95007
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
94841
95008
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
94842
|
-
var
|
|
95009
|
+
var result_14 = [];
|
|
94843
95010
|
var i = 0;
|
|
94844
95011
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
94845
95012
|
var moduleName = moduleNames_1[_i];
|
|
94846
95013
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
94847
95014
|
i++;
|
|
94848
|
-
|
|
95015
|
+
result_14.push(resolvedModule);
|
|
94849
95016
|
}
|
|
94850
|
-
return
|
|
95017
|
+
return result_14;
|
|
94851
95018
|
}
|
|
94852
95019
|
var unknownModuleNames;
|
|
94853
95020
|
var result;
|
|
@@ -95064,7 +95231,7 @@ var ts;
|
|
|
95064
95231
|
else {
|
|
95065
95232
|
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
95066
95233
|
}
|
|
95067
|
-
var typesReferenceDirectives =
|
|
95234
|
+
var typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
95068
95235
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
95069
95236
|
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
95070
95237
|
if (typeReferenceResolutionsChanged) {
|
|
@@ -96015,7 +96182,7 @@ var ts;
|
|
|
96015
96182
|
});
|
|
96016
96183
|
}
|
|
96017
96184
|
function processTypeReferenceDirectives(file) {
|
|
96018
|
-
var typeDirectives =
|
|
96185
|
+
var typeDirectives = file.typeReferenceDirectives;
|
|
96019
96186
|
if (!typeDirectives) {
|
|
96020
96187
|
return;
|
|
96021
96188
|
}
|
|
@@ -96025,16 +96192,20 @@ var ts;
|
|
|
96025
96192
|
var resolvedTypeReferenceDirective = resolutions[index];
|
|
96026
96193
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
96027
96194
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
96028
|
-
|
|
96195
|
+
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
96196
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
96197
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext));
|
|
96198
|
+
}
|
|
96199
|
+
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
96029
96200
|
}
|
|
96030
96201
|
}
|
|
96031
|
-
function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96202
|
+
function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96032
96203
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
|
|
96033
|
-
processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason);
|
|
96204
|
+
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason);
|
|
96034
96205
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96035
96206
|
}
|
|
96036
|
-
function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96037
|
-
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);
|
|
96207
|
+
function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96208
|
+
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode);
|
|
96038
96209
|
if (previousResolution && previousResolution.primary) {
|
|
96039
96210
|
return;
|
|
96040
96211
|
}
|
|
@@ -96067,7 +96238,7 @@ var ts;
|
|
|
96067
96238
|
addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_find_type_definition_file_for_0, [typeReferenceDirective]);
|
|
96068
96239
|
}
|
|
96069
96240
|
if (saveResolution) {
|
|
96070
|
-
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
96241
|
+
resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolvedTypeReferenceDirective);
|
|
96071
96242
|
}
|
|
96072
96243
|
}
|
|
96073
96244
|
function pathForLibFile(libFileName) {
|
|
@@ -96078,7 +96249,7 @@ var ts;
|
|
|
96078
96249
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
96079
96250
|
i++;
|
|
96080
96251
|
}
|
|
96081
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
96252
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
96082
96253
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
96083
96254
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
96084
96255
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -96847,10 +97018,10 @@ var ts;
|
|
|
96847
97018
|
}
|
|
96848
97019
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
96849
97020
|
var dirPath = host.toPath(dir);
|
|
96850
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
97021
|
+
var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
|
|
96851
97022
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
96852
97023
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
96853
|
-
ts.startsWith(dirPath,
|
|
97024
|
+
ts.startsWith(dirPath, declDirPath + "/"); });
|
|
96854
97025
|
}
|
|
96855
97026
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
96856
97027
|
var _a;
|
|
@@ -96898,7 +97069,7 @@ var ts;
|
|
|
96898
97069
|
var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath));
|
|
96899
97070
|
if (isFile && result) {
|
|
96900
97071
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
96901
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
97072
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
|
|
96902
97073
|
}
|
|
96903
97074
|
return result;
|
|
96904
97075
|
}) || false;
|
|
@@ -97282,7 +97453,7 @@ var ts;
|
|
|
97282
97453
|
var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken, undefined, true);
|
|
97283
97454
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
97284
97455
|
if (firstDts_1) {
|
|
97285
|
-
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts", ".d.mts", ".d.cts"]), "File extension for signature expected to be dts", function () { return "Found: "
|
|
97456
|
+
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts", ".d.mts", ".d.cts"]), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
|
|
97286
97457
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
97287
97458
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
97288
97459
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -97678,7 +97849,7 @@ var ts;
|
|
|
97678
97849
|
return;
|
|
97679
97850
|
}
|
|
97680
97851
|
else {
|
|
97681
|
-
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: "
|
|
97852
|
+
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
|
|
97682
97853
|
}
|
|
97683
97854
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
97684
97855
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -98476,9 +98647,9 @@ var ts;
|
|
|
98476
98647
|
});
|
|
98477
98648
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
98478
98649
|
}
|
|
98479
|
-
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) {
|
|
98650
|
+
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference, _containingSourceFile, mode) {
|
|
98480
98651
|
var _a;
|
|
98481
|
-
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference);
|
|
98652
|
+
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
98482
98653
|
if (!resolutionHost.getGlobalCache) {
|
|
98483
98654
|
return primaryResult;
|
|
98484
98655
|
}
|
|
@@ -98493,12 +98664,12 @@ var ts;
|
|
|
98493
98664
|
}
|
|
98494
98665
|
return primaryResult;
|
|
98495
98666
|
}
|
|
98496
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
|
|
98497
|
-
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache);
|
|
98667
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, _containingSourceFile, resolutionMode) {
|
|
98668
|
+
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode);
|
|
98498
98669
|
}
|
|
98499
98670
|
function resolveNamesWithLocalCache(_a) {
|
|
98500
98671
|
var _b, _c, _d;
|
|
98501
|
-
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile;
|
|
98672
|
+
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile, containingSourceFileMode = _a.containingSourceFileMode;
|
|
98502
98673
|
var path = resolutionHost.toPath(containingFile);
|
|
98503
98674
|
var resolutionsInFile = cache.get(path) || cache.set(path, ts.createModeAwareCache()).get(path);
|
|
98504
98675
|
var dirPath = ts.getDirectoryPath(path);
|
|
@@ -98519,8 +98690,10 @@ var ts;
|
|
|
98519
98690
|
var seenNamesInFile = ts.createModeAwareCache();
|
|
98520
98691
|
var i = 0;
|
|
98521
98692
|
for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
|
|
98522
|
-
var
|
|
98523
|
-
var
|
|
98693
|
+
var entry = names_4[_i];
|
|
98694
|
+
var name = ts.isString(entry) ? entry : entry.fileName.toLowerCase();
|
|
98695
|
+
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, containingSourceFileMode) :
|
|
98696
|
+
containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
|
|
98524
98697
|
i++;
|
|
98525
98698
|
var resolution = resolutionsInFile.get(name, mode);
|
|
98526
98699
|
if (!seenNamesInFile.has(name, mode) &&
|
|
@@ -98547,7 +98720,7 @@ var ts;
|
|
|
98547
98720
|
}
|
|
98548
98721
|
}
|
|
98549
98722
|
else {
|
|
98550
|
-
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
98723
|
+
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
98551
98724
|
perDirectoryResolution.set(name, mode, resolution);
|
|
98552
98725
|
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
98553
98726
|
resolutionHost.onDiscoveredSymlink();
|
|
@@ -98609,7 +98782,7 @@ var ts;
|
|
|
98609
98782
|
return oldResult.resolvedFileName === newResult.resolvedFileName;
|
|
98610
98783
|
}
|
|
98611
98784
|
}
|
|
98612
|
-
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) {
|
|
98785
|
+
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode) {
|
|
98613
98786
|
return resolveNamesWithLocalCache({
|
|
98614
98787
|
names: typeDirectiveNames,
|
|
98615
98788
|
containingFile: containingFile,
|
|
@@ -98619,6 +98792,7 @@ var ts;
|
|
|
98619
98792
|
loader: resolveTypeReferenceDirective,
|
|
98620
98793
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
98621
98794
|
shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
|
|
98795
|
+
containingSourceFileMode: containingFileMode
|
|
98622
98796
|
});
|
|
98623
98797
|
}
|
|
98624
98798
|
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) {
|
|
@@ -98650,7 +98824,7 @@ var ts;
|
|
|
98650
98824
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
98651
98825
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
98652
98826
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
98653
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
98827
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
|
|
98654
98828
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
98655
98829
|
return {
|
|
98656
98830
|
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(ts.directorySeparator),
|
|
@@ -99210,9 +99384,9 @@ var ts;
|
|
|
99210
99384
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
99211
99385
|
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
99212
99386
|
if (!preferSymlinks) {
|
|
99213
|
-
var
|
|
99214
|
-
if (
|
|
99215
|
-
return
|
|
99387
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
99388
|
+
if (result_15)
|
|
99389
|
+
return result_15;
|
|
99216
99390
|
}
|
|
99217
99391
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
99218
99392
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -99231,10 +99405,10 @@ var ts;
|
|
|
99231
99405
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
99232
99406
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
99233
99407
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
99234
|
-
var
|
|
99408
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
99235
99409
|
shouldFilterIgnoredPaths = true;
|
|
99236
|
-
if (
|
|
99237
|
-
return
|
|
99410
|
+
if (result_16)
|
|
99411
|
+
return result_16;
|
|
99238
99412
|
}
|
|
99239
99413
|
});
|
|
99240
99414
|
});
|
|
@@ -99572,7 +99746,7 @@ var ts;
|
|
|
99572
99746
|
}
|
|
99573
99747
|
function getJSExtensionForFile(fileName, options) {
|
|
99574
99748
|
var _a;
|
|
99575
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
99749
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
|
|
99576
99750
|
}
|
|
99577
99751
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
99578
99752
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -99662,8 +99836,8 @@ var ts;
|
|
|
99662
99836
|
return pretty ?
|
|
99663
99837
|
function (diagnostic, newLine, options) {
|
|
99664
99838
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
99665
|
-
var output = "["
|
|
99666
|
-
output += ""
|
|
99839
|
+
var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
|
|
99840
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
|
|
99667
99841
|
system.write(output);
|
|
99668
99842
|
} :
|
|
99669
99843
|
function (diagnostic, newLine, options) {
|
|
@@ -99671,8 +99845,8 @@ var ts;
|
|
|
99671
99845
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
99672
99846
|
output += newLine;
|
|
99673
99847
|
}
|
|
99674
|
-
output +=
|
|
99675
|
-
output += ""
|
|
99848
|
+
output += getLocaleTimeString(system) + " - ";
|
|
99849
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
|
|
99676
99850
|
system.write(output);
|
|
99677
99851
|
};
|
|
99678
99852
|
}
|
|
@@ -99694,7 +99868,7 @@ var ts;
|
|
|
99694
99868
|
.map(function (errorDiagnostic) {
|
|
99695
99869
|
if (errorDiagnostic.file === undefined)
|
|
99696
99870
|
return;
|
|
99697
|
-
return ""
|
|
99871
|
+
return "" + errorDiagnostic.file.fileName;
|
|
99698
99872
|
});
|
|
99699
99873
|
return filesInError.map(function (fileName) {
|
|
99700
99874
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
@@ -99727,7 +99901,7 @@ var ts;
|
|
|
99727
99901
|
if (errorCount === 0)
|
|
99728
99902
|
return "";
|
|
99729
99903
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99730
|
-
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return
|
|
99904
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99731
99905
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99732
99906
|
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
99733
99907
|
var d = errorCount === 1 ?
|
|
@@ -99740,7 +99914,7 @@ var ts;
|
|
|
99740
99914
|
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
99741
99915
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
99742
99916
|
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
99743
|
-
return ""
|
|
99917
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
99744
99918
|
}
|
|
99745
99919
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99746
99920
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -99763,7 +99937,7 @@ var ts;
|
|
|
99763
99937
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99764
99938
|
: "";
|
|
99765
99939
|
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
99766
|
-
tabularData += ""
|
|
99940
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
99767
99941
|
});
|
|
99768
99942
|
return tabularData;
|
|
99769
99943
|
}
|
|
@@ -99790,9 +99964,9 @@ var ts;
|
|
|
99790
99964
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
99791
99965
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
99792
99966
|
var file = _c[_i];
|
|
99793
|
-
write(""
|
|
99794
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
99795
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
99967
|
+
write("" + toFileName(file, relativeFileName));
|
|
99968
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
|
|
99969
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
|
|
99796
99970
|
}
|
|
99797
99971
|
}
|
|
99798
99972
|
ts.explainFiles = explainFiles;
|
|
@@ -99830,7 +100004,7 @@ var ts;
|
|
|
99830
100004
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json"))
|
|
99831
100005
|
return false;
|
|
99832
100006
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
99833
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
100007
|
+
return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
|
|
99834
100008
|
});
|
|
99835
100009
|
}
|
|
99836
100010
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -99839,7 +100013,7 @@ var ts;
|
|
|
99839
100013
|
var options = program.getCompilerOptions();
|
|
99840
100014
|
if (ts.isReferencedFile(reason)) {
|
|
99841
100015
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
99842
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
100016
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
|
|
99843
100017
|
var message = void 0;
|
|
99844
100018
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
99845
100019
|
switch (reason.kind) {
|
|
@@ -99950,7 +100124,7 @@ var ts;
|
|
|
99950
100124
|
var currentDir_1 = program.getCurrentDirectory();
|
|
99951
100125
|
ts.forEach(emittedFiles, function (file) {
|
|
99952
100126
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
99953
|
-
write("TSFILE: "
|
|
100127
|
+
write("TSFILE: " + filepath);
|
|
99954
100128
|
});
|
|
99955
100129
|
listFiles(program, write);
|
|
99956
100130
|
}
|
|
@@ -100257,7 +100431,7 @@ var ts;
|
|
|
100257
100431
|
}
|
|
100258
100432
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
100259
100433
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
100260
|
-
writeLog("Current directory: "
|
|
100434
|
+
writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
|
|
100261
100435
|
var configFileWatcher;
|
|
100262
100436
|
if (configFileName) {
|
|
100263
100437
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -100310,7 +100484,7 @@ var ts;
|
|
|
100310
100484
|
}
|
|
100311
100485
|
return host.resolveTypeReferenceDirectives.apply(host, args);
|
|
100312
100486
|
}) :
|
|
100313
|
-
(function (typeDirectiveNames, containingFile, redirectedReference) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); });
|
|
100487
|
+
(function (typeDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode); });
|
|
100314
100488
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
100315
100489
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
100316
100490
|
synchronizeProgram();
|
|
@@ -100404,10 +100578,10 @@ var ts;
|
|
|
100404
100578
|
}
|
|
100405
100579
|
function createNewProgram(hasInvalidatedResolution) {
|
|
100406
100580
|
writeLog("CreatingProgramWith::");
|
|
100407
|
-
writeLog(" roots: "
|
|
100408
|
-
writeLog(" options: "
|
|
100581
|
+
writeLog(" roots: " + JSON.stringify(rootFileNames));
|
|
100582
|
+
writeLog(" options: " + JSON.stringify(compilerOptions));
|
|
100409
100583
|
if (projectReferences)
|
|
100410
|
-
writeLog(" projectReferences: "
|
|
100584
|
+
writeLog(" projectReferences: " + JSON.stringify(projectReferences));
|
|
100411
100585
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
100412
100586
|
hasChangedCompilerOptions = false;
|
|
100413
100587
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -100549,7 +100723,7 @@ var ts;
|
|
|
100549
100723
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
100550
100724
|
}
|
|
100551
100725
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
100552
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
100726
|
+
writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
|
|
100553
100727
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
100554
100728
|
}
|
|
100555
100729
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -100605,7 +100779,7 @@ var ts;
|
|
|
100605
100779
|
synchronizeProgram();
|
|
100606
100780
|
}
|
|
100607
100781
|
function reloadConfigFile() {
|
|
100608
|
-
writeLog("Reloading config file: "
|
|
100782
|
+
writeLog("Reloading config file: " + configFileName);
|
|
100609
100783
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
100610
100784
|
if (cachedDirectoryStructureHost) {
|
|
100611
100785
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -100643,7 +100817,7 @@ var ts;
|
|
|
100643
100817
|
return config.parsedCommandLine;
|
|
100644
100818
|
}
|
|
100645
100819
|
}
|
|
100646
|
-
writeLog("Loading config file: "
|
|
100820
|
+
writeLog("Loading config file: " + configFileName);
|
|
100647
100821
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
100648
100822
|
host.getParsedCommandLine(configFileName) :
|
|
100649
100823
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -100896,8 +101070,8 @@ var ts;
|
|
|
100896
101070
|
ts.getBuildOrderFromAnyBuildOrder = getBuildOrderFromAnyBuildOrder;
|
|
100897
101071
|
function createBuilderStatusReporter(system, pretty) {
|
|
100898
101072
|
return function (diagnostic) {
|
|
100899
|
-
var output = pretty ? "["
|
|
100900
|
-
output += ""
|
|
101073
|
+
var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
|
|
101074
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
|
|
100901
101075
|
system.write(output);
|
|
100902
101076
|
};
|
|
100903
101077
|
}
|
|
@@ -100964,9 +101138,9 @@ var ts;
|
|
|
100964
101138
|
compilerHost.getModuleResolutionCache = function () { return moduleResolutionCache; };
|
|
100965
101139
|
}
|
|
100966
101140
|
if (!compilerHost.resolveTypeReferenceDirectives) {
|
|
100967
|
-
var loader_4 = function (moduleName, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
100968
|
-
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference) {
|
|
100969
|
-
return ts.
|
|
101141
|
+
var loader_4 = function (moduleName, containingFile, redirectedReference, containingFileMode) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache, containingFileMode).resolvedTypeReferenceDirective; };
|
|
101142
|
+
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) {
|
|
101143
|
+
return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
|
|
100970
101144
|
};
|
|
100971
101145
|
}
|
|
100972
101146
|
var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
|
|
@@ -101640,7 +101814,7 @@ var ts;
|
|
|
101640
101814
|
function listEmittedFile(_a, proj, file) {
|
|
101641
101815
|
var write = _a.write;
|
|
101642
101816
|
if (write && proj.options.listEmittedFiles) {
|
|
101643
|
-
write("TSFILE: "
|
|
101817
|
+
write("TSFILE: " + file);
|
|
101644
101818
|
}
|
|
101645
101819
|
}
|
|
101646
101820
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -101669,7 +101843,7 @@ var ts;
|
|
|
101669
101843
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
101670
101844
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
101671
101845
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
101672
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason:
|
|
101846
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
|
|
101673
101847
|
if (canEmitBuildInfo)
|
|
101674
101848
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
101675
101849
|
afterProgramDone(state, program, config);
|
|
@@ -101695,7 +101869,7 @@ var ts;
|
|
|
101695
101869
|
if (!host.fileExists(inputFile)) {
|
|
101696
101870
|
return {
|
|
101697
101871
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
101698
|
-
reason:
|
|
101872
|
+
reason: inputFile + " does not exist"
|
|
101699
101873
|
};
|
|
101700
101874
|
}
|
|
101701
101875
|
if (!force) {
|
|
@@ -102020,7 +102194,7 @@ var ts;
|
|
|
102020
102194
|
}
|
|
102021
102195
|
}
|
|
102022
102196
|
if (filesToDelete) {
|
|
102023
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
102197
|
+
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
|
|
102024
102198
|
}
|
|
102025
102199
|
return ts.ExitStatus.Success;
|
|
102026
102200
|
}
|
|
@@ -102370,7 +102544,7 @@ var ts;
|
|
|
102370
102544
|
};
|
|
102371
102545
|
}
|
|
102372
102546
|
function bold(str) {
|
|
102373
|
-
return "\u001B[1m"
|
|
102547
|
+
return "\u001B[1m" + str + "\u001B[22m";
|
|
102374
102548
|
}
|
|
102375
102549
|
var isWindows = sys.getEnvironmentVariable("OS") && ts.stringContains(sys.getEnvironmentVariable("OS").toLowerCase(), "windows");
|
|
102376
102550
|
var isWindowsTerminal = sys.getEnvironmentVariable("WT_SESSION");
|
|
@@ -102379,19 +102553,19 @@ var ts;
|
|
|
102379
102553
|
if (isWindows && !isWindowsTerminal && !isVSCode) {
|
|
102380
102554
|
return brightWhite(str);
|
|
102381
102555
|
}
|
|
102382
|
-
return "\u001B[94m"
|
|
102556
|
+
return "\u001B[94m" + str + "\u001B[39m";
|
|
102383
102557
|
}
|
|
102384
102558
|
var supportsRicherColors = sys.getEnvironmentVariable("COLORTERM") === "truecolor" || sys.getEnvironmentVariable("TERM") === "xterm-256color";
|
|
102385
102559
|
function blueBackground(str) {
|
|
102386
102560
|
if (supportsRicherColors) {
|
|
102387
|
-
return "\u001B[48;5;68m"
|
|
102561
|
+
return "\u001B[48;5;68m" + str + "\u001B[39;49m";
|
|
102388
102562
|
}
|
|
102389
102563
|
else {
|
|
102390
|
-
return "\u001B[44m"
|
|
102564
|
+
return "\u001B[44m" + str + "\u001B[39;49m";
|
|
102391
102565
|
}
|
|
102392
102566
|
}
|
|
102393
102567
|
function brightWhite(str) {
|
|
102394
|
-
return "\u001B[97m"
|
|
102568
|
+
return "\u001B[97m" + str + "\u001B[39m";
|
|
102395
102569
|
}
|
|
102396
102570
|
return {
|
|
102397
102571
|
bold: bold,
|
|
@@ -102401,7 +102575,7 @@ var ts;
|
|
|
102401
102575
|
};
|
|
102402
102576
|
}
|
|
102403
102577
|
function getDisplayNameTextOfOption(option) {
|
|
102404
|
-
return "--"
|
|
102578
|
+
return "--" + option.name + (option.shortName ? ", -" + option.shortName : "");
|
|
102405
102579
|
}
|
|
102406
102580
|
function generateOptionOutput(sys, option, rightAlignOfLeft, leftAlignOfRight) {
|
|
102407
102581
|
var _a, _b;
|
|
@@ -102438,13 +102612,13 @@ var ts;
|
|
|
102438
102612
|
text.push(sys.newLine);
|
|
102439
102613
|
if (showAdditionalInfoOutput(valueCandidates, option)) {
|
|
102440
102614
|
if (valueCandidates) {
|
|
102441
|
-
text.push(
|
|
102615
|
+
text.push(valueCandidates.valueType + " " + valueCandidates.possibleValues);
|
|
102442
102616
|
}
|
|
102443
102617
|
if (defaultValueDescription) {
|
|
102444
102618
|
if (valueCandidates)
|
|
102445
102619
|
text.push(sys.newLine);
|
|
102446
102620
|
var diagType = ts.getDiagnosticText(ts.Diagnostics.default_Colon);
|
|
102447
|
-
text.push(
|
|
102621
|
+
text.push(diagType + " " + defaultValueDescription);
|
|
102448
102622
|
}
|
|
102449
102623
|
text.push(sys.newLine);
|
|
102450
102624
|
}
|
|
@@ -102493,7 +102667,7 @@ var ts;
|
|
|
102493
102667
|
}
|
|
102494
102668
|
var curRight = remainRight.substr(0, rightCharacterNumber);
|
|
102495
102669
|
remainRight = remainRight.slice(rightCharacterNumber);
|
|
102496
|
-
res.push(""
|
|
102670
|
+
res.push("" + curLeft + curRight);
|
|
102497
102671
|
isFirstLine = false;
|
|
102498
102672
|
}
|
|
102499
102673
|
return res;
|
|
@@ -102594,7 +102768,7 @@ var ts;
|
|
|
102594
102768
|
categoryMap.set(curCategory, optionsOfCurCategory);
|
|
102595
102769
|
}
|
|
102596
102770
|
categoryMap.forEach(function (value, key) {
|
|
102597
|
-
res.push("### "
|
|
102771
|
+
res.push("### " + key + sys.newLine + sys.newLine);
|
|
102598
102772
|
res = __spreadArray(__spreadArray([], res, true), generateGroupOptionOutput(sys, value), true);
|
|
102599
102773
|
});
|
|
102600
102774
|
if (afterOptionsDescription) {
|
|
@@ -102604,7 +102778,7 @@ var ts;
|
|
|
102604
102778
|
}
|
|
102605
102779
|
function printEasyHelp(sys, simpleOptions) {
|
|
102606
102780
|
var colors = createColors(sys);
|
|
102607
|
-
var output = __spreadArray([], getHeader(sys,
|
|
102781
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
102608
102782
|
output.push(colors.bold(ts.getDiagnosticText(ts.Diagnostics.COMMON_COMMANDS)) + sys.newLine + sys.newLine);
|
|
102609
102783
|
example("tsc", ts.Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
|
102610
102784
|
example("tsc app.ts util.ts", ts.Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
|
@@ -102630,7 +102804,7 @@ var ts;
|
|
|
102630
102804
|
}
|
|
102631
102805
|
}
|
|
102632
102806
|
function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
|
|
102633
|
-
var output = __spreadArray([], getHeader(sys,
|
|
102807
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
102634
102808
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, true, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")), true);
|
|
102635
102809
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.WATCH_OPTIONS), watchOptions, false, ts.getDiagnosticText(ts.Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon)), true);
|
|
102636
102810
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
|
|
@@ -102640,7 +102814,7 @@ var ts;
|
|
|
102640
102814
|
}
|
|
102641
102815
|
}
|
|
102642
102816
|
function printBuildHelp(sys, buildOptions) {
|
|
102643
|
-
var output = __spreadArray([], getHeader(sys,
|
|
102817
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
102644
102818
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
|
|
102645
102819
|
for (var _i = 0, output_3 = output; _i < output_3.length; _i++) {
|
|
102646
102820
|
var line = output_3[_i];
|
|
@@ -103021,7 +103195,7 @@ var ts;
|
|
|
103021
103195
|
reportCountStatistic("Subtype cache size", caches.subtype);
|
|
103022
103196
|
reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
|
|
103023
103197
|
if (isPerformanceEnabled) {
|
|
103024
|
-
ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(
|
|
103198
|
+
ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(name + " time", duration); });
|
|
103025
103199
|
}
|
|
103026
103200
|
}
|
|
103027
103201
|
else if (isPerformanceEnabled) {
|
|
@@ -103092,7 +103266,7 @@ var ts;
|
|
|
103092
103266
|
// This file actually uses arguments passed on commandline and executes it
|
|
103093
103267
|
ts.Debug.loggingHost = {
|
|
103094
103268
|
log: function (_level, s) {
|
|
103095
|
-
ts.sys.write(""
|
|
103269
|
+
ts.sys.write("" + (s || "") + ts.sys.newLine);
|
|
103096
103270
|
}
|
|
103097
103271
|
};
|
|
103098
103272
|
if (ts.Debug.isDebugging) {
|