typescript 4.6.0-dev.20220211 → 4.6.2
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/tsc.js +513 -499
- package/lib/tsserver.js +865 -861
- package/lib/tsserverlibrary.js +840 -836
- package/lib/typescript.js +745 -741
- package/lib/typescriptServices.js +745 -741
- package/lib/typingsInstaller.js +631 -627
- package/package.json +2 -2
package/lib/typingsInstaller.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 || from);
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
26
|
};
|
|
27
27
|
var __assign = (this && this.__assign) || function () {
|
|
28
28
|
__assign = Object.assign || function(t) {
|
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version =
|
|
92
|
+
ts.version = "4.6.2";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -136,7 +136,7 @@ var ts;
|
|
|
136
136
|
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
|
|
137
137
|
if (constructor)
|
|
138
138
|
return constructor;
|
|
139
|
-
throw new Error("TypeScript requires an environment that provides a compatible native "
|
|
139
|
+
throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
|
|
140
140
|
}
|
|
141
141
|
})(ts || (ts = {}));
|
|
142
142
|
/* @internal */
|
|
@@ -1486,7 +1486,7 @@ var ts;
|
|
|
1486
1486
|
function cast(value, test) {
|
|
1487
1487
|
if (value !== undefined && test(value))
|
|
1488
1488
|
return value;
|
|
1489
|
-
return ts.Debug.fail("Invalid cast. The supplied value "
|
|
1489
|
+
return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
|
|
1490
1490
|
}
|
|
1491
1491
|
ts.cast = cast;
|
|
1492
1492
|
/** Does nothing. */
|
|
@@ -1577,7 +1577,7 @@ var ts;
|
|
|
1577
1577
|
function memoizeOne(callback) {
|
|
1578
1578
|
var map = new ts.Map();
|
|
1579
1579
|
return function (arg) {
|
|
1580
|
-
var key = typeof arg
|
|
1580
|
+
var key = "".concat(typeof arg, ":").concat(arg);
|
|
1581
1581
|
var value = map.get(key);
|
|
1582
1582
|
if (value === undefined && !map.has(key)) {
|
|
1583
1583
|
value = callback(arg);
|
|
@@ -2027,7 +2027,7 @@ var ts;
|
|
|
2027
2027
|
ts.createGetCanonicalFileName = createGetCanonicalFileName;
|
|
2028
2028
|
function patternText(_a) {
|
|
2029
2029
|
var prefix = _a.prefix, suffix = _a.suffix;
|
|
2030
|
-
return prefix
|
|
2030
|
+
return "".concat(prefix, "*").concat(suffix);
|
|
2031
2031
|
}
|
|
2032
2032
|
ts.patternText = patternText;
|
|
2033
2033
|
/**
|
|
@@ -2340,7 +2340,7 @@ var ts;
|
|
|
2340
2340
|
}
|
|
2341
2341
|
function fail(message, stackCrawlMark) {
|
|
2342
2342
|
debugger;
|
|
2343
|
-
var e = new Error(message ? "Debug Failure. "
|
|
2343
|
+
var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
|
|
2344
2344
|
if (Error.captureStackTrace) {
|
|
2345
2345
|
Error.captureStackTrace(e, stackCrawlMark || fail);
|
|
2346
2346
|
}
|
|
@@ -2348,12 +2348,12 @@ var ts;
|
|
|
2348
2348
|
}
|
|
2349
2349
|
Debug.fail = fail;
|
|
2350
2350
|
function failBadSyntaxKind(node, message, stackCrawlMark) {
|
|
2351
|
-
return fail((message || "Unexpected node."
|
|
2351
|
+
return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
|
|
2352
2352
|
}
|
|
2353
2353
|
Debug.failBadSyntaxKind = failBadSyntaxKind;
|
|
2354
2354
|
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
|
|
2355
2355
|
if (!expression) {
|
|
2356
|
-
message = message ? "False expression: "
|
|
2356
|
+
message = message ? "False expression: ".concat(message) : "False expression.";
|
|
2357
2357
|
if (verboseDebugInfo) {
|
|
2358
2358
|
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
|
|
2359
2359
|
}
|
|
@@ -2363,26 +2363,26 @@ var ts;
|
|
|
2363
2363
|
Debug.assert = assert;
|
|
2364
2364
|
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
|
|
2365
2365
|
if (a !== b) {
|
|
2366
|
-
var message = msg ? msg2 ? msg
|
|
2367
|
-
fail("Expected "
|
|
2366
|
+
var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
|
|
2367
|
+
fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
|
|
2368
2368
|
}
|
|
2369
2369
|
}
|
|
2370
2370
|
Debug.assertEqual = assertEqual;
|
|
2371
2371
|
function assertLessThan(a, b, msg, stackCrawlMark) {
|
|
2372
2372
|
if (a >= b) {
|
|
2373
|
-
fail("Expected "
|
|
2373
|
+
fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
2376
|
Debug.assertLessThan = assertLessThan;
|
|
2377
2377
|
function assertLessThanOrEqual(a, b, stackCrawlMark) {
|
|
2378
2378
|
if (a > b) {
|
|
2379
|
-
fail("Expected "
|
|
2379
|
+
fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
|
|
2380
2380
|
}
|
|
2381
2381
|
}
|
|
2382
2382
|
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
|
|
2383
2383
|
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
|
|
2384
2384
|
if (a < b) {
|
|
2385
|
-
fail("Expected "
|
|
2385
|
+
fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
|
|
2386
2386
|
}
|
|
2387
2387
|
}
|
|
2388
2388
|
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
|
|
@@ -2413,42 +2413,42 @@ var ts;
|
|
|
2413
2413
|
function assertNever(member, message, stackCrawlMark) {
|
|
2414
2414
|
if (message === void 0) { message = "Illegal value:"; }
|
|
2415
2415
|
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
|
|
2416
|
-
return fail(message
|
|
2416
|
+
return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
|
|
2417
2417
|
}
|
|
2418
2418
|
Debug.assertNever = assertNever;
|
|
2419
2419
|
function assertEachNode(nodes, test, message, stackCrawlMark) {
|
|
2420
2420
|
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
|
|
2421
|
-
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '"
|
|
2421
|
+
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
2424
|
Debug.assertEachNode = assertEachNode;
|
|
2425
2425
|
function assertNode(node, test, message, stackCrawlMark) {
|
|
2426
2426
|
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
|
|
2427
|
-
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node "
|
|
2427
|
+
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNode);
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
Debug.assertNode = assertNode;
|
|
2431
2431
|
function assertNotNode(node, test, message, stackCrawlMark) {
|
|
2432
2432
|
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
|
|
2433
|
-
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node "
|
|
2433
|
+
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " should not have passed test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNotNode);
|
|
2434
2434
|
}
|
|
2435
2435
|
}
|
|
2436
2436
|
Debug.assertNotNode = assertNotNode;
|
|
2437
2437
|
function assertOptionalNode(node, test, message, stackCrawlMark) {
|
|
2438
2438
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
|
|
2439
|
-
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node "
|
|
2439
|
+
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertOptionalNode);
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
Debug.assertOptionalNode = assertOptionalNode;
|
|
2443
2443
|
function assertOptionalToken(node, kind, message, stackCrawlMark) {
|
|
2444
2444
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
|
|
2445
|
-
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node "
|
|
2445
|
+
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " was not a '").concat(formatSyntaxKind(kind), "' token."); }, stackCrawlMark || assertOptionalToken);
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
2448
|
Debug.assertOptionalToken = assertOptionalToken;
|
|
2449
2449
|
function assertMissingNode(node, message, stackCrawlMark) {
|
|
2450
2450
|
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
|
|
2451
|
-
assert(node === undefined, message || "Unexpected node.", function () { return "Node "
|
|
2451
|
+
assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
2454
2454
|
Debug.assertMissingNode = assertMissingNode;
|
|
@@ -2469,7 +2469,7 @@ var ts;
|
|
|
2469
2469
|
}
|
|
2470
2470
|
Debug.getFunctionName = getFunctionName;
|
|
2471
2471
|
function formatSymbol(symbol) {
|
|
2472
|
-
return "{ name: "
|
|
2472
|
+
return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
|
|
2473
2473
|
}
|
|
2474
2474
|
Debug.formatSymbol = formatSymbol;
|
|
2475
2475
|
/**
|
|
@@ -2490,7 +2490,7 @@ var ts;
|
|
|
2490
2490
|
break;
|
|
2491
2491
|
}
|
|
2492
2492
|
if (enumValue !== 0 && enumValue & value) {
|
|
2493
|
-
result = ""
|
|
2493
|
+
result = "".concat(result).concat(result ? "|" : "").concat(enumName);
|
|
2494
2494
|
remainingFlags &= ~enumValue;
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
@@ -2600,7 +2600,7 @@ var ts;
|
|
|
2600
2600
|
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
|
|
2601
2601
|
"UnknownFlow";
|
|
2602
2602
|
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
|
|
2603
|
-
return ""
|
|
2603
|
+
return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
|
|
2604
2604
|
}
|
|
2605
2605
|
},
|
|
2606
2606
|
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
|
|
@@ -2639,7 +2639,7 @@ var ts;
|
|
|
2639
2639
|
// We don't care, this is debug code that's only enabled with a debugger attached -
|
|
2640
2640
|
// we're just taking note of it for anyone checking regex performance in the future.
|
|
2641
2641
|
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
|
|
2642
|
-
return "NodeArray "
|
|
2642
|
+
return "NodeArray ".concat(defaultValue);
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
2645
|
});
|
|
@@ -2694,7 +2694,7 @@ var ts;
|
|
|
2694
2694
|
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
|
|
2695
2695
|
"Symbol";
|
|
2696
2696
|
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
|
|
2697
|
-
return symbolHeader
|
|
2697
|
+
return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
|
|
2698
2698
|
}
|
|
2699
2699
|
},
|
|
2700
2700
|
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
|
|
@@ -2704,11 +2704,11 @@ var ts;
|
|
|
2704
2704
|
__tsDebuggerDisplay: {
|
|
2705
2705
|
value: function () {
|
|
2706
2706
|
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
|
|
2707
|
-
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType "
|
|
2708
|
-
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType "
|
|
2707
|
+
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
|
|
2708
|
+
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
|
|
2709
2709
|
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
|
|
2710
2710
|
this.flags & 32 /* Enum */ ? "EnumType" :
|
|
2711
|
-
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType "
|
|
2711
|
+
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
|
|
2712
2712
|
this.flags & 1048576 /* Union */ ? "UnionType" :
|
|
2713
2713
|
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
|
|
2714
2714
|
this.flags & 4194304 /* Index */ ? "IndexType" :
|
|
@@ -2727,7 +2727,7 @@ var ts;
|
|
|
2727
2727
|
"ObjectType" :
|
|
2728
2728
|
"Type";
|
|
2729
2729
|
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
|
|
2730
|
-
return ""
|
|
2730
|
+
return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
|
|
2731
2731
|
}
|
|
2732
2732
|
},
|
|
2733
2733
|
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
|
|
@@ -2763,11 +2763,11 @@ var ts;
|
|
|
2763
2763
|
__tsDebuggerDisplay: {
|
|
2764
2764
|
value: function () {
|
|
2765
2765
|
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
|
|
2766
|
-
ts.isIdentifier(this) ? "Identifier '"
|
|
2767
|
-
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '"
|
|
2768
|
-
ts.isStringLiteral(this) ? "StringLiteral "
|
|
2769
|
-
ts.isNumericLiteral(this) ? "NumericLiteral "
|
|
2770
|
-
ts.isBigIntLiteral(this) ? "BigIntLiteral "
|
|
2766
|
+
ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
|
|
2767
|
+
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
|
|
2768
|
+
ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
|
|
2769
|
+
ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
|
|
2770
|
+
ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
|
|
2771
2771
|
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
|
|
2772
2772
|
ts.isParameter(this) ? "ParameterDeclaration" :
|
|
2773
2773
|
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
|
|
@@ -2799,7 +2799,7 @@ var ts;
|
|
|
2799
2799
|
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
|
|
2800
2800
|
ts.isImportTypeNode(this) ? "ImportTypeNode" :
|
|
2801
2801
|
formatSyntaxKind(this.kind);
|
|
2802
|
-
return ""
|
|
2802
|
+
return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
|
|
2803
2803
|
}
|
|
2804
2804
|
},
|
|
2805
2805
|
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
|
|
@@ -2846,10 +2846,10 @@ var ts;
|
|
|
2846
2846
|
Debug.enableDebugInfo = enableDebugInfo;
|
|
2847
2847
|
function formatDeprecationMessage(name, error, errorAfter, since, message) {
|
|
2848
2848
|
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
|
|
2849
|
-
deprecationMessage += "'"
|
|
2850
|
-
deprecationMessage += since ? "has been deprecated since v"
|
|
2851
|
-
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v"
|
|
2852
|
-
deprecationMessage += message ? " "
|
|
2849
|
+
deprecationMessage += "'".concat(name, "' ");
|
|
2850
|
+
deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
|
|
2851
|
+
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
|
|
2852
|
+
deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
|
|
2853
2853
|
return deprecationMessage;
|
|
2854
2854
|
}
|
|
2855
2855
|
function createErrorDeprecation(name, errorAfter, since, message) {
|
|
@@ -2980,11 +2980,11 @@ var ts;
|
|
|
2980
2980
|
}
|
|
2981
2981
|
};
|
|
2982
2982
|
Version.prototype.toString = function () {
|
|
2983
|
-
var result = this.major
|
|
2983
|
+
var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
|
|
2984
2984
|
if (ts.some(this.prerelease))
|
|
2985
|
-
result += "-"
|
|
2985
|
+
result += "-".concat(this.prerelease.join("."));
|
|
2986
2986
|
if (ts.some(this.build))
|
|
2987
|
-
result += "+"
|
|
2987
|
+
result += "+".concat(this.build.join("."));
|
|
2988
2988
|
return result;
|
|
2989
2989
|
};
|
|
2990
2990
|
Version.zero = new Version(0, 0, 0);
|
|
@@ -3251,7 +3251,7 @@ var ts;
|
|
|
3251
3251
|
return ts.map(comparators, formatComparator).join(" ");
|
|
3252
3252
|
}
|
|
3253
3253
|
function formatComparator(comparator) {
|
|
3254
|
-
return ""
|
|
3254
|
+
return "".concat(comparator.operator).concat(comparator.operand);
|
|
3255
3255
|
}
|
|
3256
3256
|
})(ts || (ts = {}));
|
|
3257
3257
|
/*@internal*/
|
|
@@ -3549,7 +3549,7 @@ var ts;
|
|
|
3549
3549
|
fs = require("fs");
|
|
3550
3550
|
}
|
|
3551
3551
|
catch (e) {
|
|
3552
|
-
throw new Error("tracing requires having fs\n(original error: "
|
|
3552
|
+
throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
|
|
3553
3553
|
}
|
|
3554
3554
|
}
|
|
3555
3555
|
mode = tracingMode;
|
|
@@ -3561,11 +3561,11 @@ var ts;
|
|
|
3561
3561
|
if (!fs.existsSync(traceDir)) {
|
|
3562
3562
|
fs.mkdirSync(traceDir, { recursive: true });
|
|
3563
3563
|
}
|
|
3564
|
-
var countPart = mode === "build" ? "."
|
|
3565
|
-
: mode === "server" ? "."
|
|
3564
|
+
var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
|
|
3565
|
+
: mode === "server" ? ".".concat(process.pid)
|
|
3566
3566
|
: "";
|
|
3567
|
-
var tracePath = ts.combinePaths(traceDir, "trace"
|
|
3568
|
-
var typesPath = ts.combinePaths(traceDir, "types"
|
|
3567
|
+
var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
|
|
3568
|
+
var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
|
|
3569
3569
|
legend.push({
|
|
3570
3570
|
configFilePath: configFilePath,
|
|
3571
3571
|
tracePath: tracePath,
|
|
@@ -3655,7 +3655,7 @@ var ts;
|
|
|
3655
3655
|
}
|
|
3656
3656
|
// test if [time,endTime) straddles a sampling point
|
|
3657
3657
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3658
|
-
writeEvent("X", phase, name, args, "\"dur\":"
|
|
3658
|
+
writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
|
|
3659
3659
|
}
|
|
3660
3660
|
}
|
|
3661
3661
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -3664,11 +3664,11 @@ var ts;
|
|
|
3664
3664
|
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
|
|
3665
3665
|
return;
|
|
3666
3666
|
ts.performance.mark("beginTracing");
|
|
3667
|
-
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\""
|
|
3667
|
+
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
|
|
3668
3668
|
if (extras)
|
|
3669
|
-
fs.writeSync(traceFd, ","
|
|
3669
|
+
fs.writeSync(traceFd, ",".concat(extras));
|
|
3670
3670
|
if (args)
|
|
3671
|
-
fs.writeSync(traceFd, ",\"args\":"
|
|
3671
|
+
fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
|
|
3672
3672
|
fs.writeSync(traceFd, "}");
|
|
3673
3673
|
ts.performance.mark("endTracing");
|
|
3674
3674
|
ts.performance.measure("Tracing", "beginTracing", "endTracing");
|
|
@@ -4829,6 +4829,8 @@ var ts;
|
|
|
4829
4829
|
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
|
|
4830
4830
|
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
|
|
4831
4831
|
/* @internal */
|
|
4832
|
+
TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
|
|
4833
|
+
/* @internal */
|
|
4832
4834
|
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
|
|
4833
4835
|
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
|
|
4834
4836
|
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
|
|
@@ -5781,7 +5783,7 @@ var ts;
|
|
|
5781
5783
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
5782
5784
|
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
|
|
5783
5785
|
function getLevel(envVar, level) {
|
|
5784
|
-
return system.getEnvironmentVariable(envVar
|
|
5786
|
+
return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
|
|
5785
5787
|
}
|
|
5786
5788
|
function getCustomLevels(baseVariable) {
|
|
5787
5789
|
var customLevels;
|
|
@@ -6250,7 +6252,7 @@ var ts;
|
|
|
6250
6252
|
}
|
|
6251
6253
|
function onTimerToUpdateChildWatches() {
|
|
6252
6254
|
timerToUpdateChildWatches = undefined;
|
|
6253
|
-
sysLog("sysLog:: onTimerToUpdateChildWatches:: "
|
|
6255
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
|
|
6254
6256
|
var start = ts.timestamp();
|
|
6255
6257
|
var invokeMap = new ts.Map();
|
|
6256
6258
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6263,7 +6265,7 @@ var ts;
|
|
|
6263
6265
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6264
6266
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6265
6267
|
}
|
|
6266
|
-
sysLog("sysLog:: invokingWatchers:: Elapsed:: "
|
|
6268
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
|
|
6267
6269
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6268
6270
|
var existing = invokeMap.get(rootDirName);
|
|
6269
6271
|
if (existing) {
|
|
@@ -6279,7 +6281,7 @@ var ts;
|
|
|
6279
6281
|
}
|
|
6280
6282
|
});
|
|
6281
6283
|
var elapsed = ts.timestamp() - start;
|
|
6282
|
-
sysLog("sysLog:: Elapsed:: "
|
|
6284
|
+
sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
|
|
6283
6285
|
}
|
|
6284
6286
|
function removeChildWatches(parentWatcher) {
|
|
6285
6287
|
if (!parentWatcher)
|
|
@@ -6739,7 +6741,7 @@ var ts;
|
|
|
6739
6741
|
var remappedPaths = new ts.Map();
|
|
6740
6742
|
var normalizedDir = ts.normalizeSlashes(__dirname);
|
|
6741
6743
|
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
|
|
6742
|
-
var fileUrlRoot = "file://"
|
|
6744
|
+
var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
|
|
6743
6745
|
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
|
|
6744
6746
|
var node = _a[_i];
|
|
6745
6747
|
if (node.callFrame.url) {
|
|
@@ -6748,7 +6750,7 @@ var ts;
|
|
|
6748
6750
|
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
|
|
6749
6751
|
}
|
|
6750
6752
|
else if (!nativePattern.test(url)) {
|
|
6751
|
-
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external"
|
|
6753
|
+
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
|
|
6752
6754
|
externalFileCounter++;
|
|
6753
6755
|
}
|
|
6754
6756
|
}
|
|
@@ -6764,7 +6766,7 @@ var ts;
|
|
|
6764
6766
|
if (!err) {
|
|
6765
6767
|
try {
|
|
6766
6768
|
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
6767
|
-
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-")
|
|
6769
|
+
profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
|
|
6768
6770
|
}
|
|
6769
6771
|
}
|
|
6770
6772
|
catch (_c) {
|
|
@@ -6866,7 +6868,7 @@ var ts;
|
|
|
6866
6868
|
* @param createWatcher
|
|
6867
6869
|
*/
|
|
6868
6870
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
6869
|
-
sysLog("sysLog:: "
|
|
6871
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
|
|
6870
6872
|
// Call the callback for current directory
|
|
6871
6873
|
callback("rename", "");
|
|
6872
6874
|
// If watcher is not closed, update it
|
|
@@ -6891,7 +6893,7 @@ var ts;
|
|
|
6891
6893
|
}
|
|
6892
6894
|
}
|
|
6893
6895
|
if (hitSystemWatcherLimit) {
|
|
6894
|
-
sysLog("sysLog:: "
|
|
6896
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
|
|
6895
6897
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6896
6898
|
}
|
|
6897
6899
|
try {
|
|
@@ -6907,7 +6909,7 @@ var ts;
|
|
|
6907
6909
|
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
6908
6910
|
// so instead of throwing error, use fs.watchFile
|
|
6909
6911
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
6910
|
-
sysLog("sysLog:: "
|
|
6912
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
|
|
6911
6913
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6912
6914
|
}
|
|
6913
6915
|
}
|
|
@@ -8070,6 +8072,8 @@ var ts;
|
|
|
8070
8072
|
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."),
|
|
8071
8073
|
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."),
|
|
8072
8074
|
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."),
|
|
8075
|
+
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}'."),
|
|
8076
|
+
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'."),
|
|
8073
8077
|
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."),
|
|
8074
8078
|
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."),
|
|
8075
8079
|
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."),
|
|
@@ -9922,7 +9926,7 @@ var ts;
|
|
|
9922
9926
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
9923
9927
|
}
|
|
9924
9928
|
else {
|
|
9925
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
9929
|
+
ts.Debug.fail("Bad line number. Line: ".concat(line, ", lineStarts.length: ").concat(lineStarts.length, " , line map is correct? ").concat(debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
|
|
9926
9930
|
}
|
|
9927
9931
|
}
|
|
9928
9932
|
var res = lineStarts[line] + character;
|
|
@@ -12812,7 +12816,7 @@ var ts;
|
|
|
12812
12816
|
: "linkplain";
|
|
12813
12817
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
12814
12818
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
12815
|
-
return "{@"
|
|
12819
|
+
return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
|
|
12816
12820
|
}
|
|
12817
12821
|
/**
|
|
12818
12822
|
* Gets the effective type parameters. If the node was parsed in a
|
|
@@ -14069,11 +14073,11 @@ var ts;
|
|
|
14069
14073
|
}
|
|
14070
14074
|
function packageIdToPackageName(_a) {
|
|
14071
14075
|
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14072
|
-
return subModuleName ? name
|
|
14076
|
+
return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
|
|
14073
14077
|
}
|
|
14074
14078
|
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14075
14079
|
function packageIdToString(packageId) {
|
|
14076
|
-
return packageIdToPackageName(packageId)
|
|
14080
|
+
return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
|
|
14077
14081
|
}
|
|
14078
14082
|
ts.packageIdToString = packageIdToString;
|
|
14079
14083
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14156,7 +14160,7 @@ var ts;
|
|
|
14156
14160
|
function nodePosToString(node) {
|
|
14157
14161
|
var file = getSourceFileOfNode(node);
|
|
14158
14162
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
14159
|
-
return file.fileName
|
|
14163
|
+
return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
|
|
14160
14164
|
}
|
|
14161
14165
|
ts.nodePosToString = nodePosToString;
|
|
14162
14166
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -14295,7 +14299,7 @@ var ts;
|
|
|
14295
14299
|
ts.isPinnedComment = isPinnedComment;
|
|
14296
14300
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
14297
14301
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
14298
|
-
""
|
|
14302
|
+
"".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
|
|
14299
14303
|
commentDirective,
|
|
14300
14304
|
]); }));
|
|
14301
14305
|
var usedLines = new ts.Map();
|
|
@@ -14312,10 +14316,10 @@ var ts;
|
|
|
14312
14316
|
});
|
|
14313
14317
|
}
|
|
14314
14318
|
function markUsed(line) {
|
|
14315
|
-
if (!directivesByLine.has(""
|
|
14319
|
+
if (!directivesByLine.has("".concat(line))) {
|
|
14316
14320
|
return false;
|
|
14317
14321
|
}
|
|
14318
|
-
usedLines.set(""
|
|
14322
|
+
usedLines.set("".concat(line), true);
|
|
14319
14323
|
return true;
|
|
14320
14324
|
}
|
|
14321
14325
|
}
|
|
@@ -14545,7 +14549,7 @@ var ts;
|
|
|
14545
14549
|
}
|
|
14546
14550
|
return node.text;
|
|
14547
14551
|
}
|
|
14548
|
-
return ts.Debug.fail("Literal kind '"
|
|
14552
|
+
return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
|
|
14549
14553
|
}
|
|
14550
14554
|
ts.getLiteralText = getLiteralText;
|
|
14551
14555
|
function canUseOriginalText(node, flags) {
|
|
@@ -17126,11 +17130,11 @@ var ts;
|
|
|
17126
17130
|
}
|
|
17127
17131
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
17128
17132
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
17129
|
-
return "__@"
|
|
17133
|
+
return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
|
|
17130
17134
|
}
|
|
17131
17135
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
17132
17136
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
17133
|
-
return "__#"
|
|
17137
|
+
return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
|
|
17134
17138
|
}
|
|
17135
17139
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
17136
17140
|
function isKnownSymbol(symbol) {
|
|
@@ -19832,7 +19836,7 @@ var ts;
|
|
|
19832
19836
|
}
|
|
19833
19837
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
19834
19838
|
function getJSXRuntimeImport(base, options) {
|
|
19835
|
-
return base ? base
|
|
19839
|
+
return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
19836
19840
|
}
|
|
19837
19841
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
19838
19842
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -19939,7 +19943,7 @@ var ts;
|
|
|
19939
19943
|
}
|
|
19940
19944
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
19941
19945
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
19942
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
19946
|
+
var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
|
|
19943
19947
|
var filesMatcher = {
|
|
19944
19948
|
/**
|
|
19945
19949
|
* Matches any single directory segment unless it is the last segment and a .min.js file
|
|
@@ -19952,7 +19956,7 @@ var ts;
|
|
|
19952
19956
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19953
19957
|
* files or directories, does not match subdirectories that start with a . character
|
|
19954
19958
|
*/
|
|
19955
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19959
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19956
19960
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
19957
19961
|
};
|
|
19958
19962
|
var directoriesMatcher = {
|
|
@@ -19961,7 +19965,7 @@ var ts;
|
|
|
19961
19965
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19962
19966
|
* files or directories, does not match subdirectories that start with a . character
|
|
19963
19967
|
*/
|
|
19964
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19968
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19965
19969
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
19966
19970
|
};
|
|
19967
19971
|
var excludeMatcher = {
|
|
@@ -19979,10 +19983,10 @@ var ts;
|
|
|
19979
19983
|
if (!patterns || !patterns.length) {
|
|
19980
19984
|
return undefined;
|
|
19981
19985
|
}
|
|
19982
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
19986
|
+
var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
|
|
19983
19987
|
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
|
|
19984
19988
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
19985
|
-
return "^("
|
|
19989
|
+
return "^(".concat(pattern, ")").concat(terminator);
|
|
19986
19990
|
}
|
|
19987
19991
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
19988
19992
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -20004,7 +20008,7 @@ var ts;
|
|
|
20004
20008
|
ts.isImplicitGlob = isImplicitGlob;
|
|
20005
20009
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
20006
20010
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
20007
|
-
return pattern && "^("
|
|
20011
|
+
return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
|
|
20008
20012
|
}
|
|
20009
20013
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
20010
20014
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -20082,7 +20086,7 @@ var ts;
|
|
|
20082
20086
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20083
20087
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
20084
20088
|
return {
|
|
20085
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
20089
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
|
|
20086
20090
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20087
20091
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20088
20092
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -20363,7 +20367,7 @@ var ts;
|
|
|
20363
20367
|
*/
|
|
20364
20368
|
function extensionFromPath(path) {
|
|
20365
20369
|
var ext = tryGetExtensionFromPath(path);
|
|
20366
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
20370
|
+
return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
|
|
20367
20371
|
}
|
|
20368
20372
|
ts.extensionFromPath = extensionFromPath;
|
|
20369
20373
|
function isAnySupportedFileExtension(path) {
|
|
@@ -26446,7 +26450,7 @@ var ts;
|
|
|
26446
26450
|
case 326 /* JSDocAugmentsTag */: return "augments";
|
|
26447
26451
|
case 327 /* JSDocImplementsTag */: return "implements";
|
|
26448
26452
|
default:
|
|
26449
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
26453
|
+
return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
|
|
26450
26454
|
}
|
|
26451
26455
|
}
|
|
26452
26456
|
var rawTextScanner;
|
|
@@ -26774,7 +26778,7 @@ var ts;
|
|
|
26774
26778
|
};
|
|
26775
26779
|
var definedTextGetter_1 = function (path) {
|
|
26776
26780
|
var result = textGetter_1(path);
|
|
26777
|
-
return result !== undefined ? result : "/* Input file "
|
|
26781
|
+
return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
|
|
26778
26782
|
};
|
|
26779
26783
|
var buildInfo_1;
|
|
26780
26784
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -31312,7 +31316,7 @@ var ts;
|
|
|
31312
31316
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
31313
31317
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
31314
31318
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
31315
|
-
return keyword
|
|
31319
|
+
return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
|
|
31316
31320
|
}
|
|
31317
31321
|
}
|
|
31318
31322
|
return undefined;
|
|
@@ -38082,7 +38086,7 @@ var ts;
|
|
|
38082
38086
|
if (namedArgRegExCache.has(name)) {
|
|
38083
38087
|
return namedArgRegExCache.get(name);
|
|
38084
38088
|
}
|
|
38085
|
-
var result = new RegExp("(\\s"
|
|
38089
|
+
var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
|
|
38086
38090
|
namedArgRegExCache.set(name, result);
|
|
38087
38091
|
return result;
|
|
38088
38092
|
}
|
|
@@ -39560,8 +39564,8 @@ var ts;
|
|
|
39560
39564
|
}
|
|
39561
39565
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
39562
39566
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
39563
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
39564
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
39567
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
|
|
39568
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
|
|
39565
39569
|
}
|
|
39566
39570
|
/* @internal */
|
|
39567
39571
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -40355,10 +40359,10 @@ var ts;
|
|
|
40355
40359
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
40356
40360
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
40357
40361
|
if (newValue !== defaultValue) {
|
|
40358
|
-
result.push(""
|
|
40362
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
|
|
40359
40363
|
}
|
|
40360
40364
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
40361
|
-
result.push(""
|
|
40365
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
|
|
40362
40366
|
}
|
|
40363
40367
|
});
|
|
40364
40368
|
return result.join(newLine) + newLine;
|
|
@@ -40409,19 +40413,19 @@ var ts;
|
|
|
40409
40413
|
if (entries.length !== 0) {
|
|
40410
40414
|
entries.push({ value: "" });
|
|
40411
40415
|
}
|
|
40412
|
-
entries.push({ value: "/* "
|
|
40416
|
+
entries.push({ value: "/* ".concat(category, " */") });
|
|
40413
40417
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
40414
40418
|
var option = options_1[_i];
|
|
40415
40419
|
var optionName = void 0;
|
|
40416
40420
|
if (compilerOptionsMap.has(option.name)) {
|
|
40417
|
-
optionName = "\""
|
|
40421
|
+
optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
40418
40422
|
}
|
|
40419
40423
|
else {
|
|
40420
|
-
optionName = "// \""
|
|
40424
|
+
optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
|
|
40421
40425
|
}
|
|
40422
40426
|
entries.push({
|
|
40423
40427
|
value: optionName,
|
|
40424
|
-
description: "/* "
|
|
40428
|
+
description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
|
|
40425
40429
|
});
|
|
40426
40430
|
marginLength = Math.max(optionName.length, marginLength);
|
|
40427
40431
|
}
|
|
@@ -40430,25 +40434,25 @@ var ts;
|
|
|
40430
40434
|
var tab = makePadding(2);
|
|
40431
40435
|
var result = [];
|
|
40432
40436
|
result.push("{");
|
|
40433
|
-
result.push(tab
|
|
40434
|
-
result.push(""
|
|
40437
|
+
result.push("".concat(tab, "\"compilerOptions\": {"));
|
|
40438
|
+
result.push("".concat(tab).concat(tab, "/* ").concat(ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file), " */"));
|
|
40435
40439
|
result.push("");
|
|
40436
40440
|
// Print out each row, aligning all the descriptions on the same column.
|
|
40437
40441
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
40438
40442
|
var entry = entries_2[_a];
|
|
40439
40443
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
40440
|
-
result.push(value && ""
|
|
40444
|
+
result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
|
|
40441
40445
|
}
|
|
40442
40446
|
if (fileNames.length) {
|
|
40443
|
-
result.push(tab
|
|
40444
|
-
result.push(tab
|
|
40447
|
+
result.push("".concat(tab, "},"));
|
|
40448
|
+
result.push("".concat(tab, "\"files\": ["));
|
|
40445
40449
|
for (var i = 0; i < fileNames.length; i++) {
|
|
40446
|
-
result.push(""
|
|
40450
|
+
result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
|
|
40447
40451
|
}
|
|
40448
|
-
result.push(tab
|
|
40452
|
+
result.push("".concat(tab, "]"));
|
|
40449
40453
|
}
|
|
40450
40454
|
else {
|
|
40451
|
-
result.push(tab
|
|
40455
|
+
result.push("".concat(tab, "}"));
|
|
40452
40456
|
}
|
|
40453
40457
|
result.push("}");
|
|
40454
40458
|
return result.join(newLine) + newLine;
|
|
@@ -40846,7 +40850,7 @@ var ts;
|
|
|
40846
40850
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
40847
40851
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
40848
40852
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
|
|
40849
|
-
extendedConfigPath = extendedConfigPath
|
|
40853
|
+
extendedConfigPath = "".concat(extendedConfigPath, ".json");
|
|
40850
40854
|
if (!host.fileExists(extendedConfigPath)) {
|
|
40851
40855
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
40852
40856
|
return undefined;
|
|
@@ -41091,7 +41095,7 @@ var ts;
|
|
|
41091
41095
|
// Valid only if *.json specified
|
|
41092
41096
|
if (!jsonOnlyIncludeRegexes) {
|
|
41093
41097
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
|
|
41094
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
41098
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
|
|
41095
41099
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
41096
41100
|
}
|
|
41097
41101
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -41527,7 +41531,7 @@ var ts;
|
|
|
41527
41531
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
41528
41532
|
if (typeof bestVersionPaths !== "object") {
|
|
41529
41533
|
if (state.traceEnabled) {
|
|
41530
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
41534
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
|
|
41531
41535
|
}
|
|
41532
41536
|
return;
|
|
41533
41537
|
}
|
|
@@ -41934,7 +41938,7 @@ var ts;
|
|
|
41934
41938
|
};
|
|
41935
41939
|
return cache;
|
|
41936
41940
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
41937
|
-
var result = mode === undefined ? specifier : mode
|
|
41941
|
+
var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
|
|
41938
41942
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
41939
41943
|
return result;
|
|
41940
41944
|
}
|
|
@@ -41965,7 +41969,7 @@ var ts;
|
|
|
41965
41969
|
}
|
|
41966
41970
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
41967
41971
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
41968
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode
|
|
41972
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
|
|
41969
41973
|
}
|
|
41970
41974
|
function createPerModuleNameCache() {
|
|
41971
41975
|
var directoryPathMap = new ts.Map();
|
|
@@ -42112,10 +42116,10 @@ var ts;
|
|
|
42112
42116
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42113
42117
|
break;
|
|
42114
42118
|
default:
|
|
42115
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
42119
|
+
return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
|
|
42116
42120
|
}
|
|
42117
42121
|
if (result && result.resolvedModule)
|
|
42118
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
42122
|
+
ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
|
|
42119
42123
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
42120
42124
|
if (perFolderCache) {
|
|
42121
42125
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -42318,7 +42322,7 @@ var ts;
|
|
|
42318
42322
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
42319
42323
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
42320
42324
|
if (!resolvedModule) {
|
|
42321
|
-
throw new Error("Could not resolve JS module '"
|
|
42325
|
+
throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
|
|
42322
42326
|
}
|
|
42323
42327
|
return resolvedModule.resolvedFileName;
|
|
42324
42328
|
}
|
|
@@ -42428,7 +42432,7 @@ var ts;
|
|
|
42428
42432
|
if (traceEnabled) {
|
|
42429
42433
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
42430
42434
|
}
|
|
42431
|
-
ts.Debug.assert(host.fileExists(real), path
|
|
42435
|
+
ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
|
|
42432
42436
|
return real;
|
|
42433
42437
|
}
|
|
42434
42438
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -42905,7 +42909,7 @@ var ts;
|
|
|
42905
42909
|
return undefined;
|
|
42906
42910
|
}
|
|
42907
42911
|
var trailingParts = parts.slice(nameParts.length);
|
|
42908
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
42912
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
42909
42913
|
}
|
|
42910
42914
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
42911
42915
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -43233,7 +43237,7 @@ var ts;
|
|
|
43233
43237
|
}
|
|
43234
43238
|
/* @internal */
|
|
43235
43239
|
function getTypesPackageName(packageName) {
|
|
43236
|
-
return "@types/"
|
|
43240
|
+
return "@types/".concat(mangleScopedPackageName(packageName));
|
|
43237
43241
|
}
|
|
43238
43242
|
ts.getTypesPackageName = getTypesPackageName;
|
|
43239
43243
|
/* @internal */
|
|
@@ -43634,7 +43638,7 @@ var ts;
|
|
|
43634
43638
|
if (name) {
|
|
43635
43639
|
if (ts.isAmbientModule(node)) {
|
|
43636
43640
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
43637
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
43641
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
|
|
43638
43642
|
}
|
|
43639
43643
|
if (name.kind === 161 /* ComputedPropertyName */) {
|
|
43640
43644
|
var nameExpression = name.expression;
|
|
@@ -43691,7 +43695,7 @@ var ts;
|
|
|
43691
43695
|
case 163 /* Parameter */:
|
|
43692
43696
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43693
43697
|
// without names can only come from JSDocFunctionTypes.
|
|
43694
|
-
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: "
|
|
43698
|
+
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: ".concat(ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind, ", expected JSDocFunctionType"); });
|
|
43695
43699
|
var functionType = node.parent;
|
|
43696
43700
|
var index = functionType.parameters.indexOf(node);
|
|
43697
43701
|
return "arg" + index;
|
|
@@ -43803,7 +43807,7 @@ var ts;
|
|
|
43803
43807
|
var relatedInformation_1 = [];
|
|
43804
43808
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
43805
43809
|
// export type T; - may have meant export type { T }?
|
|
43806
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
43810
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
|
|
43807
43811
|
}
|
|
43808
43812
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
43809
43813
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -45879,7 +45883,7 @@ var ts;
|
|
|
45879
45883
|
}
|
|
45880
45884
|
}
|
|
45881
45885
|
function bindSourceFileAsExternalModule() {
|
|
45882
|
-
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\""
|
|
45886
|
+
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
|
|
45883
45887
|
}
|
|
45884
45888
|
function bindExportAssignment(node) {
|
|
45885
45889
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -46930,8 +46934,7 @@ var ts;
|
|
|
46930
46934
|
IntersectionState[IntersectionState["Source"] = 1] = "Source";
|
|
46931
46935
|
IntersectionState[IntersectionState["Target"] = 2] = "Target";
|
|
46932
46936
|
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
|
|
46933
|
-
IntersectionState[IntersectionState["
|
|
46934
|
-
IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
|
|
46937
|
+
IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
|
|
46935
46938
|
})(IntersectionState || (IntersectionState = {}));
|
|
46936
46939
|
var RecursionFlags;
|
|
46937
46940
|
(function (RecursionFlags) {
|
|
@@ -47979,7 +47982,7 @@ var ts;
|
|
|
47979
47982
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
47980
47983
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
|
|
47981
47984
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
47982
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path
|
|
47985
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
|
|
47983
47986
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
47984
47987
|
});
|
|
47985
47988
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
@@ -50632,7 +50635,7 @@ var ts;
|
|
|
50632
50635
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
50633
50636
|
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
|
|
50634
50637
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
50635
|
-
var key = (useOnlyExternalAliasing ? 0 : 1
|
|
50638
|
+
var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
|
|
50636
50639
|
if (cache.has(key)) {
|
|
50637
50640
|
return cache.get(key);
|
|
50638
50641
|
}
|
|
@@ -51481,7 +51484,7 @@ var ts;
|
|
|
51481
51484
|
context.symbolDepth = new ts.Map();
|
|
51482
51485
|
}
|
|
51483
51486
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
51484
|
-
var key = getTypeId(type)
|
|
51487
|
+
var key = "".concat(getTypeId(type), "|").concat(context.flags);
|
|
51485
51488
|
if (links) {
|
|
51486
51489
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
51487
51490
|
}
|
|
@@ -51750,7 +51753,7 @@ var ts;
|
|
|
51750
51753
|
}
|
|
51751
51754
|
}
|
|
51752
51755
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
51753
|
-
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... "
|
|
51756
|
+
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
|
|
51754
51757
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
51755
51758
|
break;
|
|
51756
51759
|
}
|
|
@@ -51865,7 +51868,7 @@ var ts;
|
|
|
51865
51868
|
else if (types.length > 2) {
|
|
51866
51869
|
return [
|
|
51867
51870
|
typeToTypeNodeHelper(types[0], context),
|
|
51868
|
-
ts.factory.createTypeReferenceNode("... "
|
|
51871
|
+
ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
|
|
51869
51872
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
51870
51873
|
];
|
|
51871
51874
|
}
|
|
@@ -51879,7 +51882,7 @@ var ts;
|
|
|
51879
51882
|
var type = types_2[_i];
|
|
51880
51883
|
i++;
|
|
51881
51884
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
51882
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
51885
|
+
result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
|
|
51883
51886
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
51884
51887
|
if (typeNode_1) {
|
|
51885
51888
|
result_5.push(typeNode_1);
|
|
@@ -52402,7 +52405,7 @@ var ts;
|
|
|
52402
52405
|
var text = rawtext;
|
|
52403
52406
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
52404
52407
|
i++;
|
|
52405
|
-
text = rawtext
|
|
52408
|
+
text = "".concat(rawtext, "_").concat(i);
|
|
52406
52409
|
}
|
|
52407
52410
|
if (text !== rawtext) {
|
|
52408
52411
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -52722,7 +52725,7 @@ var ts;
|
|
|
52722
52725
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
52723
52726
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
52724
52727
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
52725
|
-
: "arg"
|
|
52728
|
+
: "arg".concat(index);
|
|
52726
52729
|
}
|
|
52727
52730
|
function rewriteModuleSpecifier(parent, lit) {
|
|
52728
52731
|
if (bundled) {
|
|
@@ -53807,7 +53810,7 @@ var ts;
|
|
|
53807
53810
|
return results_1;
|
|
53808
53811
|
}
|
|
53809
53812
|
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
|
|
53810
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
53813
|
+
return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
|
|
53811
53814
|
};
|
|
53812
53815
|
}
|
|
53813
53816
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -53882,7 +53885,7 @@ var ts;
|
|
|
53882
53885
|
if (ref) {
|
|
53883
53886
|
return ref;
|
|
53884
53887
|
}
|
|
53885
|
-
var tempName = getUnusedName(rootName
|
|
53888
|
+
var tempName = getUnusedName("".concat(rootName, "_base"));
|
|
53886
53889
|
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
|
|
53887
53890
|
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
|
|
53888
53891
|
], 2 /* Const */));
|
|
@@ -53929,7 +53932,7 @@ var ts;
|
|
|
53929
53932
|
var original = input;
|
|
53930
53933
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
53931
53934
|
i++;
|
|
53932
|
-
input = original
|
|
53935
|
+
input = "".concat(original, "_").concat(i);
|
|
53933
53936
|
}
|
|
53934
53937
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
53935
53938
|
if (id) {
|
|
@@ -54037,15 +54040,15 @@ var ts;
|
|
|
54037
54040
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
54038
54041
|
var name = "" + nameType.value;
|
|
54039
54042
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
54040
|
-
return "\""
|
|
54043
|
+
return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
|
|
54041
54044
|
}
|
|
54042
54045
|
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
54043
|
-
return "["
|
|
54046
|
+
return "[".concat(name, "]");
|
|
54044
54047
|
}
|
|
54045
54048
|
return name;
|
|
54046
54049
|
}
|
|
54047
54050
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
54048
|
-
return "["
|
|
54051
|
+
return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
|
|
54049
54052
|
}
|
|
54050
54053
|
}
|
|
54051
54054
|
}
|
|
@@ -56876,7 +56879,7 @@ var ts;
|
|
|
56876
56879
|
!leftName ? rightName :
|
|
56877
56880
|
!rightName ? leftName :
|
|
56878
56881
|
undefined;
|
|
56879
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
56882
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
56880
56883
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
56881
56884
|
params[i] = paramSymbol;
|
|
56882
56885
|
}
|
|
@@ -58827,7 +58830,7 @@ var ts;
|
|
|
58827
58830
|
return result;
|
|
58828
58831
|
}
|
|
58829
58832
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
58830
|
-
return aliasSymbol ? "@"
|
|
58833
|
+
return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
|
|
58831
58834
|
}
|
|
58832
58835
|
// This function is used to propagate certain flags when creating new object type references and union types.
|
|
58833
58836
|
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
|
|
@@ -59013,7 +59016,7 @@ var ts;
|
|
|
59013
59016
|
return undefined;
|
|
59014
59017
|
}
|
|
59015
59018
|
function getSymbolPath(symbol) {
|
|
59016
|
-
return symbol.parent ? getSymbolPath(symbol.parent)
|
|
59019
|
+
return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
|
|
59017
59020
|
}
|
|
59018
59021
|
function getUnresolvedSymbolForEntityName(name) {
|
|
59019
59022
|
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
|
|
@@ -59024,7 +59027,7 @@ var ts;
|
|
|
59024
59027
|
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
|
|
59025
59028
|
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
59026
59029
|
undefined;
|
|
59027
|
-
var path = parentSymbol ? getSymbolPath(parentSymbol)
|
|
59030
|
+
var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
|
|
59028
59031
|
var result = unresolvedSymbols.get(path);
|
|
59029
59032
|
if (!result) {
|
|
59030
59033
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
@@ -59097,7 +59100,7 @@ var ts;
|
|
|
59097
59100
|
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
|
|
59098
59101
|
return baseType;
|
|
59099
59102
|
}
|
|
59100
|
-
var id = getTypeId(baseType)
|
|
59103
|
+
var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
|
|
59101
59104
|
var cached = substitutionTypes.get(id);
|
|
59102
59105
|
if (cached) {
|
|
59103
59106
|
return cached;
|
|
@@ -60021,9 +60024,9 @@ var ts;
|
|
|
60021
60024
|
return types[0];
|
|
60022
60025
|
}
|
|
60023
60026
|
var typeKey = !origin ? getTypeListId(types) :
|
|
60024
|
-
origin.flags & 1048576 /* Union */ ? "|"
|
|
60025
|
-
origin.flags & 2097152 /* Intersection */ ? "&"
|
|
60026
|
-
"#"
|
|
60027
|
+
origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
|
|
60028
|
+
origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
|
|
60029
|
+
"#".concat(origin.type.id, "|").concat(getTypeListId(types)); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
|
|
60027
60030
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
60028
60031
|
var type = unionTypes.get(id);
|
|
60029
60032
|
if (!type) {
|
|
@@ -60545,7 +60548,7 @@ var ts;
|
|
|
60545
60548
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
|
|
60546
60549
|
return stringType;
|
|
60547
60550
|
}
|
|
60548
|
-
var id = getTypeListId(newTypes)
|
|
60551
|
+
var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
|
|
60549
60552
|
var type = templateLiteralTypes.get(id);
|
|
60550
60553
|
if (!type) {
|
|
60551
60554
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -60605,7 +60608,7 @@ var ts;
|
|
|
60605
60608
|
return str;
|
|
60606
60609
|
}
|
|
60607
60610
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
60608
|
-
var id = getSymbolId(symbol)
|
|
60611
|
+
var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
|
|
60609
60612
|
var result = stringMappingTypes.get(id);
|
|
60610
60613
|
if (!result) {
|
|
60611
60614
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -61622,7 +61625,7 @@ var ts;
|
|
|
61622
61625
|
function createUniqueESSymbolType(symbol) {
|
|
61623
61626
|
var type = createType(8192 /* UniqueESSymbol */);
|
|
61624
61627
|
type.symbol = symbol;
|
|
61625
|
-
type.escapedName = "__@"
|
|
61628
|
+
type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
|
|
61626
61629
|
return type;
|
|
61627
61630
|
}
|
|
61628
61631
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -63217,11 +63220,11 @@ var ts;
|
|
|
63217
63220
|
var overflow = false;
|
|
63218
63221
|
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
|
|
63219
63222
|
var lastSkippedInfo;
|
|
63220
|
-
var incompatibleStack
|
|
63223
|
+
var incompatibleStack;
|
|
63221
63224
|
var inPropertyCheck = false;
|
|
63222
63225
|
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
63223
63226
|
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
|
|
63224
|
-
if (incompatibleStack
|
|
63227
|
+
if (incompatibleStack) {
|
|
63225
63228
|
reportIncompatibleStack();
|
|
63226
63229
|
}
|
|
63227
63230
|
if (overflow) {
|
|
@@ -63278,19 +63281,19 @@ var ts;
|
|
|
63278
63281
|
return {
|
|
63279
63282
|
errorInfo: errorInfo,
|
|
63280
63283
|
lastSkippedInfo: lastSkippedInfo,
|
|
63281
|
-
incompatibleStack: incompatibleStack.slice(),
|
|
63284
|
+
incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
|
|
63282
63285
|
overrideNextErrorInfo: overrideNextErrorInfo,
|
|
63283
|
-
relatedInfo:
|
|
63286
|
+
relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
|
|
63284
63287
|
};
|
|
63285
63288
|
}
|
|
63286
63289
|
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
|
|
63287
63290
|
overrideNextErrorInfo++; // Suppress the next relation error
|
|
63288
63291
|
lastSkippedInfo = undefined; // Reset skipped info cache
|
|
63289
|
-
incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
|
|
63292
|
+
(incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
|
|
63290
63293
|
}
|
|
63291
63294
|
function reportIncompatibleStack() {
|
|
63292
|
-
var stack = incompatibleStack;
|
|
63293
|
-
incompatibleStack =
|
|
63295
|
+
var stack = incompatibleStack || [];
|
|
63296
|
+
incompatibleStack = undefined;
|
|
63294
63297
|
var info = lastSkippedInfo;
|
|
63295
63298
|
lastSkippedInfo = undefined;
|
|
63296
63299
|
if (stack.length === 1) {
|
|
@@ -63311,24 +63314,24 @@ var ts;
|
|
|
63311
63314
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
63312
63315
|
// Parenthesize a `new` if there is one
|
|
63313
63316
|
if (path.indexOf("new ") === 0) {
|
|
63314
|
-
path = "("
|
|
63317
|
+
path = "(".concat(path, ")");
|
|
63315
63318
|
}
|
|
63316
63319
|
var str = "" + args[0];
|
|
63317
63320
|
// If leading, just print back the arg (irrespective of if it's a valid identifier)
|
|
63318
63321
|
if (path.length === 0) {
|
|
63319
|
-
path = ""
|
|
63322
|
+
path = "".concat(str);
|
|
63320
63323
|
}
|
|
63321
63324
|
// Otherwise write a dotted name if possible
|
|
63322
63325
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
63323
|
-
path = path
|
|
63326
|
+
path = "".concat(path, ".").concat(str);
|
|
63324
63327
|
}
|
|
63325
63328
|
// Failing that, check if the name is already a computed name
|
|
63326
63329
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
63327
|
-
path = ""
|
|
63330
|
+
path = "".concat(path).concat(str);
|
|
63328
63331
|
}
|
|
63329
63332
|
// And finally write out a computed name as a last resort
|
|
63330
63333
|
else {
|
|
63331
|
-
path = path
|
|
63334
|
+
path = "".concat(path, "[").concat(str, "]");
|
|
63332
63335
|
}
|
|
63333
63336
|
break;
|
|
63334
63337
|
}
|
|
@@ -63357,7 +63360,7 @@ var ts;
|
|
|
63357
63360
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
63358
63361
|
? ""
|
|
63359
63362
|
: "...";
|
|
63360
|
-
path = ""
|
|
63363
|
+
path = "".concat(prefix).concat(path, "(").concat(params, ")");
|
|
63361
63364
|
}
|
|
63362
63365
|
break;
|
|
63363
63366
|
}
|
|
@@ -63370,7 +63373,7 @@ var ts;
|
|
|
63370
63373
|
break;
|
|
63371
63374
|
}
|
|
63372
63375
|
default:
|
|
63373
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
63376
|
+
return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
|
|
63374
63377
|
}
|
|
63375
63378
|
}
|
|
63376
63379
|
if (path) {
|
|
@@ -63396,7 +63399,7 @@ var ts;
|
|
|
63396
63399
|
}
|
|
63397
63400
|
function reportError(message, arg0, arg1, arg2, arg3) {
|
|
63398
63401
|
ts.Debug.assert(!!errorNode);
|
|
63399
|
-
if (incompatibleStack
|
|
63402
|
+
if (incompatibleStack)
|
|
63400
63403
|
reportIncompatibleStack();
|
|
63401
63404
|
if (message.elidedInCompatabilityPyramid)
|
|
63402
63405
|
return;
|
|
@@ -63412,7 +63415,7 @@ var ts;
|
|
|
63412
63415
|
}
|
|
63413
63416
|
}
|
|
63414
63417
|
function reportRelationError(message, source, target) {
|
|
63415
|
-
if (incompatibleStack
|
|
63418
|
+
if (incompatibleStack)
|
|
63416
63419
|
reportIncompatibleStack();
|
|
63417
63420
|
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
|
|
63418
63421
|
var generalizedSource = source;
|
|
@@ -63524,7 +63527,9 @@ var ts;
|
|
|
63524
63527
|
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
|
|
63525
63528
|
return -1 /* True */;
|
|
63526
63529
|
}
|
|
63527
|
-
|
|
63530
|
+
if (reportErrors) {
|
|
63531
|
+
reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
|
|
63532
|
+
}
|
|
63528
63533
|
return 0 /* False */;
|
|
63529
63534
|
}
|
|
63530
63535
|
// Normalize the source and target types: Turn fresh literal types into regular literal types,
|
|
@@ -63536,7 +63541,12 @@ var ts;
|
|
|
63536
63541
|
if (source === target)
|
|
63537
63542
|
return -1 /* True */;
|
|
63538
63543
|
if (relation === identityRelation) {
|
|
63539
|
-
|
|
63544
|
+
if (source.flags !== target.flags)
|
|
63545
|
+
return 0 /* False */;
|
|
63546
|
+
if (source.flags & 67358815 /* Singleton */)
|
|
63547
|
+
return -1 /* True */;
|
|
63548
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63549
|
+
return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
|
|
63540
63550
|
}
|
|
63541
63551
|
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
|
|
63542
63552
|
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
|
|
@@ -63546,163 +63556,130 @@ var ts;
|
|
|
63546
63556
|
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
|
|
63547
63557
|
return -1 /* True */;
|
|
63548
63558
|
}
|
|
63549
|
-
//
|
|
63550
|
-
// If so,
|
|
63551
|
-
|
|
63552
|
-
|
|
63553
|
-
|
|
63554
|
-
|
|
63555
|
-
|
|
63556
|
-
|
|
63557
|
-
|
|
63558
|
-
|
|
63559
|
-
|
|
63560
|
-
|
|
63561
|
-
if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
|
|
63562
|
-
target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
|
|
63563
|
-
}
|
|
63564
|
-
if (source === nullStrippedTarget)
|
|
63565
|
-
return -1 /* True */;
|
|
63559
|
+
// See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
|
|
63560
|
+
// plus a single non-nullable type. If so, remove null and/or undefined from the target type.
|
|
63561
|
+
if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
|
|
63562
|
+
var types = target.types;
|
|
63563
|
+
var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
|
|
63564
|
+
types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
|
|
63565
|
+
undefined;
|
|
63566
|
+
if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
|
|
63567
|
+
target = getNormalizedType(candidate, /*writing*/ true);
|
|
63568
|
+
if (source === target)
|
|
63569
|
+
return -1 /* True */;
|
|
63570
|
+
}
|
|
63566
63571
|
}
|
|
63567
63572
|
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
|
|
63568
63573
|
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
|
|
63569
63574
|
return -1 /* True */;
|
|
63570
|
-
|
|
63571
|
-
|
|
63572
|
-
|
|
63573
|
-
|
|
63575
|
+
if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
63576
|
+
var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
|
|
63577
|
+
if (isPerformingExcessPropertyChecks) {
|
|
63578
|
+
if (hasExcessProperties(source, target, reportErrors)) {
|
|
63579
|
+
if (reportErrors) {
|
|
63580
|
+
reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
|
|
63581
|
+
}
|
|
63582
|
+
return 0 /* False */;
|
|
63583
|
+
}
|
|
63584
|
+
}
|
|
63585
|
+
var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
|
|
63586
|
+
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
63587
|
+
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
63588
|
+
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
|
|
63589
|
+
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
|
|
63590
|
+
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
|
|
63574
63591
|
if (reportErrors) {
|
|
63575
|
-
|
|
63592
|
+
var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
|
|
63593
|
+
var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
|
|
63594
|
+
var calls = getSignaturesOfType(source, 0 /* Call */);
|
|
63595
|
+
var constructs = getSignaturesOfType(source, 1 /* Construct */);
|
|
63596
|
+
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
|
|
63597
|
+
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
|
|
63598
|
+
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
63599
|
+
}
|
|
63600
|
+
else {
|
|
63601
|
+
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
63602
|
+
}
|
|
63576
63603
|
}
|
|
63577
63604
|
return 0 /* False */;
|
|
63578
63605
|
}
|
|
63579
|
-
|
|
63580
|
-
|
|
63581
|
-
|
|
63582
|
-
|
|
63583
|
-
|
|
63584
|
-
|
|
63585
|
-
|
|
63586
|
-
|
|
63587
|
-
|
|
63588
|
-
|
|
63589
|
-
|
|
63590
|
-
|
|
63591
|
-
|
|
63592
|
-
|
|
63593
|
-
|
|
63594
|
-
|
|
63595
|
-
|
|
63596
|
-
|
|
63606
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63607
|
+
var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
|
|
63608
|
+
target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
|
|
63609
|
+
var result_7 = skipCaching ?
|
|
63610
|
+
unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
|
|
63611
|
+
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
|
|
63612
|
+
// For certain combinations involving intersections and optional, excess, or mismatched properties we need
|
|
63613
|
+
// an extra property check where the intersection is viewed as a single object. The following are motivating
|
|
63614
|
+
// examples that all should be errors, but aren't without this extra property check:
|
|
63615
|
+
//
|
|
63616
|
+
// let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
|
|
63617
|
+
//
|
|
63618
|
+
// declare let wrong: { a: { y: string } };
|
|
63619
|
+
// let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
|
|
63620
|
+
//
|
|
63621
|
+
// function foo<T extends object>(x: { a?: string }, y: T & { a: boolean }) {
|
|
63622
|
+
// x = y; // Mismatched property in source intersection
|
|
63623
|
+
// }
|
|
63624
|
+
//
|
|
63625
|
+
// We suppress recursive intersection property checks because they can generate lots of work when relating
|
|
63626
|
+
// recursive intersections that are structurally similar but not exactly identical. See #37854.
|
|
63627
|
+
if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
63628
|
+
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
|
|
63629
|
+
inPropertyCheck = true;
|
|
63630
|
+
result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
|
|
63631
|
+
inPropertyCheck = false;
|
|
63632
|
+
}
|
|
63633
|
+
if (result_7) {
|
|
63634
|
+
return result_7;
|
|
63597
63635
|
}
|
|
63598
|
-
return 0 /* False */;
|
|
63599
|
-
}
|
|
63600
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63601
|
-
var result = 0 /* False */;
|
|
63602
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
63603
|
-
if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
63604
|
-
// We skip caching when source or target is a union with no more than three constituents.
|
|
63605
|
-
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63606
63636
|
}
|
|
63607
|
-
|
|
63608
|
-
|
|
63637
|
+
if (reportErrors) {
|
|
63638
|
+
reportErrorResults(originalSource, originalTarget, source, target, headMessage);
|
|
63609
63639
|
}
|
|
63610
|
-
|
|
63611
|
-
|
|
63612
|
-
|
|
63640
|
+
return 0 /* False */;
|
|
63641
|
+
}
|
|
63642
|
+
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
63643
|
+
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
63644
|
+
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
63645
|
+
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
63646
|
+
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
63647
|
+
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
63648
|
+
if (maybeSuppress) {
|
|
63649
|
+
overrideNextErrorInfo--;
|
|
63650
|
+
}
|
|
63651
|
+
if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
|
|
63652
|
+
var currentError = errorInfo;
|
|
63653
|
+
tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
|
|
63654
|
+
if (errorInfo !== currentError) {
|
|
63655
|
+
maybeSuppress = !!errorInfo;
|
|
63656
|
+
}
|
|
63657
|
+
}
|
|
63658
|
+
if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
|
|
63659
|
+
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
63660
|
+
}
|
|
63661
|
+
else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
|
|
63662
|
+
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
63663
|
+
}
|
|
63664
|
+
else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
|
|
63665
|
+
var targetTypes = target.types;
|
|
63666
|
+
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
63667
|
+
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
63668
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
63669
|
+
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
63670
|
+
// do not report top error
|
|
63671
|
+
return;
|
|
63613
63672
|
}
|
|
63614
63673
|
}
|
|
63615
|
-
|
|
63616
|
-
|
|
63617
|
-
// the constituents. When an intersection type contains instantiable types with union type
|
|
63618
|
-
// constraints, there are situations where we need to examine the combined constraint. One is
|
|
63619
|
-
// when the target is a union type. Another is when the intersection contains types belonging
|
|
63620
|
-
// to one of the disjoint domains. For example, given type variables T and U, each with the
|
|
63621
|
-
// constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
|
|
63622
|
-
// we need to check this constraint against a union on the target side. Also, given a type
|
|
63623
|
-
// variable V constrained to 'string | number', 'V & number' has a combined constraint of
|
|
63624
|
-
// 'string & number | number & number' which reduces to just 'number'.
|
|
63625
|
-
// This also handles type parameters, as a type parameter with a union constraint compared against a union
|
|
63626
|
-
// needs to have its constraint hoisted into an intersection with said type parameter, this way
|
|
63627
|
-
// the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
|
|
63628
|
-
// For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
|
|
63629
|
-
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
|
|
63630
|
-
if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
|
|
63631
|
-
if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
|
|
63632
|
-
// TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
|
|
63633
|
-
if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
63634
|
-
resetErrorInfo(saveErrorInfo);
|
|
63635
|
-
}
|
|
63636
|
-
}
|
|
63637
|
-
}
|
|
63674
|
+
else {
|
|
63675
|
+
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
63638
63676
|
}
|
|
63639
|
-
|
|
63640
|
-
|
|
63641
|
-
|
|
63642
|
-
|
|
63643
|
-
// let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
|
|
63644
|
-
//
|
|
63645
|
-
// declare let wrong: { a: { y: string } };
|
|
63646
|
-
// let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
|
|
63647
|
-
//
|
|
63648
|
-
// function foo<T extends object>(x: { a?: string }, y: T & { a: boolean }) {
|
|
63649
|
-
// x = y; // Mismatched property in source intersection
|
|
63650
|
-
// }
|
|
63651
|
-
//
|
|
63652
|
-
// We suppress recursive intersection property checks because they can generate lots of work when relating
|
|
63653
|
-
// recursive intersections that are structurally similar but not exactly identical. See #37854.
|
|
63654
|
-
if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
63655
|
-
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
|
|
63656
|
-
inPropertyCheck = true;
|
|
63657
|
-
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
|
|
63658
|
-
inPropertyCheck = false;
|
|
63659
|
-
}
|
|
63660
|
-
reportErrorResults(source, target, result, isComparingJsxAttributes);
|
|
63661
|
-
return result;
|
|
63662
|
-
function reportErrorResults(source, target, result, isComparingJsxAttributes) {
|
|
63663
|
-
if (!result && reportErrors) {
|
|
63664
|
-
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
63665
|
-
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
63666
|
-
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
63667
|
-
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
63668
|
-
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
63669
|
-
if (maybeSuppress) {
|
|
63670
|
-
overrideNextErrorInfo--;
|
|
63671
|
-
}
|
|
63672
|
-
if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
|
|
63673
|
-
var currentError = errorInfo;
|
|
63674
|
-
tryElaborateArrayLikeErrors(source, target, reportErrors);
|
|
63675
|
-
if (errorInfo !== currentError) {
|
|
63676
|
-
maybeSuppress = !!errorInfo;
|
|
63677
|
-
}
|
|
63678
|
-
}
|
|
63679
|
-
if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
|
|
63680
|
-
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
63681
|
-
}
|
|
63682
|
-
else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
|
|
63683
|
-
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
63684
|
-
}
|
|
63685
|
-
else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
|
|
63686
|
-
var targetTypes = target.types;
|
|
63687
|
-
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
63688
|
-
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
63689
|
-
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
63690
|
-
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
63691
|
-
// do not report top error
|
|
63692
|
-
return result;
|
|
63693
|
-
}
|
|
63694
|
-
}
|
|
63695
|
-
else {
|
|
63696
|
-
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
63697
|
-
}
|
|
63698
|
-
if (!headMessage && maybeSuppress) {
|
|
63699
|
-
lastSkippedInfo = [source, target];
|
|
63700
|
-
// Used by, eg, missing property checking to replace the top-level message with a more informative one
|
|
63701
|
-
return result;
|
|
63702
|
-
}
|
|
63703
|
-
reportRelationError(headMessage, source, target);
|
|
63704
|
-
}
|
|
63677
|
+
if (!headMessage && maybeSuppress) {
|
|
63678
|
+
lastSkippedInfo = [source, target];
|
|
63679
|
+
// Used by, eg, missing property checking to replace the top-level message with a more informative one
|
|
63680
|
+
return;
|
|
63705
63681
|
}
|
|
63682
|
+
reportRelationError(headMessage, source, target);
|
|
63706
63683
|
}
|
|
63707
63684
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
63708
63685
|
if (!ts.tracing) {
|
|
@@ -63729,21 +63706,6 @@ var ts;
|
|
|
63729
63706
|
}
|
|
63730
63707
|
}
|
|
63731
63708
|
}
|
|
63732
|
-
function isIdenticalTo(source, target, recursionFlags) {
|
|
63733
|
-
if (source.flags !== target.flags)
|
|
63734
|
-
return 0 /* False */;
|
|
63735
|
-
if (source.flags & 67358815 /* Singleton */)
|
|
63736
|
-
return -1 /* True */;
|
|
63737
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63738
|
-
if (source.flags & 3145728 /* UnionOrIntersection */) {
|
|
63739
|
-
var result_7 = eachTypeRelatedToSomeType(source, target);
|
|
63740
|
-
if (result_7) {
|
|
63741
|
-
result_7 &= eachTypeRelatedToSomeType(target, source);
|
|
63742
|
-
}
|
|
63743
|
-
return result_7;
|
|
63744
|
-
}
|
|
63745
|
-
return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
|
|
63746
|
-
}
|
|
63747
63709
|
function getTypeOfPropertyInTypes(types, name) {
|
|
63748
63710
|
var appendPropType = function (propTypes, type) {
|
|
63749
63711
|
var _a;
|
|
@@ -63842,6 +63804,41 @@ var ts;
|
|
|
63842
63804
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
63843
63805
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
63844
63806
|
}
|
|
63807
|
+
function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
|
|
63808
|
+
// Note that these checks are specifically ordered to produce correct results. In particular,
|
|
63809
|
+
// we need to deconstruct unions before intersections (because unions are always at the top),
|
|
63810
|
+
// and we need to handle "each" relations before "some" relations for the same kind of type.
|
|
63811
|
+
if (source.flags & 1048576 /* Union */) {
|
|
63812
|
+
return relation === comparableRelation ?
|
|
63813
|
+
someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
|
|
63814
|
+
eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
|
|
63815
|
+
}
|
|
63816
|
+
if (target.flags & 1048576 /* Union */) {
|
|
63817
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
|
|
63818
|
+
}
|
|
63819
|
+
if (target.flags & 2097152 /* Intersection */) {
|
|
63820
|
+
return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
|
|
63821
|
+
}
|
|
63822
|
+
// Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
|
|
63823
|
+
// constraints of all non-primitive types in the source into a new intersection. We do this because the
|
|
63824
|
+
// intersection may further constrain the constraints of the non-primitive types. For example, given a type
|
|
63825
|
+
// parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
|
|
63826
|
+
// appear to be comparable to '2'.
|
|
63827
|
+
if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
|
|
63828
|
+
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
63829
|
+
if (constraints !== source.types) {
|
|
63830
|
+
source = getIntersectionType(constraints);
|
|
63831
|
+
if (!(source.flags & 2097152 /* Intersection */)) {
|
|
63832
|
+
return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
|
|
63833
|
+
}
|
|
63834
|
+
}
|
|
63835
|
+
}
|
|
63836
|
+
// Check to see if any constituents of the intersection are immediately related to the target.
|
|
63837
|
+
// Don't report errors though. Elaborating on whether a source constituent is related to the target is
|
|
63838
|
+
// not actually useful and leads to some confusing error messages. Instead, we rely on the caller
|
|
63839
|
+
// checking whether the full intersection viewed as an object is related to the target.
|
|
63840
|
+
return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
|
|
63841
|
+
}
|
|
63845
63842
|
function eachTypeRelatedToSomeType(source, target) {
|
|
63846
63843
|
var result = -1 /* True */;
|
|
63847
63844
|
var sourceTypes = source.types;
|
|
@@ -63877,8 +63874,11 @@ var ts;
|
|
|
63877
63874
|
}
|
|
63878
63875
|
}
|
|
63879
63876
|
if (reportErrors) {
|
|
63877
|
+
// Elaborate only if we can find a best matching type in the target union
|
|
63880
63878
|
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
|
|
63881
|
-
|
|
63879
|
+
if (bestMatchingType) {
|
|
63880
|
+
isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
|
|
63881
|
+
}
|
|
63882
63882
|
}
|
|
63883
63883
|
return 0 /* False */;
|
|
63884
63884
|
}
|
|
@@ -64014,7 +64014,7 @@ var ts;
|
|
|
64014
64014
|
if (overflow) {
|
|
64015
64015
|
return 0 /* False */;
|
|
64016
64016
|
}
|
|
64017
|
-
var keyIntersectionState = intersectionState | (inPropertyCheck ?
|
|
64017
|
+
var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
|
|
64018
64018
|
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
|
|
64019
64019
|
var entry = relation.get(id);
|
|
64020
64020
|
if (entry !== undefined) {
|
|
@@ -64082,6 +64082,7 @@ var ts;
|
|
|
64082
64082
|
return originalHandler(onlyUnreliable);
|
|
64083
64083
|
};
|
|
64084
64084
|
}
|
|
64085
|
+
var result;
|
|
64085
64086
|
if (expandingFlags === 3 /* Both */) {
|
|
64086
64087
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
|
|
64087
64088
|
sourceId: source.id,
|
|
@@ -64091,8 +64092,13 @@ var ts;
|
|
|
64091
64092
|
depth: sourceDepth,
|
|
64092
64093
|
targetDepth: targetDepth
|
|
64093
64094
|
});
|
|
64095
|
+
result = 3 /* Maybe */;
|
|
64096
|
+
}
|
|
64097
|
+
else {
|
|
64098
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
64099
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
|
64100
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
64094
64101
|
}
|
|
64095
|
-
var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
|
|
64096
64102
|
if (outofbandVarianceMarkerHandler) {
|
|
64097
64103
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
64098
64104
|
}
|
|
@@ -64124,98 +64130,97 @@ var ts;
|
|
|
64124
64130
|
return result;
|
|
64125
64131
|
}
|
|
64126
64132
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
64127
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
64128
|
-
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
|
|
64129
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
64130
|
-
return result;
|
|
64131
|
-
}
|
|
64132
|
-
function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
|
|
64133
64133
|
if (intersectionState & 4 /* PropertyCheck */) {
|
|
64134
64134
|
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
|
|
64135
64135
|
}
|
|
64136
|
-
|
|
64137
|
-
|
|
64138
|
-
|
|
64139
|
-
|
|
64140
|
-
|
|
64141
|
-
|
|
64142
|
-
|
|
64143
|
-
|
|
64144
|
-
|
|
64145
|
-
|
|
64146
|
-
|
|
64147
|
-
|
|
64148
|
-
if (target.flags & 2097152 /* Intersection */) {
|
|
64149
|
-
return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
|
|
64150
|
-
}
|
|
64151
|
-
// Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
|
|
64152
|
-
// constraints of all non-primitive types in the source into a new intersection. We do this because the
|
|
64153
|
-
// intersection may further constrain the constraints of the non-primitive types. For example, given a type
|
|
64154
|
-
// parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
|
|
64155
|
-
// appear to be comparable to '2'.
|
|
64156
|
-
if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
|
|
64157
|
-
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
64158
|
-
if (constraints !== source.types) {
|
|
64159
|
-
source = getIntersectionType(constraints);
|
|
64160
|
-
if (!(source.flags & 2097152 /* Intersection */)) {
|
|
64161
|
-
return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
|
|
64162
|
-
}
|
|
64136
|
+
var result;
|
|
64137
|
+
var originalErrorInfo;
|
|
64138
|
+
var varianceCheckFailed = false;
|
|
64139
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
64140
|
+
var sourceFlags = source.flags;
|
|
64141
|
+
var targetFlags = target.flags;
|
|
64142
|
+
if (relation === identityRelation) {
|
|
64143
|
+
// We've already checked that source.flags and target.flags are identical
|
|
64144
|
+
if (sourceFlags & 3145728 /* UnionOrIntersection */) {
|
|
64145
|
+
var result_8 = eachTypeRelatedToSomeType(source, target);
|
|
64146
|
+
if (result_8) {
|
|
64147
|
+
result_8 &= eachTypeRelatedToSomeType(target, source);
|
|
64163
64148
|
}
|
|
64149
|
+
return result_8;
|
|
64164
64150
|
}
|
|
64165
|
-
|
|
64166
|
-
//
|
|
64167
|
-
// Don't report errors though. Checking whether a constituent is related to the source is not actually
|
|
64168
|
-
// useful and leads to some confusing error messages. Instead it is better to let the below checks
|
|
64169
|
-
// take care of this, or to not elaborate at all. For instance,
|
|
64170
|
-
//
|
|
64171
|
-
// - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
|
|
64172
|
-
//
|
|
64173
|
-
// - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
|
|
64174
|
-
// than to report that 'D' is not assignable to 'A' or 'B'.
|
|
64175
|
-
//
|
|
64176
|
-
// - For a primitive type or type parameter (such as 'number = A & B') there is no point in
|
|
64177
|
-
// breaking the intersection apart.
|
|
64178
|
-
return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
|
|
64179
|
-
}
|
|
64180
|
-
var flags = source.flags & target.flags;
|
|
64181
|
-
if (relation === identityRelation && !(flags & 524288 /* Object */)) {
|
|
64182
|
-
if (flags & 4194304 /* Index */) {
|
|
64151
|
+
if (sourceFlags & 4194304 /* Index */) {
|
|
64183
64152
|
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
|
|
64184
64153
|
}
|
|
64185
|
-
|
|
64186
|
-
|
|
64187
|
-
|
|
64188
|
-
|
|
64189
|
-
return result_8;
|
|
64154
|
+
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
64155
|
+
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
|
|
64156
|
+
if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
|
|
64157
|
+
return result;
|
|
64190
64158
|
}
|
|
64191
64159
|
}
|
|
64192
64160
|
}
|
|
64193
|
-
if (
|
|
64161
|
+
if (sourceFlags & 16777216 /* Conditional */) {
|
|
64194
64162
|
if (source.root.isDistributive === target.root.isDistributive) {
|
|
64195
|
-
if (
|
|
64196
|
-
if (
|
|
64197
|
-
if (
|
|
64198
|
-
if (
|
|
64199
|
-
return
|
|
64163
|
+
if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
|
|
64164
|
+
if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
|
|
64165
|
+
if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
|
|
64166
|
+
if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
|
|
64167
|
+
return result;
|
|
64200
64168
|
}
|
|
64201
64169
|
}
|
|
64202
64170
|
}
|
|
64203
64171
|
}
|
|
64204
64172
|
}
|
|
64205
64173
|
}
|
|
64206
|
-
if (
|
|
64174
|
+
if (sourceFlags & 33554432 /* Substitution */) {
|
|
64207
64175
|
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
|
|
64208
64176
|
}
|
|
64209
|
-
|
|
64177
|
+
if (!(sourceFlags & 524288 /* Object */)) {
|
|
64178
|
+
return 0 /* False */;
|
|
64179
|
+
}
|
|
64180
|
+
}
|
|
64181
|
+
else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
|
|
64182
|
+
if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
64183
|
+
return result;
|
|
64184
|
+
}
|
|
64185
|
+
if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
|
|
64186
|
+
// The combined constraint of an intersection type is the intersection of the constraints of
|
|
64187
|
+
// the constituents. When an intersection type contains instantiable types with union type
|
|
64188
|
+
// constraints, there are situations where we need to examine the combined constraint. One is
|
|
64189
|
+
// when the target is a union type. Another is when the intersection contains types belonging
|
|
64190
|
+
// to one of the disjoint domains. For example, given type variables T and U, each with the
|
|
64191
|
+
// constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
|
|
64192
|
+
// we need to check this constraint against a union on the target side. Also, given a type
|
|
64193
|
+
// variable V constrained to 'string | number', 'V & number' has a combined constraint of
|
|
64194
|
+
// 'string & number | number & number' which reduces to just 'number'.
|
|
64195
|
+
// This also handles type parameters, as a type parameter with a union constraint compared against a union
|
|
64196
|
+
// needs to have its constraint hoisted into an intersection with said type parameter, this way
|
|
64197
|
+
// the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
|
|
64198
|
+
// For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
|
|
64199
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
|
|
64200
|
+
if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
|
|
64201
|
+
// TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
|
|
64202
|
+
if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
64203
|
+
resetErrorInfo(saveErrorInfo);
|
|
64204
|
+
return result;
|
|
64205
|
+
}
|
|
64206
|
+
}
|
|
64207
|
+
}
|
|
64208
|
+
// The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
|
|
64209
|
+
// Source is instantiable (e.g. source has union or intersection constraint).
|
|
64210
|
+
// Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
|
|
64211
|
+
// Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
|
|
64212
|
+
// Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
|
|
64213
|
+
// Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
|
|
64214
|
+
if (!(sourceFlags & 465829888 /* Instantiable */ ||
|
|
64215
|
+
sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
|
|
64216
|
+
sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
|
|
64217
|
+
return 0 /* False */;
|
|
64218
|
+
}
|
|
64210
64219
|
}
|
|
64211
|
-
var result;
|
|
64212
|
-
var originalErrorInfo;
|
|
64213
|
-
var varianceCheckFailed = false;
|
|
64214
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
64215
64220
|
// We limit alias variance probing to only object and conditional types since their alias behavior
|
|
64216
64221
|
// is more predictable than other, interned types, which may or may not have an alias depending on
|
|
64217
64222
|
// the order in which things were checked.
|
|
64218
|
-
if (
|
|
64223
|
+
if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
|
|
64219
64224
|
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
|
|
64220
64225
|
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
|
|
64221
64226
|
var variances = getAliasVariances(source.aliasSymbol);
|
|
@@ -64233,7 +64238,7 @@ var ts;
|
|
|
64233
64238
|
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
|
|
64234
64239
|
return result;
|
|
64235
64240
|
}
|
|
64236
|
-
if (
|
|
64241
|
+
if (targetFlags & 262144 /* TypeParameter */) {
|
|
64237
64242
|
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
|
|
64238
64243
|
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
|
|
64239
64244
|
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
|
|
@@ -64245,10 +64250,10 @@ var ts;
|
|
|
64245
64250
|
}
|
|
64246
64251
|
}
|
|
64247
64252
|
}
|
|
64248
|
-
else if (
|
|
64253
|
+
else if (targetFlags & 4194304 /* Index */) {
|
|
64249
64254
|
var targetType_1 = target.type;
|
|
64250
64255
|
// A keyof S is related to a keyof T if T is related to S.
|
|
64251
|
-
if (
|
|
64256
|
+
if (sourceFlags & 4194304 /* Index */) {
|
|
64252
64257
|
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
|
|
64253
64258
|
return result;
|
|
64254
64259
|
}
|
|
@@ -64299,8 +64304,8 @@ var ts;
|
|
|
64299
64304
|
}
|
|
64300
64305
|
}
|
|
64301
64306
|
}
|
|
64302
|
-
else if (
|
|
64303
|
-
if (
|
|
64307
|
+
else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
64308
|
+
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
64304
64309
|
// Relate components directly before falling back to constraint relationships
|
|
64305
64310
|
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
|
|
64306
64311
|
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
|
|
@@ -64406,7 +64411,7 @@ var ts;
|
|
|
64406
64411
|
}
|
|
64407
64412
|
}
|
|
64408
64413
|
}
|
|
64409
|
-
else if (
|
|
64414
|
+
else if (targetFlags & 16777216 /* Conditional */) {
|
|
64410
64415
|
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
|
|
64411
64416
|
// conditional type and bail out with a Ternary.Maybe result.
|
|
64412
64417
|
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
|
|
@@ -64431,8 +64436,8 @@ var ts;
|
|
|
64431
64436
|
}
|
|
64432
64437
|
}
|
|
64433
64438
|
}
|
|
64434
|
-
else if (
|
|
64435
|
-
if (
|
|
64439
|
+
else if (targetFlags & 134217728 /* TemplateLiteral */) {
|
|
64440
|
+
if (sourceFlags & 134217728 /* TemplateLiteral */) {
|
|
64436
64441
|
if (relation === comparableRelation) {
|
|
64437
64442
|
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
|
|
64438
64443
|
}
|
|
@@ -64444,11 +64449,11 @@ var ts;
|
|
|
64444
64449
|
return -1 /* True */;
|
|
64445
64450
|
}
|
|
64446
64451
|
}
|
|
64447
|
-
if (
|
|
64448
|
-
// IndexedAccess comparisons are handled above in the `
|
|
64449
|
-
if (!(
|
|
64452
|
+
if (sourceFlags & 8650752 /* TypeVariable */) {
|
|
64453
|
+
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
64454
|
+
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
64450
64455
|
var constraint = getConstraintOfType(source);
|
|
64451
|
-
if (!constraint || (
|
|
64456
|
+
if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
|
|
64452
64457
|
// A type variable with no constraint is not related to the non-primitive object type.
|
|
64453
64458
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
|
|
64454
64459
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -64461,7 +64466,7 @@ var ts;
|
|
|
64461
64466
|
return result;
|
|
64462
64467
|
}
|
|
64463
64468
|
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
|
|
64464
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(
|
|
64469
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
64465
64470
|
resetErrorInfo(saveErrorInfo);
|
|
64466
64471
|
return result;
|
|
64467
64472
|
}
|
|
@@ -64478,14 +64483,14 @@ var ts;
|
|
|
64478
64483
|
}
|
|
64479
64484
|
}
|
|
64480
64485
|
}
|
|
64481
|
-
else if (
|
|
64486
|
+
else if (sourceFlags & 4194304 /* Index */) {
|
|
64482
64487
|
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
|
|
64483
64488
|
resetErrorInfo(saveErrorInfo);
|
|
64484
64489
|
return result;
|
|
64485
64490
|
}
|
|
64486
64491
|
}
|
|
64487
|
-
else if (
|
|
64488
|
-
if (!(
|
|
64492
|
+
else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
|
|
64493
|
+
if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
|
|
64489
64494
|
var constraint = getBaseConstraintOfType(source);
|
|
64490
64495
|
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
|
|
64491
64496
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -64493,8 +64498,8 @@ var ts;
|
|
|
64493
64498
|
}
|
|
64494
64499
|
}
|
|
64495
64500
|
}
|
|
64496
|
-
else if (
|
|
64497
|
-
if (
|
|
64501
|
+
else if (sourceFlags & 268435456 /* StringMapping */) {
|
|
64502
|
+
if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
|
|
64498
64503
|
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
|
|
64499
64504
|
resetErrorInfo(saveErrorInfo);
|
|
64500
64505
|
return result;
|
|
@@ -64508,14 +64513,14 @@ var ts;
|
|
|
64508
64513
|
}
|
|
64509
64514
|
}
|
|
64510
64515
|
}
|
|
64511
|
-
else if (
|
|
64516
|
+
else if (sourceFlags & 16777216 /* Conditional */) {
|
|
64512
64517
|
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
|
|
64513
64518
|
// conditional type and bail out with a Ternary.Maybe result.
|
|
64514
64519
|
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
|
|
64515
64520
|
resetErrorInfo(saveErrorInfo);
|
|
64516
64521
|
return 3 /* Maybe */;
|
|
64517
64522
|
}
|
|
64518
|
-
if (
|
|
64523
|
+
if (targetFlags & 16777216 /* Conditional */) {
|
|
64519
64524
|
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
|
|
64520
64525
|
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
|
|
64521
64526
|
// and Y1 is related to Y2.
|
|
@@ -64575,9 +64580,10 @@ var ts;
|
|
|
64575
64580
|
}
|
|
64576
64581
|
return 0 /* False */;
|
|
64577
64582
|
}
|
|
64578
|
-
var sourceIsPrimitive = !!(
|
|
64583
|
+
var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
|
|
64579
64584
|
if (relation !== identityRelation) {
|
|
64580
64585
|
source = getApparentType(source);
|
|
64586
|
+
sourceFlags = source.flags;
|
|
64581
64587
|
}
|
|
64582
64588
|
else if (isGenericMappedType(source)) {
|
|
64583
64589
|
return 0 /* False */;
|
|
@@ -64619,7 +64625,7 @@ var ts;
|
|
|
64619
64625
|
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
|
|
64620
64626
|
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
|
|
64621
64627
|
// relates to X. Thus, we include intersection types on the source side here.
|
|
64622
|
-
if (
|
|
64628
|
+
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
64623
64629
|
// Report structural errors only if we haven't reported any errors yet
|
|
64624
64630
|
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
|
|
64625
64631
|
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
|
|
@@ -64643,7 +64649,7 @@ var ts;
|
|
|
64643
64649
|
// there exists a constituent of T for every combination of the discriminants of S
|
|
64644
64650
|
// with respect to T. We do not report errors here, as we will use the existing
|
|
64645
64651
|
// error result from checking each constituent of the union.
|
|
64646
|
-
if (
|
|
64652
|
+
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
|
|
64647
64653
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
|
|
64648
64654
|
if (objectOnlyTarget.flags & 1048576 /* Union */) {
|
|
64649
64655
|
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
@@ -65158,7 +65164,6 @@ var ts;
|
|
|
65158
65164
|
}
|
|
65159
65165
|
}
|
|
65160
65166
|
var result = -1 /* True */;
|
|
65161
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
65162
65167
|
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
65163
65168
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
65164
65169
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
@@ -65199,6 +65204,7 @@ var ts;
|
|
|
65199
65204
|
else {
|
|
65200
65205
|
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
|
|
65201
65206
|
var t = targetSignatures_1[_i];
|
|
65207
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
65202
65208
|
// Only elaborate errors from the first failure
|
|
65203
65209
|
var shouldElaborateErrors = reportErrors;
|
|
65204
65210
|
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
|
|
@@ -65572,7 +65578,7 @@ var ts;
|
|
|
65572
65578
|
var constraintMarker = "";
|
|
65573
65579
|
var sourceId = getTypeReferenceId(source, 0);
|
|
65574
65580
|
var targetId = getTypeReferenceId(target, 0);
|
|
65575
|
-
return ""
|
|
65581
|
+
return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
|
|
65576
65582
|
// getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
|
|
65577
65583
|
// where A.id=111 and number.id=12
|
|
65578
65584
|
function getTypeReferenceId(type, depth) {
|
|
@@ -65616,7 +65622,7 @@ var ts;
|
|
|
65616
65622
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
65617
65623
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
65618
65624
|
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
65619
|
-
source.id
|
|
65625
|
+
"".concat(source.id, ",").concat(target.id).concat(postFix);
|
|
65620
65626
|
}
|
|
65621
65627
|
// Invoke the callback for each underlying property symbol of the given symbol and return the first
|
|
65622
65628
|
// value that isn't undefined.
|
|
@@ -67743,11 +67749,11 @@ var ts;
|
|
|
67743
67749
|
case 79 /* Identifier */:
|
|
67744
67750
|
if (!ts.isThisInTypeQuery(node)) {
|
|
67745
67751
|
var symbol = getResolvedSymbol(node);
|
|
67746
|
-
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1"
|
|
67752
|
+
return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
|
|
67747
67753
|
}
|
|
67748
67754
|
// falls through
|
|
67749
67755
|
case 108 /* ThisKeyword */:
|
|
67750
|
-
return "0|"
|
|
67756
|
+
return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
|
|
67751
67757
|
case 229 /* NonNullExpression */:
|
|
67752
67758
|
case 211 /* ParenthesizedExpression */:
|
|
67753
67759
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -68369,9 +68375,6 @@ var ts;
|
|
|
68369
68375
|
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
|
|
68370
68376
|
mapType(type, mapper);
|
|
68371
68377
|
}
|
|
68372
|
-
function getConstituentCount(type) {
|
|
68373
|
-
return type.flags & 1048576 /* Union */ ? type.types.length : 1;
|
|
68374
|
-
}
|
|
68375
68378
|
function extractTypesOfKind(type, kind) {
|
|
68376
68379
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
68377
68380
|
}
|
|
@@ -69945,7 +69948,7 @@ var ts;
|
|
|
69945
69948
|
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
|
|
69946
69949
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
69947
69950
|
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
69948
|
-
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */
|
|
69951
|
+
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
|
|
69949
69952
|
}
|
|
69950
69953
|
function isExportOrExportExpression(location) {
|
|
69951
69954
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -70017,6 +70020,9 @@ var ts;
|
|
|
70017
70020
|
if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
70018
70021
|
var pattern = declaration.parent;
|
|
70019
70022
|
var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
|
|
70023
|
+
if (narrowedType.flags & 131072 /* Never */) {
|
|
70024
|
+
return neverType;
|
|
70025
|
+
}
|
|
70020
70026
|
return getBindingElementTypeFromParentType(declaration, narrowedType);
|
|
70021
70027
|
}
|
|
70022
70028
|
}
|
|
@@ -71636,7 +71642,7 @@ var ts;
|
|
|
71636
71642
|
!leftName ? rightName :
|
|
71637
71643
|
!rightName ? leftName :
|
|
71638
71644
|
undefined;
|
|
71639
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
71645
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
71640
71646
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
71641
71647
|
params[i] = paramSymbol;
|
|
71642
71648
|
}
|
|
@@ -76037,21 +76043,22 @@ var ts;
|
|
|
76037
76043
|
if (links.type === unknownType) {
|
|
76038
76044
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
76039
76045
|
}
|
|
76040
|
-
assignBindingElementTypes(declaration.name);
|
|
76046
|
+
assignBindingElementTypes(declaration.name, links.type);
|
|
76041
76047
|
}
|
|
76042
76048
|
}
|
|
76043
76049
|
}
|
|
76044
76050
|
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
|
|
76045
76051
|
// the destructured type into the contained binding elements.
|
|
76046
|
-
function assignBindingElementTypes(pattern) {
|
|
76052
|
+
function assignBindingElementTypes(pattern, parentType) {
|
|
76047
76053
|
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
|
|
76048
76054
|
var element = _a[_i];
|
|
76049
76055
|
if (!ts.isOmittedExpression(element)) {
|
|
76056
|
+
var type = getBindingElementTypeFromParentType(element, parentType);
|
|
76050
76057
|
if (element.name.kind === 79 /* Identifier */) {
|
|
76051
|
-
getSymbolLinks(getSymbolOfNode(element)).type =
|
|
76058
|
+
getSymbolLinks(getSymbolOfNode(element)).type = type;
|
|
76052
76059
|
}
|
|
76053
76060
|
else {
|
|
76054
|
-
assignBindingElementTypes(element.name);
|
|
76061
|
+
assignBindingElementTypes(element.name, type);
|
|
76055
76062
|
}
|
|
76056
76063
|
}
|
|
76057
76064
|
}
|
|
@@ -79792,28 +79799,24 @@ var ts;
|
|
|
79792
79799
|
if (returnType.flags & 1 /* Any */) {
|
|
79793
79800
|
return;
|
|
79794
79801
|
}
|
|
79802
|
+
var headMessage;
|
|
79795
79803
|
var expectedReturnType;
|
|
79796
|
-
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
|
|
79797
|
-
var errorInfo;
|
|
79798
79804
|
switch (node.parent.kind) {
|
|
79799
79805
|
case 256 /* ClassDeclaration */:
|
|
79806
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
79800
79807
|
var classSymbol = getSymbolOfNode(node.parent);
|
|
79801
79808
|
var classConstructorType = getTypeOfSymbol(classSymbol);
|
|
79802
79809
|
expectedReturnType = getUnionType([classConstructorType, voidType]);
|
|
79803
79810
|
break;
|
|
79804
|
-
case 163 /* Parameter */:
|
|
79805
|
-
expectedReturnType = voidType;
|
|
79806
|
-
errorInfo = ts.chainDiagnosticMessages(
|
|
79807
|
-
/*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
|
|
79808
|
-
break;
|
|
79809
79811
|
case 166 /* PropertyDeclaration */:
|
|
79812
|
+
case 163 /* Parameter */:
|
|
79813
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
|
|
79810
79814
|
expectedReturnType = voidType;
|
|
79811
|
-
errorInfo = ts.chainDiagnosticMessages(
|
|
79812
|
-
/*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
|
|
79813
79815
|
break;
|
|
79814
79816
|
case 168 /* MethodDeclaration */:
|
|
79815
79817
|
case 171 /* GetAccessor */:
|
|
79816
79818
|
case 172 /* SetAccessor */:
|
|
79819
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
79817
79820
|
var methodType = getTypeOfNode(node.parent);
|
|
79818
79821
|
var descriptorType = createTypedPropertyDescriptorType(methodType);
|
|
79819
79822
|
expectedReturnType = getUnionType([descriptorType, voidType]);
|
|
@@ -79821,7 +79824,7 @@ var ts;
|
|
|
79821
79824
|
default:
|
|
79822
79825
|
return ts.Debug.fail();
|
|
79823
79826
|
}
|
|
79824
|
-
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage
|
|
79827
|
+
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
|
|
79825
79828
|
}
|
|
79826
79829
|
/**
|
|
79827
79830
|
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
|
|
@@ -81503,7 +81506,7 @@ var ts;
|
|
|
81503
81506
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
81504
81507
|
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
|
|
81505
81508
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
81506
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
81509
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
|
|
81507
81510
|
}
|
|
81508
81511
|
/**
|
|
81509
81512
|
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
|
|
@@ -82094,9 +82097,9 @@ var ts;
|
|
|
82094
82097
|
var containsArguments = containsArgumentsReference(node);
|
|
82095
82098
|
if (containsArguments) {
|
|
82096
82099
|
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
82097
|
-
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
82100
|
+
if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
82098
82101
|
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
82099
|
-
|
|
82102
|
+
error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
|
|
82100
82103
|
}
|
|
82101
82104
|
}
|
|
82102
82105
|
else {
|
|
@@ -82106,7 +82109,9 @@ var ts;
|
|
|
82106
82109
|
return;
|
|
82107
82110
|
}
|
|
82108
82111
|
if (ts.isQualifiedName(name)) {
|
|
82109
|
-
|
|
82112
|
+
if (isJs) {
|
|
82113
|
+
error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
|
|
82114
|
+
}
|
|
82110
82115
|
}
|
|
82111
82116
|
else {
|
|
82112
82117
|
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
@@ -87285,28 +87290,27 @@ var ts;
|
|
|
87285
87290
|
}
|
|
87286
87291
|
function findMostOverlappyType(source, unionTarget) {
|
|
87287
87292
|
var bestMatch;
|
|
87288
|
-
|
|
87289
|
-
|
|
87290
|
-
var
|
|
87291
|
-
|
|
87292
|
-
|
|
87293
|
-
|
|
87294
|
-
|
|
87295
|
-
|
|
87296
|
-
|
|
87297
|
-
|
|
87298
|
-
|
|
87299
|
-
|
|
87300
|
-
|
|
87301
|
-
|
|
87302
|
-
|
|
87303
|
-
|
|
87304
|
-
|
|
87305
|
-
|
|
87306
|
-
|
|
87307
|
-
|
|
87308
|
-
|
|
87309
|
-
matchingCount = 1;
|
|
87293
|
+
if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
|
|
87294
|
+
var matchingCount = 0;
|
|
87295
|
+
for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
|
|
87296
|
+
var target = _a[_i];
|
|
87297
|
+
if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
|
|
87298
|
+
var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
|
|
87299
|
+
if (overlap.flags & 4194304 /* Index */) {
|
|
87300
|
+
// perfect overlap of keys
|
|
87301
|
+
return target;
|
|
87302
|
+
}
|
|
87303
|
+
else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
|
|
87304
|
+
// We only want to account for literal types otherwise.
|
|
87305
|
+
// If we have a union of index types, it seems likely that we
|
|
87306
|
+
// needed to elaborate between two generic mapped types anyway.
|
|
87307
|
+
var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
|
|
87308
|
+
if (len >= matchingCount) {
|
|
87309
|
+
bestMatch = target;
|
|
87310
|
+
matchingCount = len;
|
|
87311
|
+
}
|
|
87312
|
+
}
|
|
87313
|
+
}
|
|
87310
87314
|
}
|
|
87311
87315
|
}
|
|
87312
87316
|
return bestMatch;
|
|
@@ -88555,7 +88559,7 @@ var ts;
|
|
|
88555
88559
|
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
|
|
88556
88560
|
value === 62 ? 43 /* plus */ :
|
|
88557
88561
|
value === 63 ? 47 /* slash */ :
|
|
88558
|
-
ts.Debug.fail(value
|
|
88562
|
+
ts.Debug.fail("".concat(value, ": not a base64 value"));
|
|
88559
88563
|
}
|
|
88560
88564
|
function base64FormatDecode(ch) {
|
|
88561
88565
|
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
|
|
@@ -88630,7 +88634,7 @@ var ts;
|
|
|
88630
88634
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
88631
88635
|
if (decoder.error !== undefined) {
|
|
88632
88636
|
if (host.log) {
|
|
88633
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
88637
|
+
host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
|
|
88634
88638
|
}
|
|
88635
88639
|
decodedMappings = ts.emptyArray;
|
|
88636
88640
|
}
|
|
@@ -92305,7 +92309,7 @@ var ts;
|
|
|
92305
92309
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
92306
92310
|
? ts.declarationNameToString(originalNode.name)
|
|
92307
92311
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92308
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " "
|
|
92312
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
|
|
92309
92313
|
}
|
|
92310
92314
|
return substitute;
|
|
92311
92315
|
}
|
|
@@ -93781,8 +93785,8 @@ var ts;
|
|
|
93781
93785
|
}
|
|
93782
93786
|
function createHoistedVariableForClass(name, node) {
|
|
93783
93787
|
var className = getPrivateIdentifierEnvironment().className;
|
|
93784
|
-
var prefix = className ? "_"
|
|
93785
|
-
var identifier = factory.createUniqueName(prefix
|
|
93788
|
+
var prefix = className ? "_".concat(className) : "";
|
|
93789
|
+
var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
|
|
93786
93790
|
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
|
|
93787
93791
|
addBlockScopedVariable(identifier);
|
|
93788
93792
|
}
|
|
@@ -95787,7 +95791,7 @@ var ts;
|
|
|
95787
95791
|
specifierSourceImports = new ts.Map();
|
|
95788
95792
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
95789
95793
|
}
|
|
95790
|
-
var generatedName = factory.createUniqueName("_"
|
|
95794
|
+
var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
|
|
95791
95795
|
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
|
|
95792
95796
|
generatedName.generatedImportReference = specifier;
|
|
95793
95797
|
specifierSourceImports.set(name, specifier);
|
|
@@ -96935,11 +96939,11 @@ var ts;
|
|
|
96935
96939
|
}
|
|
96936
96940
|
else {
|
|
96937
96941
|
if (node.kind === 245 /* BreakStatement */) {
|
|
96938
|
-
labelMarker = "break-"
|
|
96942
|
+
labelMarker = "break-".concat(label.escapedText);
|
|
96939
96943
|
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
|
|
96940
96944
|
}
|
|
96941
96945
|
else {
|
|
96942
|
-
labelMarker = "continue-"
|
|
96946
|
+
labelMarker = "continue-".concat(label.escapedText);
|
|
96943
96947
|
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
|
|
96944
96948
|
}
|
|
96945
96949
|
}
|
|
@@ -105796,7 +105800,7 @@ var ts;
|
|
|
105796
105800
|
return getTypeAliasDeclarationVisibilityError;
|
|
105797
105801
|
}
|
|
105798
105802
|
else {
|
|
105799
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
105803
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
|
|
105800
105804
|
}
|
|
105801
105805
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
105802
105806
|
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
|
|
@@ -106007,7 +106011,7 @@ var ts;
|
|
|
106007
106011
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
106008
106012
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
106009
106013
|
default:
|
|
106010
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
106014
|
+
return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
|
|
106011
106015
|
}
|
|
106012
106016
|
}
|
|
106013
106017
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -106765,7 +106769,7 @@ var ts;
|
|
|
106765
106769
|
while (ts.length(lateMarkedStatements)) {
|
|
106766
106770
|
var i = lateMarkedStatements.shift();
|
|
106767
106771
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
106768
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
106772
|
+
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
|
|
106769
106773
|
}
|
|
106770
106774
|
var priorNeedsDeclare = needsDeclare;
|
|
106771
106775
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -106954,7 +106958,7 @@ var ts;
|
|
|
106954
106958
|
return cleanup(input);
|
|
106955
106959
|
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));
|
|
106956
106960
|
}
|
|
106957
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
106961
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
|
|
106958
106962
|
}
|
|
106959
106963
|
}
|
|
106960
106964
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -107245,7 +107249,7 @@ var ts;
|
|
|
107245
107249
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
|
|
107246
107250
|
// We must add a temporary declaration for the extends clause expression
|
|
107247
107251
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
107248
|
-
var newId_1 = factory.createUniqueName(oldId
|
|
107252
|
+
var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
|
|
107249
107253
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
107250
107254
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
107251
107255
|
errorNode: extendsClause_1,
|
|
@@ -107286,7 +107290,7 @@ var ts;
|
|
|
107286
107290
|
}
|
|
107287
107291
|
}
|
|
107288
107292
|
// Anything left unhandled is an error, so this should be unreachable
|
|
107289
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
107293
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
|
|
107290
107294
|
function cleanup(node) {
|
|
107291
107295
|
if (isEnclosingDeclaration(input)) {
|
|
107292
107296
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -108178,13 +108182,13 @@ var ts;
|
|
|
108178
108182
|
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
|
|
108179
108183
|
return;
|
|
108180
108184
|
if (js && configFile.options.sourceMap) {
|
|
108181
|
-
addOutput(js
|
|
108185
|
+
addOutput("".concat(js, ".map"));
|
|
108182
108186
|
}
|
|
108183
108187
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
108184
108188
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
108185
108189
|
addOutput(dts);
|
|
108186
108190
|
if (configFile.options.declarationMap) {
|
|
108187
|
-
addOutput(dts
|
|
108191
|
+
addOutput("".concat(dts, ".map"));
|
|
108188
108192
|
}
|
|
108189
108193
|
}
|
|
108190
108194
|
}
|
|
@@ -108253,7 +108257,7 @@ var ts;
|
|
|
108253
108257
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
108254
108258
|
if (ts.outFile(configFile.options)) {
|
|
108255
108259
|
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
|
|
108256
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
108260
|
+
return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108257
108261
|
}
|
|
108258
108262
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
108259
108263
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -108272,7 +108276,7 @@ var ts;
|
|
|
108272
108276
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
108273
108277
|
if (buildInfoPath)
|
|
108274
108278
|
return buildInfoPath;
|
|
108275
|
-
return ts.Debug.fail("project "
|
|
108279
|
+
return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108276
108280
|
}
|
|
108277
108281
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
108278
108282
|
/*@internal*/
|
|
@@ -108498,7 +108502,7 @@ var ts;
|
|
|
108498
108502
|
if (sourceMappingURL) {
|
|
108499
108503
|
if (!writer.isAtStartOfLine())
|
|
108500
108504
|
writer.rawWrite(newLine);
|
|
108501
|
-
writer.writeComment("//# "
|
|
108505
|
+
writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
|
|
108502
108506
|
}
|
|
108503
108507
|
// Write the source map
|
|
108504
108508
|
if (sourceMapFilePath) {
|
|
@@ -108547,7 +108551,7 @@ var ts;
|
|
|
108547
108551
|
// Encode the sourceMap into the sourceMap url
|
|
108548
108552
|
var sourceMapText = sourceMapGenerator.toString();
|
|
108549
108553
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
108550
|
-
return "data:application/json;base64,"
|
|
108554
|
+
return "data:application/json;base64,".concat(base64SourceMapText);
|
|
108551
108555
|
}
|
|
108552
108556
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
108553
108557
|
if (mapOptions.mapRoot) {
|
|
@@ -108727,7 +108731,7 @@ var ts;
|
|
|
108727
108731
|
return;
|
|
108728
108732
|
break;
|
|
108729
108733
|
default:
|
|
108730
|
-
ts.Debug.fail("Unexpected path: "
|
|
108734
|
+
ts.Debug.fail("Unexpected path: ".concat(name));
|
|
108731
108735
|
}
|
|
108732
108736
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
108733
108737
|
},
|
|
@@ -109587,7 +109591,7 @@ var ts;
|
|
|
109587
109591
|
return writeTokenNode(node, writeKeyword);
|
|
109588
109592
|
if (ts.isTokenKind(node.kind))
|
|
109589
109593
|
return writeTokenNode(node, writePunctuation);
|
|
109590
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
109594
|
+
ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109591
109595
|
}
|
|
109592
109596
|
function emitMappedTypeParameter(node) {
|
|
109593
109597
|
emit(node.name);
|
|
@@ -109757,16 +109761,16 @@ var ts;
|
|
|
109757
109761
|
}
|
|
109758
109762
|
}
|
|
109759
109763
|
function emitPlaceholder(hint, node, snippet) {
|
|
109760
|
-
nonEscapingWrite("${"
|
|
109764
|
+
nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
|
|
109761
109765
|
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
109762
109766
|
nonEscapingWrite("}"); // `}`
|
|
109763
109767
|
// `${2:...}`
|
|
109764
109768
|
}
|
|
109765
109769
|
function emitTabStop(hint, node, snippet) {
|
|
109766
109770
|
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
|
|
109767
|
-
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind "
|
|
109771
|
+
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109768
109772
|
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
|
|
109769
|
-
nonEscapingWrite("$"
|
|
109773
|
+
nonEscapingWrite("$".concat(snippet.order));
|
|
109770
109774
|
}
|
|
109771
109775
|
//
|
|
109772
109776
|
// Identifiers
|
|
@@ -111528,17 +111532,17 @@ var ts;
|
|
|
111528
111532
|
writeLine();
|
|
111529
111533
|
}
|
|
111530
111534
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
111531
|
-
writeComment("/// <amd-module name=\""
|
|
111535
|
+
writeComment("/// <amd-module name=\"".concat(currentSourceFile.moduleName, "\" />"));
|
|
111532
111536
|
writeLine();
|
|
111533
111537
|
}
|
|
111534
111538
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
111535
111539
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
111536
111540
|
var dep = _b[_a];
|
|
111537
111541
|
if (dep.name) {
|
|
111538
|
-
writeComment("/// <amd-dependency name=\""
|
|
111542
|
+
writeComment("/// <amd-dependency name=\"".concat(dep.name, "\" path=\"").concat(dep.path, "\" />"));
|
|
111539
111543
|
}
|
|
111540
111544
|
else {
|
|
111541
|
-
writeComment("/// <amd-dependency path=\""
|
|
111545
|
+
writeComment("/// <amd-dependency path=\"".concat(dep.path, "\" />"));
|
|
111542
111546
|
}
|
|
111543
111547
|
writeLine();
|
|
111544
111548
|
}
|
|
@@ -111546,7 +111550,7 @@ var ts;
|
|
|
111546
111550
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
111547
111551
|
var directive = files_2[_c];
|
|
111548
111552
|
var pos = writer.getTextPos();
|
|
111549
|
-
writeComment("/// <reference path=\""
|
|
111553
|
+
writeComment("/// <reference path=\"".concat(directive.fileName, "\" />"));
|
|
111550
111554
|
if (bundleFileInfo)
|
|
111551
111555
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
111552
111556
|
writeLine();
|
|
@@ -111554,7 +111558,7 @@ var ts;
|
|
|
111554
111558
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
111555
111559
|
var directive = types_24[_d];
|
|
111556
111560
|
var pos = writer.getTextPos();
|
|
111557
|
-
writeComment("/// <reference types=\""
|
|
111561
|
+
writeComment("/// <reference types=\"".concat(directive.fileName, "\" />"));
|
|
111558
111562
|
if (bundleFileInfo)
|
|
111559
111563
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
|
|
111560
111564
|
writeLine();
|
|
@@ -111562,7 +111566,7 @@ var ts;
|
|
|
111562
111566
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
111563
111567
|
var directive = libs_1[_e];
|
|
111564
111568
|
var pos = writer.getTextPos();
|
|
111565
|
-
writeComment("/// <reference lib=\""
|
|
111569
|
+
writeComment("/// <reference lib=\"".concat(directive.fileName, "\" />"));
|
|
111566
111570
|
if (bundleFileInfo)
|
|
111567
111571
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
|
|
111568
111572
|
writeLine();
|
|
@@ -112342,9 +112346,9 @@ var ts;
|
|
|
112342
112346
|
var textSourceNode = node.textSourceNode;
|
|
112343
112347
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
112344
112348
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
112345
|
-
return jsxAttributeEscape ? "\""
|
|
112346
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\""
|
|
112347
|
-
"\""
|
|
112349
|
+
return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
|
|
112350
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
|
|
112351
|
+
"\"".concat(ts.escapeNonAsciiString(text), "\"");
|
|
112348
112352
|
}
|
|
112349
112353
|
else {
|
|
112350
112354
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -112821,8 +112825,8 @@ var ts;
|
|
|
112821
112825
|
}
|
|
112822
112826
|
function formatSynthesizedComment(comment) {
|
|
112823
112827
|
return comment.kind === 3 /* MultiLineCommentTrivia */
|
|
112824
|
-
? "/*"
|
|
112825
|
-
: "//"
|
|
112828
|
+
? "/*".concat(comment.text, "*/")
|
|
112829
|
+
: "//".concat(comment.text);
|
|
112826
112830
|
}
|
|
112827
112831
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
112828
112832
|
enterComment();
|
|
@@ -113543,7 +113547,7 @@ var ts;
|
|
|
113543
113547
|
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;
|
|
113544
113548
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
113545
113549
|
if (!newPath) {
|
|
113546
|
-
writeLog("Project: "
|
|
113550
|
+
writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
|
|
113547
113551
|
return true;
|
|
113548
113552
|
}
|
|
113549
113553
|
fileOrDirectoryPath = newPath;
|
|
@@ -113552,11 +113556,11 @@ var ts;
|
|
|
113552
113556
|
// If the the added or created file or directory is not supported file name, ignore the file
|
|
113553
113557
|
// But when watched directory is added/removed, we need to reload the file list
|
|
113554
113558
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
113555
|
-
writeLog("Project: "
|
|
113559
|
+
writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
|
|
113556
113560
|
return true;
|
|
113557
113561
|
}
|
|
113558
113562
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
113559
|
-
writeLog("Project: "
|
|
113563
|
+
writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
|
|
113560
113564
|
return true;
|
|
113561
113565
|
}
|
|
113562
113566
|
if (!program)
|
|
@@ -113580,7 +113584,7 @@ var ts;
|
|
|
113580
113584
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
113581
113585
|
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
|
|
113582
113586
|
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
|
|
113583
|
-
writeLog("Project: "
|
|
113587
|
+
writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
|
|
113584
113588
|
return true;
|
|
113585
113589
|
}
|
|
113586
113590
|
return false;
|
|
@@ -113648,36 +113652,36 @@ var ts;
|
|
|
113648
113652
|
host.useCaseSensitiveFileNames();
|
|
113649
113653
|
}
|
|
113650
113654
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
113651
|
-
log("ExcludeWatcher:: Added:: "
|
|
113655
|
+
log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113652
113656
|
return {
|
|
113653
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
113657
|
+
close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
|
|
113654
113658
|
};
|
|
113655
113659
|
}
|
|
113656
113660
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113657
|
-
log("FileWatcher:: Added:: "
|
|
113661
|
+
log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113658
113662
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113659
113663
|
return {
|
|
113660
113664
|
close: function () {
|
|
113661
|
-
log("FileWatcher:: Close:: "
|
|
113665
|
+
log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113662
113666
|
watcher.close();
|
|
113663
113667
|
}
|
|
113664
113668
|
};
|
|
113665
113669
|
}
|
|
113666
113670
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113667
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
113671
|
+
var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113668
113672
|
log(watchInfo);
|
|
113669
113673
|
var start = ts.timestamp();
|
|
113670
113674
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113671
113675
|
var elapsed = ts.timestamp() - start;
|
|
113672
|
-
log("Elapsed:: "
|
|
113676
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113673
113677
|
return {
|
|
113674
113678
|
close: function () {
|
|
113675
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
113679
|
+
var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113676
113680
|
log(watchInfo);
|
|
113677
113681
|
var start = ts.timestamp();
|
|
113678
113682
|
watcher.close();
|
|
113679
113683
|
var elapsed = ts.timestamp() - start;
|
|
113680
|
-
log("Elapsed:: "
|
|
113684
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113681
113685
|
}
|
|
113682
113686
|
};
|
|
113683
113687
|
}
|
|
@@ -113687,16 +113691,16 @@ var ts;
|
|
|
113687
113691
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
113688
113692
|
args[_i] = arguments[_i];
|
|
113689
113693
|
}
|
|
113690
|
-
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"
|
|
113694
|
+
var triggerredInfo = "".concat(key === "watchFile" ? "FileWatcher" : "DirectoryWatcher", ":: Triggered with ").concat(args[0], " ").concat(args[1] !== undefined ? args[1] : "", ":: ").concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113691
113695
|
log(triggerredInfo);
|
|
113692
113696
|
var start = ts.timestamp();
|
|
113693
113697
|
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
|
|
113694
113698
|
var elapsed = ts.timestamp() - start;
|
|
113695
|
-
log("Elapsed:: "
|
|
113699
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
|
|
113696
113700
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
113697
113701
|
}
|
|
113698
113702
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
113699
|
-
return "WatchInfo: "
|
|
113703
|
+
return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
|
|
113700
113704
|
}
|
|
113701
113705
|
}
|
|
113702
113706
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -114003,12 +114007,12 @@ var ts;
|
|
|
114003
114007
|
}
|
|
114004
114008
|
ts.formatDiagnostics = formatDiagnostics;
|
|
114005
114009
|
function formatDiagnostic(diagnostic, host) {
|
|
114006
|
-
var errorMessage = ts.diagnosticCategoryName(diagnostic)
|
|
114010
|
+
var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
|
|
114007
114011
|
if (diagnostic.file) {
|
|
114008
114012
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
|
|
114009
114013
|
var fileName = diagnostic.file.fileName;
|
|
114010
114014
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
114011
|
-
return relativeFileName
|
|
114015
|
+
return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
|
|
114012
114016
|
}
|
|
114013
114017
|
return errorMessage;
|
|
114014
114018
|
}
|
|
@@ -114096,9 +114100,9 @@ var ts;
|
|
|
114096
114100
|
var output = "";
|
|
114097
114101
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
114098
114102
|
output += ":";
|
|
114099
|
-
output += color(""
|
|
114103
|
+
output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114100
114104
|
output += ":";
|
|
114101
|
-
output += color(""
|
|
114105
|
+
output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114102
114106
|
return output;
|
|
114103
114107
|
}
|
|
114104
114108
|
ts.formatLocation = formatLocation;
|
|
@@ -114112,7 +114116,7 @@ var ts;
|
|
|
114112
114116
|
output += " - ";
|
|
114113
114117
|
}
|
|
114114
114118
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
114115
|
-
output += formatColorAndReset(" TS"
|
|
114119
|
+
output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
|
|
114116
114120
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
114117
114121
|
if (diagnostic.file) {
|
|
114118
114122
|
output += host.getNewLine();
|
|
@@ -114221,7 +114225,7 @@ var ts;
|
|
|
114221
114225
|
var result = void 0;
|
|
114222
114226
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
114223
114227
|
i++;
|
|
114224
|
-
var cacheKey = mode !== undefined ? mode
|
|
114228
|
+
var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
|
|
114225
114229
|
if (cache.has(cacheKey)) {
|
|
114226
114230
|
result = cache.get(cacheKey);
|
|
114227
114231
|
}
|
|
@@ -116410,7 +116414,7 @@ var ts;
|
|
|
116410
116414
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
116411
116415
|
i++;
|
|
116412
116416
|
}
|
|
116413
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
116417
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
|
|
116414
116418
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
116415
116419
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
116416
116420
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -117231,12 +117235,12 @@ var ts;
|
|
|
117231
117235
|
}
|
|
117232
117236
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
117233
117237
|
var dirPath = host.toPath(dir);
|
|
117234
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
117238
|
+
var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
|
|
117235
117239
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
117236
117240
|
// Any parent directory of declaration dir
|
|
117237
117241
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
117238
117242
|
// Any directory inside declaration dir
|
|
117239
|
-
ts.startsWith(dirPath, declDirPath
|
|
117243
|
+
ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
|
|
117240
117244
|
}
|
|
117241
117245
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
117242
117246
|
var _a;
|
|
@@ -117289,7 +117293,7 @@ var ts;
|
|
|
117289
117293
|
if (isFile && result) {
|
|
117290
117294
|
// Store the real path for the file'
|
|
117291
117295
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
117292
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
117296
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
|
|
117293
117297
|
}
|
|
117294
117298
|
return result;
|
|
117295
117299
|
}) || false;
|
|
@@ -117747,7 +117751,7 @@ var ts;
|
|
|
117747
117751
|
/*forceDtsEmit*/ true);
|
|
117748
117752
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
117749
117753
|
if (firstDts_1) {
|
|
117750
|
-
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: "
|
|
117754
|
+
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: ".concat(ts.getAnyExtensionFromPath(firstDts_1.name), " for ").concat(firstDts_1.name, ":: All output files: ").concat(JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; }))); });
|
|
117751
117755
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
117752
117756
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
117753
117757
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -118255,7 +118259,7 @@ var ts;
|
|
|
118255
118259
|
return;
|
|
118256
118260
|
}
|
|
118257
118261
|
else {
|
|
118258
|
-
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: "
|
|
118262
|
+
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: ".concat(affectedFile.fileName));
|
|
118259
118263
|
}
|
|
118260
118264
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
118261
118265
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -119400,7 +119404,7 @@ var ts;
|
|
|
119400
119404
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
119401
119405
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
119402
119406
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
119403
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
119407
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
|
|
119404
119408
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
119405
119409
|
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
|
|
119406
119410
|
return {
|
|
@@ -120482,7 +120486,7 @@ var ts;
|
|
|
120482
120486
|
}
|
|
120483
120487
|
function getJSExtensionForFile(fileName, options) {
|
|
120484
120488
|
var _a;
|
|
120485
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
120489
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
|
|
120486
120490
|
}
|
|
120487
120491
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
120488
120492
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -120585,8 +120589,8 @@ var ts;
|
|
|
120585
120589
|
return pretty ?
|
|
120586
120590
|
function (diagnostic, newLine, options) {
|
|
120587
120591
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
120588
|
-
var output = "["
|
|
120589
|
-
output += ""
|
|
120592
|
+
var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
|
|
120593
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
|
|
120590
120594
|
system.write(output);
|
|
120591
120595
|
} :
|
|
120592
120596
|
function (diagnostic, newLine, options) {
|
|
@@ -120594,8 +120598,8 @@ var ts;
|
|
|
120594
120598
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
120595
120599
|
output += newLine;
|
|
120596
120600
|
}
|
|
120597
|
-
output += getLocaleTimeString(system)
|
|
120598
|
-
output += ""
|
|
120601
|
+
output += "".concat(getLocaleTimeString(system), " - ");
|
|
120602
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
|
|
120599
120603
|
system.write(output);
|
|
120600
120604
|
};
|
|
120601
120605
|
}
|
|
@@ -120618,7 +120622,7 @@ var ts;
|
|
|
120618
120622
|
.map(function (errorDiagnostic) {
|
|
120619
120623
|
if (errorDiagnostic.file === undefined)
|
|
120620
120624
|
return;
|
|
120621
|
-
return ""
|
|
120625
|
+
return "".concat(errorDiagnostic.file.fileName);
|
|
120622
120626
|
});
|
|
120623
120627
|
return filesInError.map(function (fileName) {
|
|
120624
120628
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
@@ -120651,7 +120655,7 @@ var ts;
|
|
|
120651
120655
|
if (errorCount === 0)
|
|
120652
120656
|
return "";
|
|
120653
120657
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120654
|
-
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName
|
|
120658
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
|
|
120655
120659
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120656
120660
|
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120657
120661
|
var d = errorCount === 1 ?
|
|
@@ -120664,7 +120668,7 @@ var ts;
|
|
|
120664
120668
|
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120665
120669
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120666
120670
|
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120667
|
-
return ""
|
|
120671
|
+
return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
|
|
120668
120672
|
}
|
|
120669
120673
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120670
120674
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120687,7 +120691,7 @@ var ts;
|
|
|
120687
120691
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120688
120692
|
: "";
|
|
120689
120693
|
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120690
|
-
tabularData += ""
|
|
120694
|
+
tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
|
|
120691
120695
|
});
|
|
120692
120696
|
return tabularData;
|
|
120693
120697
|
}
|
|
@@ -120714,9 +120718,9 @@ var ts;
|
|
|
120714
120718
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
120715
120719
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
120716
120720
|
var file = _c[_i];
|
|
120717
|
-
write(""
|
|
120718
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
120719
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
120721
|
+
write("".concat(toFileName(file, relativeFileName)));
|
|
120722
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
|
|
120723
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
|
|
120720
120724
|
}
|
|
120721
120725
|
}
|
|
120722
120726
|
ts.explainFiles = explainFiles;
|
|
@@ -120756,7 +120760,7 @@ var ts;
|
|
|
120756
120760
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
|
|
120757
120761
|
return false;
|
|
120758
120762
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
120759
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
120763
|
+
return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
|
|
120760
120764
|
});
|
|
120761
120765
|
}
|
|
120762
120766
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -120765,7 +120769,7 @@ var ts;
|
|
|
120765
120769
|
var options = program.getCompilerOptions();
|
|
120766
120770
|
if (ts.isReferencedFile(reason)) {
|
|
120767
120771
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
120768
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
120772
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
|
|
120769
120773
|
var message = void 0;
|
|
120770
120774
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
120771
120775
|
switch (reason.kind) {
|
|
@@ -120889,7 +120893,7 @@ var ts;
|
|
|
120889
120893
|
var currentDir_1 = program.getCurrentDirectory();
|
|
120890
120894
|
ts.forEach(emittedFiles, function (file) {
|
|
120891
120895
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
120892
|
-
write("TSFILE: "
|
|
120896
|
+
write("TSFILE: ".concat(filepath));
|
|
120893
120897
|
});
|
|
120894
120898
|
listFiles(program, write);
|
|
120895
120899
|
}
|
|
@@ -121218,7 +121222,7 @@ var ts;
|
|
|
121218
121222
|
}
|
|
121219
121223
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
121220
121224
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
121221
|
-
writeLog("Current directory: "
|
|
121225
|
+
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
121222
121226
|
var configFileWatcher;
|
|
121223
121227
|
if (configFileName) {
|
|
121224
121228
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -121374,10 +121378,10 @@ var ts;
|
|
|
121374
121378
|
function createNewProgram(hasInvalidatedResolution) {
|
|
121375
121379
|
// Compile the program
|
|
121376
121380
|
writeLog("CreatingProgramWith::");
|
|
121377
|
-
writeLog(" roots: "
|
|
121378
|
-
writeLog(" options: "
|
|
121381
|
+
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
121382
|
+
writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
|
|
121379
121383
|
if (projectReferences)
|
|
121380
|
-
writeLog(" projectReferences: "
|
|
121384
|
+
writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
|
|
121381
121385
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
121382
121386
|
hasChangedCompilerOptions = false;
|
|
121383
121387
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -121538,7 +121542,7 @@ var ts;
|
|
|
121538
121542
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
121539
121543
|
}
|
|
121540
121544
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
121541
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
121545
|
+
writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
|
|
121542
121546
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
121543
121547
|
}
|
|
121544
121548
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -121598,7 +121602,7 @@ var ts;
|
|
|
121598
121602
|
synchronizeProgram();
|
|
121599
121603
|
}
|
|
121600
121604
|
function reloadConfigFile() {
|
|
121601
|
-
writeLog("Reloading config file: "
|
|
121605
|
+
writeLog("Reloading config file: ".concat(configFileName));
|
|
121602
121606
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
121603
121607
|
if (cachedDirectoryStructureHost) {
|
|
121604
121608
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -121639,7 +121643,7 @@ var ts;
|
|
|
121639
121643
|
return config.parsedCommandLine;
|
|
121640
121644
|
}
|
|
121641
121645
|
}
|
|
121642
|
-
writeLog("Loading config file: "
|
|
121646
|
+
writeLog("Loading config file: ".concat(configFileName));
|
|
121643
121647
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
121644
121648
|
host.getParsedCommandLine(configFileName) :
|
|
121645
121649
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -121943,8 +121947,8 @@ var ts;
|
|
|
121943
121947
|
*/
|
|
121944
121948
|
function createBuilderStatusReporter(system, pretty) {
|
|
121945
121949
|
return function (diagnostic) {
|
|
121946
|
-
var output = pretty ? "["
|
|
121947
|
-
output += ""
|
|
121950
|
+
var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
|
|
121951
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
|
|
121948
121952
|
system.write(output);
|
|
121949
121953
|
};
|
|
121950
121954
|
}
|
|
@@ -122719,7 +122723,7 @@ var ts;
|
|
|
122719
122723
|
function listEmittedFile(_a, proj, file) {
|
|
122720
122724
|
var write = _a.write;
|
|
122721
122725
|
if (write && proj.options.listEmittedFiles) {
|
|
122722
|
-
write("TSFILE: "
|
|
122726
|
+
write("TSFILE: ".concat(file));
|
|
122723
122727
|
}
|
|
122724
122728
|
}
|
|
122725
122729
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -122748,7 +122752,7 @@ var ts;
|
|
|
122748
122752
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
122749
122753
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
122750
122754
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
122751
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType
|
|
122755
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
|
|
122752
122756
|
if (canEmitBuildInfo)
|
|
122753
122757
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
122754
122758
|
afterProgramDone(state, program, config);
|
|
@@ -122776,7 +122780,7 @@ var ts;
|
|
|
122776
122780
|
if (!host.fileExists(inputFile)) {
|
|
122777
122781
|
return {
|
|
122778
122782
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
122779
|
-
reason: inputFile
|
|
122783
|
+
reason: "".concat(inputFile, " does not exist")
|
|
122780
122784
|
};
|
|
122781
122785
|
}
|
|
122782
122786
|
if (!force) {
|
|
@@ -123135,7 +123139,7 @@ var ts;
|
|
|
123135
123139
|
}
|
|
123136
123140
|
}
|
|
123137
123141
|
if (filesToDelete) {
|
|
123138
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
123142
|
+
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * ".concat(f); }).join(""));
|
|
123139
123143
|
}
|
|
123140
123144
|
return ts.ExitStatus.Success;
|
|
123141
123145
|
}
|
|
@@ -123473,7 +123477,7 @@ var ts;
|
|
|
123473
123477
|
function nowString() {
|
|
123474
123478
|
// E.g. "12:34:56.789"
|
|
123475
123479
|
var d = new Date();
|
|
123476
|
-
return ts.padLeft(d.getHours().toString(), 2, "0")
|
|
123480
|
+
return "".concat(ts.padLeft(d.getHours().toString(), 2, "0"), ":").concat(ts.padLeft(d.getMinutes().toString(), 2, "0"), ":").concat(ts.padLeft(d.getSeconds().toString(), 2, "0"), ".").concat(ts.padLeft(d.getMilliseconds().toString(), 3, "0"));
|
|
123477
123481
|
}
|
|
123478
123482
|
server.nowString = nowString;
|
|
123479
123483
|
})(server = ts.server || (ts.server = {}));
|
|
@@ -123484,7 +123488,7 @@ var ts;
|
|
|
123484
123488
|
var JsTyping;
|
|
123485
123489
|
(function (JsTyping) {
|
|
123486
123490
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
123487
|
-
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts"
|
|
123491
|
+
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
|
|
123488
123492
|
return availableVersion.compareTo(cachedTyping.version) <= 0;
|
|
123489
123493
|
}
|
|
123490
123494
|
JsTyping.isTypingUpToDate = isTypingUpToDate;
|
|
@@ -123537,7 +123541,7 @@ var ts;
|
|
|
123537
123541
|
"worker_threads",
|
|
123538
123542
|
"zlib"
|
|
123539
123543
|
];
|
|
123540
|
-
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:"
|
|
123544
|
+
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
|
|
123541
123545
|
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
|
|
123542
123546
|
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
|
|
123543
123547
|
function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
@@ -123610,7 +123614,7 @@ var ts;
|
|
|
123610
123614
|
var excludeTypingName = exclude_1[_i];
|
|
123611
123615
|
var didDelete = inferredTypings.delete(excludeTypingName);
|
|
123612
123616
|
if (didDelete && log)
|
|
123613
|
-
log("Typing for "
|
|
123617
|
+
log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
|
|
123614
123618
|
}
|
|
123615
123619
|
var newTypingNames = [];
|
|
123616
123620
|
var cachedTypingPaths = [];
|
|
@@ -123624,7 +123628,7 @@ var ts;
|
|
|
123624
123628
|
});
|
|
123625
123629
|
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
|
|
123626
123630
|
if (log)
|
|
123627
|
-
log("Result: "
|
|
123631
|
+
log("Result: ".concat(JSON.stringify(result)));
|
|
123628
123632
|
return result;
|
|
123629
123633
|
function addInferredTyping(typingName) {
|
|
123630
123634
|
if (!inferredTypings.has(typingName)) {
|
|
@@ -123633,7 +123637,7 @@ var ts;
|
|
|
123633
123637
|
}
|
|
123634
123638
|
function addInferredTypings(typingNames, message) {
|
|
123635
123639
|
if (log)
|
|
123636
|
-
log(message
|
|
123640
|
+
log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
|
|
123637
123641
|
ts.forEach(typingNames, addInferredTyping);
|
|
123638
123642
|
}
|
|
123639
123643
|
/**
|
|
@@ -123655,7 +123659,7 @@ var ts;
|
|
|
123655
123659
|
filesToWatch.push(manifestPath);
|
|
123656
123660
|
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
|
|
123657
123661
|
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
|
|
123658
|
-
addInferredTypings(manifestTypingNames, "Typing names in '"
|
|
123662
|
+
addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
|
|
123659
123663
|
}
|
|
123660
123664
|
// Now we scan the directories for typing information in
|
|
123661
123665
|
// already-installed dependencies (if present). Note that this
|
|
@@ -123699,7 +123703,7 @@ var ts;
|
|
|
123699
123703
|
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
|
|
123700
123704
|
});
|
|
123701
123705
|
if (log)
|
|
123702
|
-
log("Searching for typing names in "
|
|
123706
|
+
log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
|
|
123703
123707
|
// Once we have the names of things to look up, we iterate over
|
|
123704
123708
|
// and either collect their included typings, or add them to the
|
|
123705
123709
|
// list of typings we need to look up separately.
|
|
@@ -123718,12 +123722,12 @@ var ts;
|
|
|
123718
123722
|
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
|
|
123719
123723
|
if (host.fileExists(absolutePath)) {
|
|
123720
123724
|
if (log)
|
|
123721
|
-
log(" Package '"
|
|
123725
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types."));
|
|
123722
123726
|
inferredTypings.set(manifest_1.name, absolutePath);
|
|
123723
123727
|
}
|
|
123724
123728
|
else {
|
|
123725
123729
|
if (log)
|
|
123726
|
-
log(" Package '"
|
|
123730
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
|
|
123727
123731
|
}
|
|
123728
123732
|
}
|
|
123729
123733
|
else {
|
|
@@ -123819,15 +123823,15 @@ var ts;
|
|
|
123819
123823
|
var kind = isScopeName ? "Scope" : "Package";
|
|
123820
123824
|
switch (result) {
|
|
123821
123825
|
case 1 /* EmptyName */:
|
|
123822
|
-
return "'"
|
|
123826
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
|
|
123823
123827
|
case 2 /* NameTooLong */:
|
|
123824
|
-
return "'"
|
|
123828
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
|
|
123825
123829
|
case 3 /* NameStartsWithDot */:
|
|
123826
|
-
return "'"
|
|
123830
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
|
|
123827
123831
|
case 4 /* NameStartsWithUnderscore */:
|
|
123828
|
-
return "'"
|
|
123832
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
|
|
123829
123833
|
case 5 /* NameContainsNonURISafeCharacters */:
|
|
123830
|
-
return "'"
|
|
123834
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
|
|
123831
123835
|
case 0 /* Ok */:
|
|
123832
123836
|
return ts.Debug.fail(); // Shouldn't have called this.
|
|
123833
123837
|
default:
|
|
@@ -123853,7 +123857,7 @@ var ts;
|
|
|
123853
123857
|
}
|
|
123854
123858
|
catch (e) {
|
|
123855
123859
|
if (log.isEnabled()) {
|
|
123856
|
-
log.writeLine("Failed to resolve "
|
|
123860
|
+
log.writeLine("Failed to resolve ".concat(packageName, " in folder '").concat(cachePath, "': ").concat(e.message));
|
|
123857
123861
|
}
|
|
123858
123862
|
return undefined;
|
|
123859
123863
|
}
|
|
@@ -123874,7 +123878,7 @@ var ts;
|
|
|
123874
123878
|
var sliceStart = packageNames.length - remaining;
|
|
123875
123879
|
var command, toSlice = remaining;
|
|
123876
123880
|
while (true) {
|
|
123877
|
-
command = npmPath
|
|
123881
|
+
command = "".concat(npmPath, " install --ignore-scripts ").concat((toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" "), " --save-dev --user-agent=\"typesInstaller/").concat(tsVersion, "\"");
|
|
123878
123882
|
if (command.length < 8000) {
|
|
123879
123883
|
break;
|
|
123880
123884
|
}
|
|
@@ -123901,12 +123905,12 @@ var ts;
|
|
|
123901
123905
|
ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
|
|
123902
123906
|
})(ProjectWatcherType || (ProjectWatcherType = {}));
|
|
123903
123907
|
function getDetailWatchInfo(projectName, watchers) {
|
|
123904
|
-
return "Project: "
|
|
123908
|
+
return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
|
|
123905
123909
|
}
|
|
123906
123910
|
var TypingsInstaller = /** @class */ (function () {
|
|
123907
123911
|
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
|
|
123908
|
-
var _this = this;
|
|
123909
123912
|
if (log === void 0) { log = nullLog; }
|
|
123913
|
+
var _this = this;
|
|
123910
123914
|
this.installTypingHost = installTypingHost;
|
|
123911
123915
|
this.globalCachePath = globalCachePath;
|
|
123912
123916
|
this.safeListPath = safeListPath;
|
|
@@ -123925,7 +123929,7 @@ var ts;
|
|
|
123925
123929
|
this.globalCachePackageJsonPath = ts.combinePaths(globalCachePath, "package.json");
|
|
123926
123930
|
var isLoggingEnabled = this.log.isEnabled();
|
|
123927
123931
|
if (isLoggingEnabled) {
|
|
123928
|
-
this.log.writeLine("Global cache location '"
|
|
123932
|
+
this.log.writeLine("Global cache location '".concat(globalCachePath, "', safe file path '").concat(safeListPath, "', types map path ").concat(typesMapLocation));
|
|
123929
123933
|
}
|
|
123930
123934
|
this.watchFactory = ts.getWatchFactory(this.installTypingHost, isLoggingEnabled ? ts.WatchLogLevel.Verbose : ts.WatchLogLevel.None, function (s) { return _this.log.writeLine(s); }, getDetailWatchInfo);
|
|
123931
123935
|
this.processCacheLocation(this.globalCachePath);
|
|
@@ -123935,30 +123939,30 @@ var ts;
|
|
|
123935
123939
|
};
|
|
123936
123940
|
TypingsInstaller.prototype.closeWatchers = function (projectName) {
|
|
123937
123941
|
if (this.log.isEnabled()) {
|
|
123938
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
123942
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "'"));
|
|
123939
123943
|
}
|
|
123940
123944
|
var watchers = this.projectWatchers.get(projectName);
|
|
123941
123945
|
if (!watchers) {
|
|
123942
123946
|
if (this.log.isEnabled()) {
|
|
123943
|
-
this.log.writeLine("No watchers are registered for project '"
|
|
123947
|
+
this.log.writeLine("No watchers are registered for project '".concat(projectName, "'"));
|
|
123944
123948
|
}
|
|
123945
123949
|
return;
|
|
123946
123950
|
}
|
|
123947
123951
|
ts.clearMap(watchers, ts.closeFileWatcher);
|
|
123948
123952
|
this.projectWatchers.delete(projectName);
|
|
123949
123953
|
if (this.log.isEnabled()) {
|
|
123950
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
123954
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "' - done."));
|
|
123951
123955
|
}
|
|
123952
123956
|
};
|
|
123953
123957
|
TypingsInstaller.prototype.install = function (req) {
|
|
123954
123958
|
var _this = this;
|
|
123955
123959
|
if (this.log.isEnabled()) {
|
|
123956
|
-
this.log.writeLine("Got install request "
|
|
123960
|
+
this.log.writeLine("Got install request ".concat(JSON.stringify(req)));
|
|
123957
123961
|
}
|
|
123958
123962
|
// load existing typing information from the cache
|
|
123959
123963
|
if (req.cachePath) {
|
|
123960
123964
|
if (this.log.isEnabled()) {
|
|
123961
|
-
this.log.writeLine("Request specifies cache path '"
|
|
123965
|
+
this.log.writeLine("Request specifies cache path '".concat(req.cachePath, "', loading cached information..."));
|
|
123962
123966
|
}
|
|
123963
123967
|
this.processCacheLocation(req.cachePath);
|
|
123964
123968
|
}
|
|
@@ -123967,7 +123971,7 @@ var ts;
|
|
|
123967
123971
|
}
|
|
123968
123972
|
var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports, this.typesRegistry);
|
|
123969
123973
|
if (this.log.isEnabled()) {
|
|
123970
|
-
this.log.writeLine("Finished typings discovery: "
|
|
123974
|
+
this.log.writeLine("Finished typings discovery: ".concat(JSON.stringify(discoverTypingsResult)));
|
|
123971
123975
|
}
|
|
123972
123976
|
// start watching files
|
|
123973
123977
|
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions);
|
|
@@ -123987,17 +123991,17 @@ var ts;
|
|
|
123987
123991
|
if (this.typesMapLocation) {
|
|
123988
123992
|
var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation);
|
|
123989
123993
|
if (safeListFromMap) {
|
|
123990
|
-
this.log.writeLine("Loaded safelist from types map file '"
|
|
123994
|
+
this.log.writeLine("Loaded safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
123991
123995
|
this.safeList = safeListFromMap;
|
|
123992
123996
|
return;
|
|
123993
123997
|
}
|
|
123994
|
-
this.log.writeLine("Failed to load safelist from types map file '"
|
|
123998
|
+
this.log.writeLine("Failed to load safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
123995
123999
|
}
|
|
123996
124000
|
this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
|
|
123997
124001
|
};
|
|
123998
124002
|
TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) {
|
|
123999
124003
|
if (this.log.isEnabled()) {
|
|
124000
|
-
this.log.writeLine("Processing cache location '"
|
|
124004
|
+
this.log.writeLine("Processing cache location '".concat(cacheLocation, "'"));
|
|
124001
124005
|
}
|
|
124002
124006
|
if (this.knownCachesSet.has(cacheLocation)) {
|
|
124003
124007
|
if (this.log.isEnabled()) {
|
|
@@ -124008,14 +124012,14 @@ var ts;
|
|
|
124008
124012
|
var packageJson = ts.combinePaths(cacheLocation, "package.json");
|
|
124009
124013
|
var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json");
|
|
124010
124014
|
if (this.log.isEnabled()) {
|
|
124011
|
-
this.log.writeLine("Trying to find '"
|
|
124015
|
+
this.log.writeLine("Trying to find '".concat(packageJson, "'..."));
|
|
124012
124016
|
}
|
|
124013
124017
|
if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) {
|
|
124014
124018
|
var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); // TODO: GH#18217
|
|
124015
124019
|
var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); // TODO: GH#18217
|
|
124016
124020
|
if (this.log.isEnabled()) {
|
|
124017
|
-
this.log.writeLine("Loaded content of '"
|
|
124018
|
-
this.log.writeLine("Loaded content of '"
|
|
124021
|
+
this.log.writeLine("Loaded content of '".concat(packageJson, "': ").concat(JSON.stringify(npmConfig)));
|
|
124022
|
+
this.log.writeLine("Loaded content of '".concat(packageLockJson, "'"));
|
|
124019
124023
|
}
|
|
124020
124024
|
if (npmConfig.devDependencies && npmLock.dependencies) {
|
|
124021
124025
|
for (var key in npmConfig.devDependencies) {
|
|
@@ -124039,11 +124043,11 @@ var ts;
|
|
|
124039
124043
|
continue;
|
|
124040
124044
|
}
|
|
124041
124045
|
if (this.log.isEnabled()) {
|
|
124042
|
-
this.log.writeLine("New typing for package "
|
|
124046
|
+
this.log.writeLine("New typing for package ".concat(packageName, " from '").concat(typingFile, "' conflicts with existing typing file '").concat(existingTypingFile, "'"));
|
|
124043
124047
|
}
|
|
124044
124048
|
}
|
|
124045
124049
|
if (this.log.isEnabled()) {
|
|
124046
|
-
this.log.writeLine("Adding entry into typings cache: '"
|
|
124050
|
+
this.log.writeLine("Adding entry into typings cache: '".concat(packageName, "' => '").concat(typingFile, "'"));
|
|
124047
124051
|
}
|
|
124048
124052
|
var info = ts.getProperty(npmLock.dependencies, key);
|
|
124049
124053
|
var version_1 = info && info.version;
|
|
@@ -124056,7 +124060,7 @@ var ts;
|
|
|
124056
124060
|
}
|
|
124057
124061
|
}
|
|
124058
124062
|
if (this.log.isEnabled()) {
|
|
124059
|
-
this.log.writeLine("Finished processing cache location '"
|
|
124063
|
+
this.log.writeLine("Finished processing cache location '".concat(cacheLocation, "'"));
|
|
124060
124064
|
}
|
|
124061
124065
|
this.knownCachesSet.add(cacheLocation);
|
|
124062
124066
|
};
|
|
@@ -124066,7 +124070,7 @@ var ts;
|
|
|
124066
124070
|
var typingKey = ts.mangleScopedPackageName(typing);
|
|
124067
124071
|
if (_this.missingTypingsSet.has(typingKey)) {
|
|
124068
124072
|
if (_this.log.isEnabled())
|
|
124069
|
-
_this.log.writeLine("'"
|
|
124073
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' is in missingTypingsSet - skipping..."));
|
|
124070
124074
|
return undefined;
|
|
124071
124075
|
}
|
|
124072
124076
|
var validationResult = ts.JsTyping.validatePackageName(typing);
|
|
@@ -124079,12 +124083,12 @@ var ts;
|
|
|
124079
124083
|
}
|
|
124080
124084
|
if (!_this.typesRegistry.has(typingKey)) {
|
|
124081
124085
|
if (_this.log.isEnabled())
|
|
124082
|
-
_this.log.writeLine("'"
|
|
124086
|
+
_this.log.writeLine("'".concat(typing, "':: Entry for package '").concat(typingKey, "' does not exist in local types registry - skipping..."));
|
|
124083
124087
|
return undefined;
|
|
124084
124088
|
}
|
|
124085
124089
|
if (_this.packageNameToTypingLocation.get(typingKey) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typingKey), _this.typesRegistry.get(typingKey))) {
|
|
124086
124090
|
if (_this.log.isEnabled())
|
|
124087
|
-
_this.log.writeLine("'"
|
|
124091
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' already has an up-to-date typing - skipping..."));
|
|
124088
124092
|
return undefined;
|
|
124089
124093
|
}
|
|
124090
124094
|
return typingKey;
|
|
@@ -124093,11 +124097,11 @@ var ts;
|
|
|
124093
124097
|
TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) {
|
|
124094
124098
|
var npmConfigPath = ts.combinePaths(directory, "package.json");
|
|
124095
124099
|
if (this.log.isEnabled()) {
|
|
124096
|
-
this.log.writeLine("Npm config file: "
|
|
124100
|
+
this.log.writeLine("Npm config file: ".concat(npmConfigPath));
|
|
124097
124101
|
}
|
|
124098
124102
|
if (!this.installTypingHost.fileExists(npmConfigPath)) {
|
|
124099
124103
|
if (this.log.isEnabled()) {
|
|
124100
|
-
this.log.writeLine("Npm config file: '"
|
|
124104
|
+
this.log.writeLine("Npm config file: '".concat(npmConfigPath, "' is missing, creating new one..."));
|
|
124101
124105
|
}
|
|
124102
124106
|
this.ensureDirectoryExists(directory, this.installTypingHost);
|
|
124103
124107
|
this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }');
|
|
@@ -124106,7 +124110,7 @@ var ts;
|
|
|
124106
124110
|
TypingsInstaller.prototype.installTypings = function (req, cachePath, currentlyCachedTypings, typingsToInstall) {
|
|
124107
124111
|
var _this = this;
|
|
124108
124112
|
if (this.log.isEnabled()) {
|
|
124109
|
-
this.log.writeLine("Installing typings "
|
|
124113
|
+
this.log.writeLine("Installing typings ".concat(JSON.stringify(typingsToInstall)));
|
|
124110
124114
|
}
|
|
124111
124115
|
var filteredTypings = this.filterTypings(typingsToInstall);
|
|
124112
124116
|
if (filteredTypings.length === 0) {
|
|
@@ -124133,7 +124137,7 @@ var ts;
|
|
|
124133
124137
|
try {
|
|
124134
124138
|
if (!ok) {
|
|
124135
124139
|
if (_this.log.isEnabled()) {
|
|
124136
|
-
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: "
|
|
124140
|
+
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: ".concat(JSON.stringify(filteredTypings)));
|
|
124137
124141
|
}
|
|
124138
124142
|
for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
|
|
124139
124143
|
var typing = filteredTypings_1[_i];
|
|
@@ -124143,7 +124147,7 @@ var ts;
|
|
|
124143
124147
|
}
|
|
124144
124148
|
// TODO: watch project directory
|
|
124145
124149
|
if (_this.log.isEnabled()) {
|
|
124146
|
-
_this.log.writeLine("Installed typings "
|
|
124150
|
+
_this.log.writeLine("Installed typings ".concat(JSON.stringify(scopedTypings)));
|
|
124147
124151
|
}
|
|
124148
124152
|
var installedTypingFiles = [];
|
|
124149
124153
|
for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
|
|
@@ -124155,13 +124159,13 @@ var ts;
|
|
|
124155
124159
|
}
|
|
124156
124160
|
// packageName is guaranteed to exist in typesRegistry by filterTypings
|
|
124157
124161
|
var distTags = _this.typesRegistry.get(packageName);
|
|
124158
|
-
var newVersion = new ts.Version(distTags["ts"
|
|
124162
|
+
var newVersion = new ts.Version(distTags["ts".concat(ts.versionMajorMinor)] || distTags[_this.latestDistTag]);
|
|
124159
124163
|
var newTyping = { typingLocation: typingFile, version: newVersion };
|
|
124160
124164
|
_this.packageNameToTypingLocation.set(packageName, newTyping);
|
|
124161
124165
|
installedTypingFiles.push(typingFile);
|
|
124162
124166
|
}
|
|
124163
124167
|
if (_this.log.isEnabled()) {
|
|
124164
|
-
_this.log.writeLine("Installed typing files "
|
|
124168
|
+
_this.log.writeLine("Installed typing files ".concat(JSON.stringify(installedTypingFiles)));
|
|
124165
124169
|
}
|
|
124166
124170
|
_this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles)));
|
|
124167
124171
|
}
|
|
@@ -124215,7 +124219,7 @@ var ts;
|
|
|
124215
124219
|
return;
|
|
124216
124220
|
}
|
|
124217
124221
|
if (isLoggingEnabled) {
|
|
124218
|
-
_this.log.writeLine(projectWatcherType
|
|
124222
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Added:: WatchInfo: ").concat(path));
|
|
124219
124223
|
}
|
|
124220
124224
|
var watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ?
|
|
124221
124225
|
_this.watchFactory.watchFile(path, function () {
|
|
@@ -124236,7 +124240,7 @@ var ts;
|
|
|
124236
124240
|
}, 1 /* Recursive */, options, projectName, watchers);
|
|
124237
124241
|
watchers.set(canonicalPath, isLoggingEnabled ? {
|
|
124238
124242
|
close: function () {
|
|
124239
|
-
_this.log.writeLine(projectWatcherType
|
|
124243
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Closed:: WatchInfo: ").concat(path));
|
|
124240
124244
|
watcher.close();
|
|
124241
124245
|
}
|
|
124242
124246
|
} : watcher);
|
|
@@ -124311,7 +124315,7 @@ var ts;
|
|
|
124311
124315
|
typingsInstaller.TypingsInstaller = TypingsInstaller;
|
|
124312
124316
|
/* @internal */
|
|
124313
124317
|
function typingsName(packageName) {
|
|
124314
|
-
return "@types/"
|
|
124318
|
+
return "@types/".concat(packageName, "@ts").concat(ts.versionMajorMinor);
|
|
124315
124319
|
}
|
|
124316
124320
|
typingsInstaller.typingsName = typingsName;
|
|
124317
124321
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|
|
@@ -124336,7 +124340,7 @@ var ts;
|
|
|
124336
124340
|
if (typeof _this.logFile !== "string")
|
|
124337
124341
|
return;
|
|
124338
124342
|
try {
|
|
124339
|
-
fs.appendFileSync(_this.logFile, "["
|
|
124343
|
+
fs.appendFileSync(_this.logFile, "[".concat(server.nowString(), "] ").concat(text).concat(ts.sys.newLine));
|
|
124340
124344
|
}
|
|
124341
124345
|
catch (e) {
|
|
124342
124346
|
_this.logFile = undefined;
|
|
@@ -124352,7 +124356,7 @@ var ts;
|
|
|
124352
124356
|
return npmPath;
|
|
124353
124357
|
}
|
|
124354
124358
|
if (host.fileExists(npmPath)) {
|
|
124355
|
-
return "\""
|
|
124359
|
+
return "\"".concat(npmPath, "\"");
|
|
124356
124360
|
}
|
|
124357
124361
|
}
|
|
124358
124362
|
return "npm";
|
|
@@ -124360,7 +124364,7 @@ var ts;
|
|
|
124360
124364
|
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
|
|
124361
124365
|
if (!host.fileExists(typesRegistryFilePath)) {
|
|
124362
124366
|
if (log.isEnabled()) {
|
|
124363
|
-
log.writeLine("Types registry file '"
|
|
124367
|
+
log.writeLine("Types registry file '".concat(typesRegistryFilePath, "' does not exist"));
|
|
124364
124368
|
}
|
|
124365
124369
|
return new ts.Map();
|
|
124366
124370
|
}
|
|
@@ -124370,14 +124374,14 @@ var ts;
|
|
|
124370
124374
|
}
|
|
124371
124375
|
catch (e) {
|
|
124372
124376
|
if (log.isEnabled()) {
|
|
124373
|
-
log.writeLine("Error when loading types registry file '"
|
|
124377
|
+
log.writeLine("Error when loading types registry file '".concat(typesRegistryFilePath, "': ").concat(e.message, ", ").concat(e.stack));
|
|
124374
124378
|
}
|
|
124375
124379
|
return new ts.Map();
|
|
124376
124380
|
}
|
|
124377
124381
|
}
|
|
124378
124382
|
var typesRegistryPackageName = "types-registry";
|
|
124379
124383
|
function getTypesRegistryFileLocation(globalTypingsCacheLocation) {
|
|
124380
|
-
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/"
|
|
124384
|
+
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/".concat(typesRegistryPackageName, "/index.json"));
|
|
124381
124385
|
}
|
|
124382
124386
|
var NodeTypingsInstaller = (function (_super) {
|
|
124383
124387
|
__extends(NodeTypingsInstaller, _super);
|
|
@@ -124385,27 +124389,27 @@ var ts;
|
|
|
124385
124389
|
var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), typesMapLocation ? ts.toPath(typesMapLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typesMap.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this;
|
|
124386
124390
|
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
|
|
124387
124391
|
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
|
|
124388
|
-
_this.npmPath = "\""
|
|
124392
|
+
_this.npmPath = "\"".concat(_this.npmPath, "\"");
|
|
124389
124393
|
}
|
|
124390
124394
|
if (_this.log.isEnabled()) {
|
|
124391
|
-
_this.log.writeLine("Process id: "
|
|
124392
|
-
_this.log.writeLine("NPM location: "
|
|
124393
|
-
_this.log.writeLine("validateDefaultNpmLocation: "
|
|
124395
|
+
_this.log.writeLine("Process id: ".concat(process.pid));
|
|
124396
|
+
_this.log.writeLine("NPM location: ".concat(_this.npmPath, " (explicit '").concat(server.Arguments.NpmLocation, "' ").concat(npmLocation === undefined ? "not " : "", " provided)"));
|
|
124397
|
+
_this.log.writeLine("validateDefaultNpmLocation: ".concat(validateDefaultNpmLocation));
|
|
124394
124398
|
}
|
|
124395
124399
|
(_this.nodeExecSync = require("child_process").execSync);
|
|
124396
124400
|
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
|
|
124397
124401
|
try {
|
|
124398
124402
|
if (_this.log.isEnabled()) {
|
|
124399
|
-
_this.log.writeLine("Updating "
|
|
124403
|
+
_this.log.writeLine("Updating ".concat(typesRegistryPackageName, " npm package..."));
|
|
124400
124404
|
}
|
|
124401
|
-
_this.execSyncAndLog(_this.npmPath
|
|
124405
|
+
_this.execSyncAndLog("".concat(_this.npmPath, " install --ignore-scripts ").concat(typesRegistryPackageName, "@").concat(_this.latestDistTag), { cwd: globalTypingsCacheLocation });
|
|
124402
124406
|
if (_this.log.isEnabled()) {
|
|
124403
|
-
_this.log.writeLine("Updated "
|
|
124407
|
+
_this.log.writeLine("Updated ".concat(typesRegistryPackageName, " npm package"));
|
|
124404
124408
|
}
|
|
124405
124409
|
}
|
|
124406
124410
|
catch (e) {
|
|
124407
124411
|
if (_this.log.isEnabled()) {
|
|
124408
|
-
_this.log.writeLine("Error updating "
|
|
124412
|
+
_this.log.writeLine("Error updating ".concat(typesRegistryPackageName, " package: ").concat(e.message));
|
|
124409
124413
|
}
|
|
124410
124414
|
_this.delayedInitializationError = {
|
|
124411
124415
|
kind: "event::initializationFailed",
|
|
@@ -124444,7 +124448,7 @@ var ts;
|
|
|
124444
124448
|
var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
|
|
124445
124449
|
if (cwd) {
|
|
124446
124450
|
_this.installWorker(-1, [packageName_1], cwd, function (success) {
|
|
124447
|
-
var message = success ? "Package "
|
|
124451
|
+
var message = success ? "Package ".concat(packageName_1, " installed.") : "There was an error installing ".concat(packageName_1, ".");
|
|
124448
124452
|
var response = { kind: server.ActionPackageInstalled, projectName: projectName_1, success: success, message: message };
|
|
124449
124453
|
_this.sendResponse(response);
|
|
124450
124454
|
});
|
|
@@ -124462,7 +124466,7 @@ var ts;
|
|
|
124462
124466
|
};
|
|
124463
124467
|
NodeTypingsInstaller.prototype.sendResponse = function (response) {
|
|
124464
124468
|
if (this.log.isEnabled()) {
|
|
124465
|
-
this.log.writeLine("Sending response:\n "
|
|
124469
|
+
this.log.writeLine("Sending response:\n ".concat(JSON.stringify(response)));
|
|
124466
124470
|
}
|
|
124467
124471
|
process.send(response);
|
|
124468
124472
|
if (this.log.isEnabled()) {
|
|
@@ -124472,29 +124476,29 @@ var ts;
|
|
|
124472
124476
|
NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
|
|
124473
124477
|
var _this = this;
|
|
124474
124478
|
if (this.log.isEnabled()) {
|
|
124475
|
-
this.log.writeLine("#"
|
|
124479
|
+
this.log.writeLine("#".concat(requestId, " with arguments'").concat(JSON.stringify(packageNames), "'."));
|
|
124476
124480
|
}
|
|
124477
124481
|
var start = Date.now();
|
|
124478
124482
|
var hasError = typingsInstaller.installNpmPackages(this.npmPath, ts.version, packageNames, function (command) { return _this.execSyncAndLog(command, { cwd: cwd }); });
|
|
124479
124483
|
if (this.log.isEnabled()) {
|
|
124480
|
-
this.log.writeLine("npm install #"
|
|
124484
|
+
this.log.writeLine("npm install #".concat(requestId, " took: ").concat(Date.now() - start, " ms"));
|
|
124481
124485
|
}
|
|
124482
124486
|
onRequestCompleted(!hasError);
|
|
124483
124487
|
};
|
|
124484
124488
|
NodeTypingsInstaller.prototype.execSyncAndLog = function (command, options) {
|
|
124485
124489
|
if (this.log.isEnabled()) {
|
|
124486
|
-
this.log.writeLine("Exec: "
|
|
124490
|
+
this.log.writeLine("Exec: ".concat(command));
|
|
124487
124491
|
}
|
|
124488
124492
|
try {
|
|
124489
124493
|
var stdout = this.nodeExecSync(command, __assign(__assign({}, options), { encoding: "utf-8" }));
|
|
124490
124494
|
if (this.log.isEnabled()) {
|
|
124491
|
-
this.log.writeLine(" Succeeded. stdout:"
|
|
124495
|
+
this.log.writeLine(" Succeeded. stdout:".concat(indent(ts.sys.newLine, stdout)));
|
|
124492
124496
|
}
|
|
124493
124497
|
return false;
|
|
124494
124498
|
}
|
|
124495
124499
|
catch (error) {
|
|
124496
124500
|
var stdout = error.stdout, stderr = error.stderr;
|
|
124497
|
-
this.log.writeLine(" Failed. stdout:"
|
|
124501
|
+
this.log.writeLine(" Failed. stdout:".concat(indent(ts.sys.newLine, stdout)).concat(ts.sys.newLine, " stderr:").concat(indent(ts.sys.newLine, stderr)));
|
|
124498
124502
|
return true;
|
|
124499
124503
|
}
|
|
124500
124504
|
};
|
|
@@ -124517,7 +124521,7 @@ var ts;
|
|
|
124517
124521
|
var log = new FileLog(logFilePath);
|
|
124518
124522
|
if (log.isEnabled()) {
|
|
124519
124523
|
process.on("uncaughtException", function (e) {
|
|
124520
|
-
log.writeLine("Unhandled exception: "
|
|
124524
|
+
log.writeLine("Unhandled exception: ".concat(e, " at ").concat(e.stack));
|
|
124521
124525
|
});
|
|
124522
124526
|
}
|
|
124523
124527
|
process.on("disconnect", function () {
|
|
@@ -124530,7 +124534,7 @@ var ts;
|
|
|
124530
124534
|
installer.listen();
|
|
124531
124535
|
function indent(newline, str) {
|
|
124532
124536
|
return str && str.length
|
|
124533
|
-
? newline
|
|
124537
|
+
? "".concat(newline, " ") + str.replace(/\r?\n/, "".concat(newline, " "))
|
|
124534
124538
|
: "";
|
|
124535
124539
|
}
|
|
124536
124540
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|