typescript 4.6.0-dev.20220208 → 4.6.1-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cancellationToken.js +1 -1
- package/lib/cs/diagnosticMessages.generated.json +1 -2
- package/lib/es/diagnosticMessages.generated.json +1 -2
- package/lib/fr/diagnosticMessages.generated.json +1 -2
- package/lib/it/diagnosticMessages.generated.json +1 -2
- package/lib/ja/diagnosticMessages.generated.json +1 -2
- package/lib/ko/diagnosticMessages.generated.json +1 -2
- package/lib/pl/diagnosticMessages.generated.json +1 -2
- package/lib/pt-br/diagnosticMessages.generated.json +1 -2
- package/lib/tr/diagnosticMessages.generated.json +1 -2
- package/lib/tsc.js +449 -355
- package/lib/tsserver.js +903 -685
- package/lib/tsserverlibrary.js +878 -660
- package/lib/typescript.js +783 -565
- package/lib/typescriptServices.js +783 -565
- package/lib/typingsInstaller.js +520 -415
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -2
- 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 = ts.versionMajorMinor
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".1-rc");
|
|
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");
|
|
@@ -5781,7 +5781,7 @@ var ts;
|
|
|
5781
5781
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
5782
5782
|
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
|
|
5783
5783
|
function getLevel(envVar, level) {
|
|
5784
|
-
return system.getEnvironmentVariable(envVar
|
|
5784
|
+
return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
|
|
5785
5785
|
}
|
|
5786
5786
|
function getCustomLevels(baseVariable) {
|
|
5787
5787
|
var customLevels;
|
|
@@ -6250,7 +6250,7 @@ var ts;
|
|
|
6250
6250
|
}
|
|
6251
6251
|
function onTimerToUpdateChildWatches() {
|
|
6252
6252
|
timerToUpdateChildWatches = undefined;
|
|
6253
|
-
sysLog("sysLog:: onTimerToUpdateChildWatches:: "
|
|
6253
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
|
|
6254
6254
|
var start = ts.timestamp();
|
|
6255
6255
|
var invokeMap = new ts.Map();
|
|
6256
6256
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6263,7 +6263,7 @@ var ts;
|
|
|
6263
6263
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6264
6264
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6265
6265
|
}
|
|
6266
|
-
sysLog("sysLog:: invokingWatchers:: Elapsed:: "
|
|
6266
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
|
|
6267
6267
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6268
6268
|
var existing = invokeMap.get(rootDirName);
|
|
6269
6269
|
if (existing) {
|
|
@@ -6279,7 +6279,7 @@ var ts;
|
|
|
6279
6279
|
}
|
|
6280
6280
|
});
|
|
6281
6281
|
var elapsed = ts.timestamp() - start;
|
|
6282
|
-
sysLog("sysLog:: Elapsed:: "
|
|
6282
|
+
sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
|
|
6283
6283
|
}
|
|
6284
6284
|
function removeChildWatches(parentWatcher) {
|
|
6285
6285
|
if (!parentWatcher)
|
|
@@ -6739,7 +6739,7 @@ var ts;
|
|
|
6739
6739
|
var remappedPaths = new ts.Map();
|
|
6740
6740
|
var normalizedDir = ts.normalizeSlashes(__dirname);
|
|
6741
6741
|
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
|
|
6742
|
-
var fileUrlRoot = "file://"
|
|
6742
|
+
var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
|
|
6743
6743
|
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
|
|
6744
6744
|
var node = _a[_i];
|
|
6745
6745
|
if (node.callFrame.url) {
|
|
@@ -6748,7 +6748,7 @@ var ts;
|
|
|
6748
6748
|
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
|
|
6749
6749
|
}
|
|
6750
6750
|
else if (!nativePattern.test(url)) {
|
|
6751
|
-
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external"
|
|
6751
|
+
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
|
|
6752
6752
|
externalFileCounter++;
|
|
6753
6753
|
}
|
|
6754
6754
|
}
|
|
@@ -6764,7 +6764,7 @@ var ts;
|
|
|
6764
6764
|
if (!err) {
|
|
6765
6765
|
try {
|
|
6766
6766
|
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
6767
|
-
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-")
|
|
6767
|
+
profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
|
|
6768
6768
|
}
|
|
6769
6769
|
}
|
|
6770
6770
|
catch (_c) {
|
|
@@ -6866,7 +6866,7 @@ var ts;
|
|
|
6866
6866
|
* @param createWatcher
|
|
6867
6867
|
*/
|
|
6868
6868
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
6869
|
-
sysLog("sysLog:: "
|
|
6869
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
|
|
6870
6870
|
// Call the callback for current directory
|
|
6871
6871
|
callback("rename", "");
|
|
6872
6872
|
// If watcher is not closed, update it
|
|
@@ -6891,7 +6891,7 @@ var ts;
|
|
|
6891
6891
|
}
|
|
6892
6892
|
}
|
|
6893
6893
|
if (hitSystemWatcherLimit) {
|
|
6894
|
-
sysLog("sysLog:: "
|
|
6894
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
|
|
6895
6895
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6896
6896
|
}
|
|
6897
6897
|
try {
|
|
@@ -6907,7 +6907,7 @@ var ts;
|
|
|
6907
6907
|
// 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
6908
|
// so instead of throwing error, use fs.watchFile
|
|
6909
6909
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
6910
|
-
sysLog("sysLog:: "
|
|
6910
|
+
sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
|
|
6911
6911
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
6912
6912
|
}
|
|
6913
6913
|
}
|
|
@@ -8034,10 +8034,10 @@ var ts;
|
|
|
8034
8034
|
A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."),
|
|
8035
8035
|
A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."),
|
|
8036
8036
|
An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, ts.DiagnosticCategory.Error, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."),
|
|
8037
|
-
|
|
8038
|
-
|
|
8037
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."),
|
|
8038
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."),
|
|
8039
8039
|
An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts.DiagnosticCategory.Error, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."),
|
|
8040
|
-
|
|
8040
|
+
A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, ts.DiagnosticCategory.Error, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."),
|
|
8041
8041
|
The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, ts.DiagnosticCategory.Error, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."),
|
|
8042
8042
|
The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, ts.DiagnosticCategory.Error, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."),
|
|
8043
8043
|
Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, ts.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."),
|
|
@@ -8069,6 +8069,7 @@ var ts;
|
|
|
8069
8069
|
An_optional_element_cannot_follow_a_rest_element: diag(1266, ts.DiagnosticCategory.Error, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."),
|
|
8070
8070
|
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
8071
|
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
|
+
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."),
|
|
8072
8073
|
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."),
|
|
8073
8074
|
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."),
|
|
8074
8075
|
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."),
|
|
@@ -8205,6 +8206,8 @@ var ts;
|
|
|
8205
8206
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8206
8207
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8207
8208
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
8209
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
8210
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
8208
8211
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8209
8212
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8210
8213
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -9625,6 +9628,9 @@ var ts;
|
|
|
9625
9628
|
Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
|
|
9626
9629
|
Add_undefined_to_optional_property_type: diag(95169, ts.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
|
|
9627
9630
|
Convert_named_imports_to_default_import: diag(95170, ts.DiagnosticCategory.Message, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"),
|
|
9631
|
+
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
9632
|
+
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
9633
|
+
Rename_param_tag_name_0_to_1: diag(95173, ts.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
|
|
9628
9634
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
9629
9635
|
Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9630
9636
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -9916,7 +9922,7 @@ var ts;
|
|
|
9916
9922
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
9917
9923
|
}
|
|
9918
9924
|
else {
|
|
9919
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
9925
|
+
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"));
|
|
9920
9926
|
}
|
|
9921
9927
|
}
|
|
9922
9928
|
var res = lineStarts[line] + character;
|
|
@@ -12806,7 +12812,7 @@ var ts;
|
|
|
12806
12812
|
: "linkplain";
|
|
12807
12813
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
12808
12814
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
12809
|
-
return "{@"
|
|
12815
|
+
return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
|
|
12810
12816
|
}
|
|
12811
12817
|
/**
|
|
12812
12818
|
* Gets the effective type parameters. If the node was parsed in a
|
|
@@ -13886,6 +13892,10 @@ var ts;
|
|
|
13886
13892
|
return undefined;
|
|
13887
13893
|
}
|
|
13888
13894
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
13895
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
13896
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
13897
|
+
}
|
|
13898
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
13889
13899
|
function createSymbolTable(symbols) {
|
|
13890
13900
|
var result = new ts.Map();
|
|
13891
13901
|
if (symbols) {
|
|
@@ -14059,11 +14069,11 @@ var ts;
|
|
|
14059
14069
|
}
|
|
14060
14070
|
function packageIdToPackageName(_a) {
|
|
14061
14071
|
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14062
|
-
return subModuleName ? name
|
|
14072
|
+
return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
|
|
14063
14073
|
}
|
|
14064
14074
|
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14065
14075
|
function packageIdToString(packageId) {
|
|
14066
|
-
return packageIdToPackageName(packageId)
|
|
14076
|
+
return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
|
|
14067
14077
|
}
|
|
14068
14078
|
ts.packageIdToString = packageIdToString;
|
|
14069
14079
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14121,6 +14131,10 @@ var ts;
|
|
|
14121
14131
|
return getSourceFileOfNode(module.valueDeclaration || getNonAugmentationDeclaration(module));
|
|
14122
14132
|
}
|
|
14123
14133
|
ts.getSourceFileOfModule = getSourceFileOfModule;
|
|
14134
|
+
function isPlainJsFile(file, checkJs) {
|
|
14135
|
+
return !!file && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */) && !file.checkJsDirective && checkJs === undefined;
|
|
14136
|
+
}
|
|
14137
|
+
ts.isPlainJsFile = isPlainJsFile;
|
|
14124
14138
|
function isStatementWithLocals(node) {
|
|
14125
14139
|
switch (node.kind) {
|
|
14126
14140
|
case 234 /* Block */:
|
|
@@ -14142,7 +14156,7 @@ var ts;
|
|
|
14142
14156
|
function nodePosToString(node) {
|
|
14143
14157
|
var file = getSourceFileOfNode(node);
|
|
14144
14158
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
14145
|
-
return file.fileName
|
|
14159
|
+
return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
|
|
14146
14160
|
}
|
|
14147
14161
|
ts.nodePosToString = nodePosToString;
|
|
14148
14162
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -14281,7 +14295,7 @@ var ts;
|
|
|
14281
14295
|
ts.isPinnedComment = isPinnedComment;
|
|
14282
14296
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
14283
14297
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
14284
|
-
""
|
|
14298
|
+
"".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
|
|
14285
14299
|
commentDirective,
|
|
14286
14300
|
]); }));
|
|
14287
14301
|
var usedLines = new ts.Map();
|
|
@@ -14298,10 +14312,10 @@ var ts;
|
|
|
14298
14312
|
});
|
|
14299
14313
|
}
|
|
14300
14314
|
function markUsed(line) {
|
|
14301
|
-
if (!directivesByLine.has(""
|
|
14315
|
+
if (!directivesByLine.has("".concat(line))) {
|
|
14302
14316
|
return false;
|
|
14303
14317
|
}
|
|
14304
|
-
usedLines.set(""
|
|
14318
|
+
usedLines.set("".concat(line), true);
|
|
14305
14319
|
return true;
|
|
14306
14320
|
}
|
|
14307
14321
|
}
|
|
@@ -14531,7 +14545,7 @@ var ts;
|
|
|
14531
14545
|
}
|
|
14532
14546
|
return node.text;
|
|
14533
14547
|
}
|
|
14534
|
-
return ts.Debug.fail("Literal kind '"
|
|
14548
|
+
return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
|
|
14535
14549
|
}
|
|
14536
14550
|
ts.getLiteralText = getLiteralText;
|
|
14537
14551
|
function canUseOriginalText(node, flags) {
|
|
@@ -17112,11 +17126,11 @@ var ts;
|
|
|
17112
17126
|
}
|
|
17113
17127
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
17114
17128
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
17115
|
-
return "__@"
|
|
17129
|
+
return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
|
|
17116
17130
|
}
|
|
17117
17131
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
17118
17132
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
17119
|
-
return "__#"
|
|
17133
|
+
return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
|
|
17120
17134
|
}
|
|
17121
17135
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
17122
17136
|
function isKnownSymbol(symbol) {
|
|
@@ -19818,7 +19832,7 @@ var ts;
|
|
|
19818
19832
|
}
|
|
19819
19833
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
19820
19834
|
function getJSXRuntimeImport(base, options) {
|
|
19821
|
-
return base ? base
|
|
19835
|
+
return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
19822
19836
|
}
|
|
19823
19837
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
19824
19838
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -19925,7 +19939,7 @@ var ts;
|
|
|
19925
19939
|
}
|
|
19926
19940
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
19927
19941
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
19928
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
19942
|
+
var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
|
|
19929
19943
|
var filesMatcher = {
|
|
19930
19944
|
/**
|
|
19931
19945
|
* Matches any single directory segment unless it is the last segment and a .min.js file
|
|
@@ -19938,7 +19952,7 @@ var ts;
|
|
|
19938
19952
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19939
19953
|
* files or directories, does not match subdirectories that start with a . character
|
|
19940
19954
|
*/
|
|
19941
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19955
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19942
19956
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
19943
19957
|
};
|
|
19944
19958
|
var directoriesMatcher = {
|
|
@@ -19947,7 +19961,7 @@ var ts;
|
|
|
19947
19961
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19948
19962
|
* files or directories, does not match subdirectories that start with a . character
|
|
19949
19963
|
*/
|
|
19950
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19964
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19951
19965
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
19952
19966
|
};
|
|
19953
19967
|
var excludeMatcher = {
|
|
@@ -19965,10 +19979,10 @@ var ts;
|
|
|
19965
19979
|
if (!patterns || !patterns.length) {
|
|
19966
19980
|
return undefined;
|
|
19967
19981
|
}
|
|
19968
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
19982
|
+
var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
|
|
19969
19983
|
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
|
|
19970
19984
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
19971
|
-
return "^("
|
|
19985
|
+
return "^(".concat(pattern, ")").concat(terminator);
|
|
19972
19986
|
}
|
|
19973
19987
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
19974
19988
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -19990,7 +20004,7 @@ var ts;
|
|
|
19990
20004
|
ts.isImplicitGlob = isImplicitGlob;
|
|
19991
20005
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
19992
20006
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
19993
|
-
return pattern && "^("
|
|
20007
|
+
return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
|
|
19994
20008
|
}
|
|
19995
20009
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
19996
20010
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -20068,7 +20082,7 @@ var ts;
|
|
|
20068
20082
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20069
20083
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
20070
20084
|
return {
|
|
20071
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
20085
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
|
|
20072
20086
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20073
20087
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20074
20088
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -20349,7 +20363,7 @@ var ts;
|
|
|
20349
20363
|
*/
|
|
20350
20364
|
function extensionFromPath(path) {
|
|
20351
20365
|
var ext = tryGetExtensionFromPath(path);
|
|
20352
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
20366
|
+
return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
|
|
20353
20367
|
}
|
|
20354
20368
|
ts.extensionFromPath = extensionFromPath;
|
|
20355
20369
|
function isAnySupportedFileExtension(path) {
|
|
@@ -26432,7 +26446,7 @@ var ts;
|
|
|
26432
26446
|
case 326 /* JSDocAugmentsTag */: return "augments";
|
|
26433
26447
|
case 327 /* JSDocImplementsTag */: return "implements";
|
|
26434
26448
|
default:
|
|
26435
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
26449
|
+
return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
|
|
26436
26450
|
}
|
|
26437
26451
|
}
|
|
26438
26452
|
var rawTextScanner;
|
|
@@ -26760,7 +26774,7 @@ var ts;
|
|
|
26760
26774
|
};
|
|
26761
26775
|
var definedTextGetter_1 = function (path) {
|
|
26762
26776
|
var result = textGetter_1(path);
|
|
26763
|
-
return result !== undefined ? result : "/* Input file "
|
|
26777
|
+
return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
|
|
26764
26778
|
};
|
|
26765
26779
|
var buildInfo_1;
|
|
26766
26780
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -31298,7 +31312,7 @@ var ts;
|
|
|
31298
31312
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
31299
31313
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
31300
31314
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
31301
|
-
return keyword
|
|
31315
|
+
return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
|
|
31302
31316
|
}
|
|
31303
31317
|
}
|
|
31304
31318
|
return undefined;
|
|
@@ -38068,7 +38082,7 @@ var ts;
|
|
|
38068
38082
|
if (namedArgRegExCache.has(name)) {
|
|
38069
38083
|
return namedArgRegExCache.get(name);
|
|
38070
38084
|
}
|
|
38071
|
-
var result = new RegExp("(\\s"
|
|
38085
|
+
var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
|
|
38072
38086
|
namedArgRegExCache.set(name, result);
|
|
38073
38087
|
return result;
|
|
38074
38088
|
}
|
|
@@ -39546,8 +39560,8 @@ var ts;
|
|
|
39546
39560
|
}
|
|
39547
39561
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
39548
39562
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
39549
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
39550
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
39563
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
|
|
39564
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
|
|
39551
39565
|
}
|
|
39552
39566
|
/* @internal */
|
|
39553
39567
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -40341,10 +40355,10 @@ var ts;
|
|
|
40341
40355
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
40342
40356
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
40343
40357
|
if (newValue !== defaultValue) {
|
|
40344
|
-
result.push(""
|
|
40358
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
|
|
40345
40359
|
}
|
|
40346
40360
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
40347
|
-
result.push(""
|
|
40361
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
|
|
40348
40362
|
}
|
|
40349
40363
|
});
|
|
40350
40364
|
return result.join(newLine) + newLine;
|
|
@@ -40395,19 +40409,19 @@ var ts;
|
|
|
40395
40409
|
if (entries.length !== 0) {
|
|
40396
40410
|
entries.push({ value: "" });
|
|
40397
40411
|
}
|
|
40398
|
-
entries.push({ value: "/* "
|
|
40412
|
+
entries.push({ value: "/* ".concat(category, " */") });
|
|
40399
40413
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
40400
40414
|
var option = options_1[_i];
|
|
40401
40415
|
var optionName = void 0;
|
|
40402
40416
|
if (compilerOptionsMap.has(option.name)) {
|
|
40403
|
-
optionName = "\""
|
|
40417
|
+
optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
40404
40418
|
}
|
|
40405
40419
|
else {
|
|
40406
|
-
optionName = "// \""
|
|
40420
|
+
optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
|
|
40407
40421
|
}
|
|
40408
40422
|
entries.push({
|
|
40409
40423
|
value: optionName,
|
|
40410
|
-
description: "/* "
|
|
40424
|
+
description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
|
|
40411
40425
|
});
|
|
40412
40426
|
marginLength = Math.max(optionName.length, marginLength);
|
|
40413
40427
|
}
|
|
@@ -40416,25 +40430,25 @@ var ts;
|
|
|
40416
40430
|
var tab = makePadding(2);
|
|
40417
40431
|
var result = [];
|
|
40418
40432
|
result.push("{");
|
|
40419
|
-
result.push(tab
|
|
40420
|
-
result.push(""
|
|
40433
|
+
result.push("".concat(tab, "\"compilerOptions\": {"));
|
|
40434
|
+
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), " */"));
|
|
40421
40435
|
result.push("");
|
|
40422
40436
|
// Print out each row, aligning all the descriptions on the same column.
|
|
40423
40437
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
40424
40438
|
var entry = entries_2[_a];
|
|
40425
40439
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
40426
|
-
result.push(value && ""
|
|
40440
|
+
result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
|
|
40427
40441
|
}
|
|
40428
40442
|
if (fileNames.length) {
|
|
40429
|
-
result.push(tab
|
|
40430
|
-
result.push(tab
|
|
40443
|
+
result.push("".concat(tab, "},"));
|
|
40444
|
+
result.push("".concat(tab, "\"files\": ["));
|
|
40431
40445
|
for (var i = 0; i < fileNames.length; i++) {
|
|
40432
|
-
result.push(""
|
|
40446
|
+
result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
|
|
40433
40447
|
}
|
|
40434
|
-
result.push(tab
|
|
40448
|
+
result.push("".concat(tab, "]"));
|
|
40435
40449
|
}
|
|
40436
40450
|
else {
|
|
40437
|
-
result.push(tab
|
|
40451
|
+
result.push("".concat(tab, "}"));
|
|
40438
40452
|
}
|
|
40439
40453
|
result.push("}");
|
|
40440
40454
|
return result.join(newLine) + newLine;
|
|
@@ -40832,7 +40846,7 @@ var ts;
|
|
|
40832
40846
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
40833
40847
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
40834
40848
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
|
|
40835
|
-
extendedConfigPath = extendedConfigPath
|
|
40849
|
+
extendedConfigPath = "".concat(extendedConfigPath, ".json");
|
|
40836
40850
|
if (!host.fileExists(extendedConfigPath)) {
|
|
40837
40851
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
40838
40852
|
return undefined;
|
|
@@ -41077,7 +41091,7 @@ var ts;
|
|
|
41077
41091
|
// Valid only if *.json specified
|
|
41078
41092
|
if (!jsonOnlyIncludeRegexes) {
|
|
41079
41093
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
|
|
41080
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
41094
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
|
|
41081
41095
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
41082
41096
|
}
|
|
41083
41097
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -41513,7 +41527,7 @@ var ts;
|
|
|
41513
41527
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
41514
41528
|
if (typeof bestVersionPaths !== "object") {
|
|
41515
41529
|
if (state.traceEnabled) {
|
|
41516
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
41530
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
|
|
41517
41531
|
}
|
|
41518
41532
|
return;
|
|
41519
41533
|
}
|
|
@@ -41920,7 +41934,7 @@ var ts;
|
|
|
41920
41934
|
};
|
|
41921
41935
|
return cache;
|
|
41922
41936
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
41923
|
-
var result = mode === undefined ? specifier : mode
|
|
41937
|
+
var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
|
|
41924
41938
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
41925
41939
|
return result;
|
|
41926
41940
|
}
|
|
@@ -41951,7 +41965,7 @@ var ts;
|
|
|
41951
41965
|
}
|
|
41952
41966
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
41953
41967
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
41954
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode
|
|
41968
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
|
|
41955
41969
|
}
|
|
41956
41970
|
function createPerModuleNameCache() {
|
|
41957
41971
|
var directoryPathMap = new ts.Map();
|
|
@@ -42098,10 +42112,10 @@ var ts;
|
|
|
42098
42112
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42099
42113
|
break;
|
|
42100
42114
|
default:
|
|
42101
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
42115
|
+
return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
|
|
42102
42116
|
}
|
|
42103
42117
|
if (result && result.resolvedModule)
|
|
42104
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
42118
|
+
ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
|
|
42105
42119
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
42106
42120
|
if (perFolderCache) {
|
|
42107
42121
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -42304,7 +42318,7 @@ var ts;
|
|
|
42304
42318
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
42305
42319
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
42306
42320
|
if (!resolvedModule) {
|
|
42307
|
-
throw new Error("Could not resolve JS module '"
|
|
42321
|
+
throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
|
|
42308
42322
|
}
|
|
42309
42323
|
return resolvedModule.resolvedFileName;
|
|
42310
42324
|
}
|
|
@@ -42414,7 +42428,7 @@ var ts;
|
|
|
42414
42428
|
if (traceEnabled) {
|
|
42415
42429
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
42416
42430
|
}
|
|
42417
|
-
ts.Debug.assert(host.fileExists(real), path
|
|
42431
|
+
ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
|
|
42418
42432
|
return real;
|
|
42419
42433
|
}
|
|
42420
42434
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -42891,7 +42905,7 @@ var ts;
|
|
|
42891
42905
|
return undefined;
|
|
42892
42906
|
}
|
|
42893
42907
|
var trailingParts = parts.slice(nameParts.length);
|
|
42894
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
42908
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
42895
42909
|
}
|
|
42896
42910
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
42897
42911
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -43219,7 +43233,7 @@ var ts;
|
|
|
43219
43233
|
}
|
|
43220
43234
|
/* @internal */
|
|
43221
43235
|
function getTypesPackageName(packageName) {
|
|
43222
|
-
return "@types/"
|
|
43236
|
+
return "@types/".concat(mangleScopedPackageName(packageName));
|
|
43223
43237
|
}
|
|
43224
43238
|
ts.getTypesPackageName = getTypesPackageName;
|
|
43225
43239
|
/* @internal */
|
|
@@ -43620,7 +43634,7 @@ var ts;
|
|
|
43620
43634
|
if (name) {
|
|
43621
43635
|
if (ts.isAmbientModule(node)) {
|
|
43622
43636
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
43623
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
43637
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
|
|
43624
43638
|
}
|
|
43625
43639
|
if (name.kind === 161 /* ComputedPropertyName */) {
|
|
43626
43640
|
var nameExpression = name.expression;
|
|
@@ -43677,7 +43691,7 @@ var ts;
|
|
|
43677
43691
|
case 163 /* Parameter */:
|
|
43678
43692
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43679
43693
|
// without names can only come from JSDocFunctionTypes.
|
|
43680
|
-
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: "
|
|
43694
|
+
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"); });
|
|
43681
43695
|
var functionType = node.parent;
|
|
43682
43696
|
var index = functionType.parameters.indexOf(node);
|
|
43683
43697
|
return "arg" + index;
|
|
@@ -43789,7 +43803,7 @@ var ts;
|
|
|
43789
43803
|
var relatedInformation_1 = [];
|
|
43790
43804
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
43791
43805
|
// export type T; - may have meant export type { T }?
|
|
43792
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
43806
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
|
|
43793
43807
|
}
|
|
43794
43808
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
43795
43809
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -45865,7 +45879,7 @@ var ts;
|
|
|
45865
45879
|
}
|
|
45866
45880
|
}
|
|
45867
45881
|
function bindSourceFileAsExternalModule() {
|
|
45868
|
-
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\""
|
|
45882
|
+
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
|
|
45869
45883
|
}
|
|
45870
45884
|
function bindExportAssignment(node) {
|
|
45871
45885
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -46898,6 +46912,9 @@ var ts;
|
|
|
46898
46912
|
CheckMode[CheckMode["SkipContextSensitive"] = 4] = "SkipContextSensitive";
|
|
46899
46913
|
CheckMode[CheckMode["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
|
|
46900
46914
|
CheckMode[CheckMode["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
|
|
46915
|
+
CheckMode[CheckMode["RestBindingElement"] = 32] = "RestBindingElement";
|
|
46916
|
+
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
|
|
46917
|
+
// we need to preserve generic types instead of substituting them for constraints
|
|
46901
46918
|
})(CheckMode || (CheckMode = {}));
|
|
46902
46919
|
var SignatureCheckMode;
|
|
46903
46920
|
(function (SignatureCheckMode) {
|
|
@@ -47950,30 +47967,34 @@ var ts;
|
|
|
47950
47967
|
else { // error
|
|
47951
47968
|
var isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */);
|
|
47952
47969
|
var isEitherBlockScoped_1 = !!(target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */);
|
|
47953
|
-
var message = isEitherEnum
|
|
47954
|
-
? ts.Diagnostics.
|
|
47955
|
-
: isEitherBlockScoped_1
|
|
47956
|
-
? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
47970
|
+
var message = isEitherEnum ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
|
|
47971
|
+
: isEitherBlockScoped_1 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
47957
47972
|
: ts.Diagnostics.Duplicate_identifier_0;
|
|
47958
47973
|
var sourceSymbolFile = source.declarations && ts.getSourceFileOfNode(source.declarations[0]);
|
|
47959
47974
|
var targetSymbolFile = target.declarations && ts.getSourceFileOfNode(target.declarations[0]);
|
|
47975
|
+
var isSourcePlainJs = ts.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
|
|
47976
|
+
var isTargetPlainJs = ts.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
|
|
47960
47977
|
var symbolName_1 = symbolToString(source);
|
|
47961
47978
|
// Collect top-level duplicate identifier errors into one mapping, so we can then merge their diagnostics if there are a bunch
|
|
47962
47979
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
47963
47980
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
|
|
47964
47981
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
47965
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path
|
|
47982
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
|
|
47966
47983
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
47967
47984
|
});
|
|
47968
47985
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
47969
47986
|
return ({ isBlockScoped: isEitherBlockScoped_1, firstFileLocations: [], secondFileLocations: [] });
|
|
47970
47987
|
});
|
|
47971
|
-
|
|
47972
|
-
|
|
47988
|
+
if (!isSourcePlainJs)
|
|
47989
|
+
addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
|
|
47990
|
+
if (!isTargetPlainJs)
|
|
47991
|
+
addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
|
|
47973
47992
|
}
|
|
47974
47993
|
else {
|
|
47975
|
-
|
|
47976
|
-
|
|
47994
|
+
if (!isSourcePlainJs)
|
|
47995
|
+
addDuplicateDeclarationErrorsForSymbols(source, message, symbolName_1, target);
|
|
47996
|
+
if (!isTargetPlainJs)
|
|
47997
|
+
addDuplicateDeclarationErrorsForSymbols(target, message, symbolName_1, source);
|
|
47977
47998
|
}
|
|
47978
47999
|
}
|
|
47979
48000
|
return target;
|
|
@@ -48430,6 +48451,8 @@ var ts;
|
|
|
48430
48451
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48431
48452
|
? lastLocation === location.type ||
|
|
48432
48453
|
lastLocation.kind === 163 /* Parameter */ ||
|
|
48454
|
+
lastLocation.kind === 338 /* JSDocParameterTag */ ||
|
|
48455
|
+
lastLocation.kind === 339 /* JSDocReturnTag */ ||
|
|
48433
48456
|
lastLocation.kind === 162 /* TypeParameter */
|
|
48434
48457
|
// local types not visible outside the function body
|
|
48435
48458
|
: false;
|
|
@@ -48689,9 +48712,9 @@ var ts;
|
|
|
48689
48712
|
lastSelfReferenceLocation = location;
|
|
48690
48713
|
}
|
|
48691
48714
|
lastLocation = location;
|
|
48692
|
-
location = ts.isJSDocTemplateTag(location) ?
|
|
48693
|
-
ts.
|
|
48694
|
-
|
|
48715
|
+
location = ts.isJSDocTemplateTag(location) ? ts.getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
|
|
48716
|
+
ts.isJSDocParameterTag(location) || ts.isJSDocReturnTag(location) ? ts.getHostSignatureFromJSDoc(location) || location.parent :
|
|
48717
|
+
location.parent;
|
|
48695
48718
|
}
|
|
48696
48719
|
// We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`.
|
|
48697
48720
|
// If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself.
|
|
@@ -49825,16 +49848,20 @@ var ts;
|
|
|
49825
49848
|
return;
|
|
49826
49849
|
}
|
|
49827
49850
|
var host = ts.getJSDocHost(node);
|
|
49828
|
-
if (host &&
|
|
49829
|
-
|
|
49830
|
-
ts.isBinaryExpression(host.expression) &&
|
|
49831
|
-
ts.getAssignmentDeclarationKind(host.expression) === 3 /* PrototypeProperty */) {
|
|
49832
|
-
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
|
|
49851
|
+
if (host && ts.isExpressionStatement(host) && ts.isPrototypePropertyAssignment(host.expression)) {
|
|
49852
|
+
// /** @param {K} p */ X.prototype.m = function () { } <-- look for K on X's declaration
|
|
49833
49853
|
var symbol = getSymbolOfNode(host.expression.left);
|
|
49834
49854
|
if (symbol) {
|
|
49835
49855
|
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
49836
49856
|
}
|
|
49837
49857
|
}
|
|
49858
|
+
if (host && ts.isFunctionExpression(host) && ts.isPrototypePropertyAssignment(host.parent) && ts.isExpressionStatement(host.parent.parent)) {
|
|
49859
|
+
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
|
|
49860
|
+
var symbol = getSymbolOfNode(host.parent.left);
|
|
49861
|
+
if (symbol) {
|
|
49862
|
+
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
49863
|
+
}
|
|
49864
|
+
}
|
|
49838
49865
|
if (host && (ts.isObjectLiteralMethod(host) || ts.isPropertyAssignment(host)) &&
|
|
49839
49866
|
ts.isBinaryExpression(host.parent.parent) &&
|
|
49840
49867
|
ts.getAssignmentDeclarationKind(host.parent.parent) === 6 /* Prototype */) {
|
|
@@ -50605,7 +50632,7 @@ var ts;
|
|
|
50605
50632
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
50606
50633
|
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
|
|
50607
50634
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
50608
|
-
var key = (useOnlyExternalAliasing ? 0 : 1
|
|
50635
|
+
var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
|
|
50609
50636
|
if (cache.has(key)) {
|
|
50610
50637
|
return cache.get(key);
|
|
50611
50638
|
}
|
|
@@ -51454,7 +51481,7 @@ var ts;
|
|
|
51454
51481
|
context.symbolDepth = new ts.Map();
|
|
51455
51482
|
}
|
|
51456
51483
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
51457
|
-
var key = getTypeId(type)
|
|
51484
|
+
var key = "".concat(getTypeId(type), "|").concat(context.flags);
|
|
51458
51485
|
if (links) {
|
|
51459
51486
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
51460
51487
|
}
|
|
@@ -51723,7 +51750,7 @@ var ts;
|
|
|
51723
51750
|
}
|
|
51724
51751
|
}
|
|
51725
51752
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
51726
|
-
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... "
|
|
51753
|
+
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
|
|
51727
51754
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
51728
51755
|
break;
|
|
51729
51756
|
}
|
|
@@ -51838,7 +51865,7 @@ var ts;
|
|
|
51838
51865
|
else if (types.length > 2) {
|
|
51839
51866
|
return [
|
|
51840
51867
|
typeToTypeNodeHelper(types[0], context),
|
|
51841
|
-
ts.factory.createTypeReferenceNode("... "
|
|
51868
|
+
ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
|
|
51842
51869
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
51843
51870
|
];
|
|
51844
51871
|
}
|
|
@@ -51852,7 +51879,7 @@ var ts;
|
|
|
51852
51879
|
var type = types_2[_i];
|
|
51853
51880
|
i++;
|
|
51854
51881
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
51855
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
51882
|
+
result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
|
|
51856
51883
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
51857
51884
|
if (typeNode_1) {
|
|
51858
51885
|
result_5.push(typeNode_1);
|
|
@@ -52375,7 +52402,7 @@ var ts;
|
|
|
52375
52402
|
var text = rawtext;
|
|
52376
52403
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
52377
52404
|
i++;
|
|
52378
|
-
text = rawtext
|
|
52405
|
+
text = "".concat(rawtext, "_").concat(i);
|
|
52379
52406
|
}
|
|
52380
52407
|
if (text !== rawtext) {
|
|
52381
52408
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -52695,7 +52722,7 @@ var ts;
|
|
|
52695
52722
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
52696
52723
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
52697
52724
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
52698
|
-
: "arg"
|
|
52725
|
+
: "arg".concat(index);
|
|
52699
52726
|
}
|
|
52700
52727
|
function rewriteModuleSpecifier(parent, lit) {
|
|
52701
52728
|
if (bundled) {
|
|
@@ -53780,7 +53807,7 @@ var ts;
|
|
|
53780
53807
|
return results_1;
|
|
53781
53808
|
}
|
|
53782
53809
|
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
|
|
53783
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
53810
|
+
return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
|
|
53784
53811
|
};
|
|
53785
53812
|
}
|
|
53786
53813
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -53855,7 +53882,7 @@ var ts;
|
|
|
53855
53882
|
if (ref) {
|
|
53856
53883
|
return ref;
|
|
53857
53884
|
}
|
|
53858
|
-
var tempName = getUnusedName(rootName
|
|
53885
|
+
var tempName = getUnusedName("".concat(rootName, "_base"));
|
|
53859
53886
|
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
|
|
53860
53887
|
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
|
|
53861
53888
|
], 2 /* Const */));
|
|
@@ -53902,7 +53929,7 @@ var ts;
|
|
|
53902
53929
|
var original = input;
|
|
53903
53930
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
53904
53931
|
i++;
|
|
53905
|
-
input = original
|
|
53932
|
+
input = "".concat(original, "_").concat(i);
|
|
53906
53933
|
}
|
|
53907
53934
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
53908
53935
|
if (id) {
|
|
@@ -54010,15 +54037,15 @@ var ts;
|
|
|
54010
54037
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
54011
54038
|
var name = "" + nameType.value;
|
|
54012
54039
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
54013
|
-
return "\""
|
|
54040
|
+
return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
|
|
54014
54041
|
}
|
|
54015
54042
|
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
54016
|
-
return "["
|
|
54043
|
+
return "[".concat(name, "]");
|
|
54017
54044
|
}
|
|
54018
54045
|
return name;
|
|
54019
54046
|
}
|
|
54020
54047
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
54021
|
-
return "["
|
|
54048
|
+
return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
|
|
54022
54049
|
}
|
|
54023
54050
|
}
|
|
54024
54051
|
}
|
|
@@ -54321,9 +54348,12 @@ var ts;
|
|
|
54321
54348
|
}
|
|
54322
54349
|
// Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
|
|
54323
54350
|
// assigned by contextual typing.
|
|
54324
|
-
function getTypeForBindingElementParent(node) {
|
|
54351
|
+
function getTypeForBindingElementParent(node, checkMode) {
|
|
54352
|
+
if (checkMode !== 0 /* Normal */) {
|
|
54353
|
+
return getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
|
|
54354
|
+
}
|
|
54325
54355
|
var symbol = getSymbolOfNode(node);
|
|
54326
|
-
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false);
|
|
54356
|
+
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
|
|
54327
54357
|
}
|
|
54328
54358
|
function getRestType(source, properties, symbol) {
|
|
54329
54359
|
source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); });
|
|
@@ -54441,7 +54471,8 @@ var ts;
|
|
|
54441
54471
|
}
|
|
54442
54472
|
/** Return the inferred type for a binding element */
|
|
54443
54473
|
function getTypeForBindingElement(declaration) {
|
|
54444
|
-
var
|
|
54474
|
+
var checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
54475
|
+
var parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
54445
54476
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
54446
54477
|
}
|
|
54447
54478
|
function getBindingElementTypeFromParentType(declaration, parentType) {
|
|
@@ -54513,9 +54544,9 @@ var ts;
|
|
|
54513
54544
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
54514
54545
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
54515
54546
|
// undefined from the final type.
|
|
54516
|
-
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
|
|
54547
|
+
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
|
|
54517
54548
|
}
|
|
54518
|
-
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration)], 2 /* Subtype */));
|
|
54549
|
+
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
54519
54550
|
}
|
|
54520
54551
|
function getTypeForDeclarationFromJSDocComment(declaration) {
|
|
54521
54552
|
var jsdocType = ts.getJSDocType(declaration);
|
|
@@ -54538,11 +54569,11 @@ var ts;
|
|
|
54538
54569
|
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
|
|
54539
54570
|
}
|
|
54540
54571
|
// Return the inferred type for a variable, parameter, or property declaration
|
|
54541
|
-
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
|
54572
|
+
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
|
|
54542
54573
|
// A variable declared in a for..in statement is of type string, or of type keyof T when the
|
|
54543
54574
|
// right hand expression is of a type parameter type.
|
|
54544
54575
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 242 /* ForInStatement */) {
|
|
54545
|
-
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
|
|
54576
|
+
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, /*checkMode*/ checkMode)));
|
|
54546
54577
|
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
|
|
54547
54578
|
}
|
|
54548
54579
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 243 /* ForOfStatement */) {
|
|
@@ -54597,12 +54628,9 @@ var ts;
|
|
|
54597
54628
|
}
|
|
54598
54629
|
}
|
|
54599
54630
|
if (ts.isInJSFile(declaration)) {
|
|
54600
|
-
var
|
|
54601
|
-
if (
|
|
54602
|
-
|
|
54603
|
-
var pos = func.parameters.indexOf(declaration);
|
|
54604
|
-
return declaration.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
54605
|
-
}
|
|
54631
|
+
var type_1 = getParameterTypeOfTypeTag(func, declaration);
|
|
54632
|
+
if (type_1)
|
|
54633
|
+
return type_1;
|
|
54606
54634
|
}
|
|
54607
54635
|
// Use contextual parameter type if one is available
|
|
54608
54636
|
var type = declaration.symbol.escapedName === "this" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
@@ -54619,7 +54647,7 @@ var ts;
|
|
|
54619
54647
|
return containerObjectType;
|
|
54620
54648
|
}
|
|
54621
54649
|
}
|
|
54622
|
-
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));
|
|
54650
|
+
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
|
|
54623
54651
|
return addOptionality(type, isProperty, isOptional);
|
|
54624
54652
|
}
|
|
54625
54653
|
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
|
|
@@ -54991,7 +55019,7 @@ var ts;
|
|
|
54991
55019
|
// contextual type or, if the element itself is a binding pattern, with the type implied by that binding
|
|
54992
55020
|
// pattern.
|
|
54993
55021
|
var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;
|
|
54994
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, contextualType)));
|
|
55022
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
|
|
54995
55023
|
}
|
|
54996
55024
|
if (ts.isBindingPattern(element.name)) {
|
|
54997
55025
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
|
|
@@ -55080,7 +55108,7 @@ var ts;
|
|
|
55080
55108
|
// binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the
|
|
55081
55109
|
// tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.
|
|
55082
55110
|
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
|
55083
|
-
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);
|
|
55111
|
+
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true, 0 /* Normal */), declaration, reportErrors);
|
|
55084
55112
|
}
|
|
55085
55113
|
function isGlobalSymbolConstructor(node) {
|
|
55086
55114
|
var symbol = getSymbolOfNode(node);
|
|
@@ -55169,9 +55197,9 @@ var ts;
|
|
|
55169
55197
|
if (typeNode === undefined) {
|
|
55170
55198
|
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
55171
55199
|
}
|
|
55172
|
-
var
|
|
55200
|
+
var type_2 = getTypeOfNode(typeNode);
|
|
55173
55201
|
// an errorType will make `checkTryStatement` issue an error
|
|
55174
|
-
return isTypeAny(
|
|
55202
|
+
return isTypeAny(type_2) || type_2 === unknownType ? type_2 : errorType;
|
|
55175
55203
|
}
|
|
55176
55204
|
// Handle export default expressions
|
|
55177
55205
|
if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {
|
|
@@ -55309,10 +55337,12 @@ var ts;
|
|
|
55309
55337
|
if (writing === void 0) { writing = false; }
|
|
55310
55338
|
var getter = ts.getDeclarationOfKind(symbol, 171 /* GetAccessor */);
|
|
55311
55339
|
var setter = ts.getDeclarationOfKind(symbol, 172 /* SetAccessor */);
|
|
55312
|
-
var setterType = getAnnotatedAccessorType(setter);
|
|
55313
55340
|
// For write operations, prioritize type annotations on the setter
|
|
55314
|
-
if (writing
|
|
55315
|
-
|
|
55341
|
+
if (writing) {
|
|
55342
|
+
var setterType_1 = getAnnotatedAccessorType(setter);
|
|
55343
|
+
if (setterType_1) {
|
|
55344
|
+
return instantiateTypeIfNeeded(setterType_1, symbol);
|
|
55345
|
+
}
|
|
55316
55346
|
}
|
|
55317
55347
|
// Else defer to the getter type
|
|
55318
55348
|
if (getter && ts.isInJSFile(getter)) {
|
|
@@ -55327,6 +55357,7 @@ var ts;
|
|
|
55327
55357
|
return instantiateTypeIfNeeded(getterType, symbol);
|
|
55328
55358
|
}
|
|
55329
55359
|
// If the user didn't specify a return type, try to use the set-accessor's parameter type.
|
|
55360
|
+
var setterType = getAnnotatedAccessorType(setter);
|
|
55330
55361
|
if (setterType) {
|
|
55331
55362
|
return setterType;
|
|
55332
55363
|
}
|
|
@@ -55397,11 +55428,11 @@ var ts;
|
|
|
55397
55428
|
return errorType;
|
|
55398
55429
|
}
|
|
55399
55430
|
var exportEquals = getMergedSymbol(symbol.exports.get("export=" /* ExportEquals */));
|
|
55400
|
-
var
|
|
55431
|
+
var type_3 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
|
|
55401
55432
|
if (!popTypeResolution()) {
|
|
55402
55433
|
return reportCircularityError(symbol);
|
|
55403
55434
|
}
|
|
55404
|
-
return
|
|
55435
|
+
return type_3;
|
|
55405
55436
|
}
|
|
55406
55437
|
}
|
|
55407
55438
|
var type = createObjectType(16 /* Anonymous */, symbol);
|
|
@@ -55475,6 +55506,39 @@ var ts;
|
|
|
55475
55506
|
}
|
|
55476
55507
|
return links.type;
|
|
55477
55508
|
}
|
|
55509
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
55510
|
+
var links = getSymbolLinks(symbol);
|
|
55511
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
55512
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
55513
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
55514
|
+
links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
55515
|
+
}
|
|
55516
|
+
return links.writeType;
|
|
55517
|
+
}
|
|
55518
|
+
/**
|
|
55519
|
+
* Distinct write types come only from set accessors, but union and intersection
|
|
55520
|
+
* properties deriving from set accessors will either pre-compute or defer the
|
|
55521
|
+
* union or intersection of the writeTypes of their constituents. To account for
|
|
55522
|
+
* this, we will assume that any deferred type or transient symbol may have a
|
|
55523
|
+
* `writeType` (or a deferred write type ready to be computed) that should be
|
|
55524
|
+
* used before looking for set accessor declarations.
|
|
55525
|
+
*/
|
|
55526
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
55527
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
55528
|
+
if (checkFlags & 65536 /* DeferredType */) {
|
|
55529
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
55530
|
+
if (writeType) {
|
|
55531
|
+
return writeType;
|
|
55532
|
+
}
|
|
55533
|
+
}
|
|
55534
|
+
if (symbol.flags & 33554432 /* Transient */) {
|
|
55535
|
+
var writeType = symbol.writeType;
|
|
55536
|
+
if (writeType) {
|
|
55537
|
+
return writeType;
|
|
55538
|
+
}
|
|
55539
|
+
}
|
|
55540
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
55541
|
+
}
|
|
55478
55542
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
55479
55543
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
55480
55544
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -56812,7 +56876,7 @@ var ts;
|
|
|
56812
56876
|
!leftName ? rightName :
|
|
56813
56877
|
!rightName ? leftName :
|
|
56814
56878
|
undefined;
|
|
56815
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
56879
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
56816
56880
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
56817
56881
|
params[i] = paramSymbol;
|
|
56818
56882
|
}
|
|
@@ -57600,10 +57664,10 @@ var ts;
|
|
|
57600
57664
|
var baseTypes = [];
|
|
57601
57665
|
var different = false;
|
|
57602
57666
|
for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
|
|
57603
|
-
var
|
|
57604
|
-
var baseType = getBaseConstraint(
|
|
57667
|
+
var type_4 = types_7[_i];
|
|
57668
|
+
var baseType = getBaseConstraint(type_4);
|
|
57605
57669
|
if (baseType) {
|
|
57606
|
-
if (baseType !==
|
|
57670
|
+
if (baseType !== type_4) {
|
|
57607
57671
|
different = true;
|
|
57608
57672
|
}
|
|
57609
57673
|
baseTypes.push(baseType);
|
|
@@ -57845,6 +57909,7 @@ var ts;
|
|
|
57845
57909
|
var firstType;
|
|
57846
57910
|
var nameType;
|
|
57847
57911
|
var propTypes = [];
|
|
57912
|
+
var writeTypes;
|
|
57848
57913
|
var firstValueDeclaration;
|
|
57849
57914
|
var hasNonUniformValueDeclaration = false;
|
|
57850
57915
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -57861,6 +57926,10 @@ var ts;
|
|
|
57861
57926
|
firstType = type;
|
|
57862
57927
|
nameType = getSymbolLinks(prop).nameType;
|
|
57863
57928
|
}
|
|
57929
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
57930
|
+
if (writeTypes || writeType !== type) {
|
|
57931
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
57932
|
+
}
|
|
57864
57933
|
else if (type !== firstType) {
|
|
57865
57934
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
57866
57935
|
}
|
|
@@ -57889,9 +57958,13 @@ var ts;
|
|
|
57889
57958
|
result.checkFlags |= 65536 /* DeferredType */;
|
|
57890
57959
|
result.deferralParent = containingType;
|
|
57891
57960
|
result.deferralConstituents = propTypes;
|
|
57961
|
+
result.deferralWriteConstituents = writeTypes;
|
|
57892
57962
|
}
|
|
57893
57963
|
else {
|
|
57894
57964
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
57965
|
+
if (writeTypes) {
|
|
57966
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
57967
|
+
}
|
|
57895
57968
|
}
|
|
57896
57969
|
return result;
|
|
57897
57970
|
}
|
|
@@ -58307,6 +58380,13 @@ var ts;
|
|
|
58307
58380
|
var typeTag = ts.getJSDocTypeTag(node);
|
|
58308
58381
|
return (typeTag === null || typeTag === void 0 ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
|
|
58309
58382
|
}
|
|
58383
|
+
function getParameterTypeOfTypeTag(func, parameter) {
|
|
58384
|
+
var signature = getSignatureOfTypeTag(func);
|
|
58385
|
+
if (!signature)
|
|
58386
|
+
return undefined;
|
|
58387
|
+
var pos = func.parameters.indexOf(parameter);
|
|
58388
|
+
return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
58389
|
+
}
|
|
58310
58390
|
function getReturnTypeOfTypeTag(node) {
|
|
58311
58391
|
var signature = getSignatureOfTypeTag(node);
|
|
58312
58392
|
return signature && getReturnTypeOfSignature(signature);
|
|
@@ -58747,7 +58827,7 @@ var ts;
|
|
|
58747
58827
|
return result;
|
|
58748
58828
|
}
|
|
58749
58829
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
58750
|
-
return aliasSymbol ? "@"
|
|
58830
|
+
return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
|
|
58751
58831
|
}
|
|
58752
58832
|
// This function is used to propagate certain flags when creating new object type references and union types.
|
|
58753
58833
|
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
|
|
@@ -58933,7 +59013,7 @@ var ts;
|
|
|
58933
59013
|
return undefined;
|
|
58934
59014
|
}
|
|
58935
59015
|
function getSymbolPath(symbol) {
|
|
58936
|
-
return symbol.parent ? getSymbolPath(symbol.parent)
|
|
59016
|
+
return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
|
|
58937
59017
|
}
|
|
58938
59018
|
function getUnresolvedSymbolForEntityName(name) {
|
|
58939
59019
|
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
|
|
@@ -58944,7 +59024,7 @@ var ts;
|
|
|
58944
59024
|
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
|
|
58945
59025
|
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
58946
59026
|
undefined;
|
|
58947
|
-
var path = parentSymbol ? getSymbolPath(parentSymbol)
|
|
59027
|
+
var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
|
|
58948
59028
|
var result = unresolvedSymbols.get(path);
|
|
58949
59029
|
if (!result) {
|
|
58950
59030
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
@@ -59017,7 +59097,7 @@ var ts;
|
|
|
59017
59097
|
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
|
|
59018
59098
|
return baseType;
|
|
59019
59099
|
}
|
|
59020
|
-
var id = getTypeId(baseType)
|
|
59100
|
+
var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
|
|
59021
59101
|
var cached = substitutionTypes.get(id);
|
|
59022
59102
|
if (cached) {
|
|
59023
59103
|
return cached;
|
|
@@ -59941,9 +60021,9 @@ var ts;
|
|
|
59941
60021
|
return types[0];
|
|
59942
60022
|
}
|
|
59943
60023
|
var typeKey = !origin ? getTypeListId(types) :
|
|
59944
|
-
origin.flags & 1048576 /* Union */ ? "|"
|
|
59945
|
-
origin.flags & 2097152 /* Intersection */ ? "&"
|
|
59946
|
-
"#"
|
|
60024
|
+
origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
|
|
60025
|
+
origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
|
|
60026
|
+
"#".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
|
|
59947
60027
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59948
60028
|
var type = unionTypes.get(id);
|
|
59949
60029
|
if (!type) {
|
|
@@ -60465,7 +60545,7 @@ var ts;
|
|
|
60465
60545
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
|
|
60466
60546
|
return stringType;
|
|
60467
60547
|
}
|
|
60468
|
-
var id = getTypeListId(newTypes)
|
|
60548
|
+
var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
|
|
60469
60549
|
var type = templateLiteralTypes.get(id);
|
|
60470
60550
|
if (!type) {
|
|
60471
60551
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -60525,7 +60605,7 @@ var ts;
|
|
|
60525
60605
|
return str;
|
|
60526
60606
|
}
|
|
60527
60607
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
60528
|
-
var id = getSymbolId(symbol)
|
|
60608
|
+
var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
|
|
60529
60609
|
var result = stringMappingTypes.get(id);
|
|
60530
60610
|
if (!result) {
|
|
60531
60611
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -61542,7 +61622,7 @@ var ts;
|
|
|
61542
61622
|
function createUniqueESSymbolType(symbol) {
|
|
61543
61623
|
var type = createType(8192 /* UniqueESSymbol */);
|
|
61544
61624
|
type.symbol = symbol;
|
|
61545
|
-
type.escapedName = "__@"
|
|
61625
|
+
type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
|
|
61546
61626
|
return type;
|
|
61547
61627
|
}
|
|
61548
61628
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -63231,24 +63311,24 @@ var ts;
|
|
|
63231
63311
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
63232
63312
|
// Parenthesize a `new` if there is one
|
|
63233
63313
|
if (path.indexOf("new ") === 0) {
|
|
63234
|
-
path = "("
|
|
63314
|
+
path = "(".concat(path, ")");
|
|
63235
63315
|
}
|
|
63236
63316
|
var str = "" + args[0];
|
|
63237
63317
|
// If leading, just print back the arg (irrespective of if it's a valid identifier)
|
|
63238
63318
|
if (path.length === 0) {
|
|
63239
|
-
path = ""
|
|
63319
|
+
path = "".concat(str);
|
|
63240
63320
|
}
|
|
63241
63321
|
// Otherwise write a dotted name if possible
|
|
63242
63322
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
63243
|
-
path = path
|
|
63323
|
+
path = "".concat(path, ".").concat(str);
|
|
63244
63324
|
}
|
|
63245
63325
|
// Failing that, check if the name is already a computed name
|
|
63246
63326
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
63247
|
-
path = ""
|
|
63327
|
+
path = "".concat(path).concat(str);
|
|
63248
63328
|
}
|
|
63249
63329
|
// And finally write out a computed name as a last resort
|
|
63250
63330
|
else {
|
|
63251
|
-
path = path
|
|
63331
|
+
path = "".concat(path, "[").concat(str, "]");
|
|
63252
63332
|
}
|
|
63253
63333
|
break;
|
|
63254
63334
|
}
|
|
@@ -63277,7 +63357,7 @@ var ts;
|
|
|
63277
63357
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
63278
63358
|
? ""
|
|
63279
63359
|
: "...";
|
|
63280
|
-
path = ""
|
|
63360
|
+
path = "".concat(prefix).concat(path, "(").concat(params, ")");
|
|
63281
63361
|
}
|
|
63282
63362
|
break;
|
|
63283
63363
|
}
|
|
@@ -63290,7 +63370,7 @@ var ts;
|
|
|
63290
63370
|
break;
|
|
63291
63371
|
}
|
|
63292
63372
|
default:
|
|
63293
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
63373
|
+
return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
|
|
63294
63374
|
}
|
|
63295
63375
|
}
|
|
63296
63376
|
if (path) {
|
|
@@ -65492,7 +65572,7 @@ var ts;
|
|
|
65492
65572
|
var constraintMarker = "";
|
|
65493
65573
|
var sourceId = getTypeReferenceId(source, 0);
|
|
65494
65574
|
var targetId = getTypeReferenceId(target, 0);
|
|
65495
|
-
return ""
|
|
65575
|
+
return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
|
|
65496
65576
|
// getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
|
|
65497
65577
|
// where A.id=111 and number.id=12
|
|
65498
65578
|
function getTypeReferenceId(type, depth) {
|
|
@@ -65536,7 +65616,7 @@ var ts;
|
|
|
65536
65616
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
65537
65617
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
65538
65618
|
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
65539
|
-
source.id
|
|
65619
|
+
"".concat(source.id, ",").concat(target.id).concat(postFix);
|
|
65540
65620
|
}
|
|
65541
65621
|
// Invoke the callback for each underlying property symbol of the given symbol and return the first
|
|
65542
65622
|
// value that isn't undefined.
|
|
@@ -67663,11 +67743,11 @@ var ts;
|
|
|
67663
67743
|
case 79 /* Identifier */:
|
|
67664
67744
|
if (!ts.isThisInTypeQuery(node)) {
|
|
67665
67745
|
var symbol = getResolvedSymbol(node);
|
|
67666
|
-
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1"
|
|
67746
|
+
return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
|
|
67667
67747
|
}
|
|
67668
67748
|
// falls through
|
|
67669
67749
|
case 108 /* ThisKeyword */:
|
|
67670
|
-
return "0|"
|
|
67750
|
+
return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
|
|
67671
67751
|
case 229 /* NonNullExpression */:
|
|
67672
67752
|
case 211 /* ParenthesizedExpression */:
|
|
67673
67753
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -69842,12 +69922,16 @@ var ts;
|
|
|
69842
69922
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
69843
69923
|
return !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
69844
69924
|
}
|
|
69845
|
-
function
|
|
69925
|
+
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
69846
69926
|
// Computing the contextual type for a child of a JSX element involves resolving the type of the
|
|
69847
69927
|
// element's tag name, so we exclude that here to avoid circularities.
|
|
69928
|
+
// If check mode has `CheckMode.RestBindingElement`, we skip binding pattern contextual types,
|
|
69929
|
+
// as we want the type of a rest element to be generic when possible.
|
|
69848
69930
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
69849
69931
|
!((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
|
|
69850
|
-
|
|
69932
|
+
(checkMode && checkMode & 32 /* RestBindingElement */ ?
|
|
69933
|
+
getContextualType(node, 8 /* SkipBindingPatterns */)
|
|
69934
|
+
: getContextualType(node));
|
|
69851
69935
|
return contextualType && !isGenericType(contextualType);
|
|
69852
69936
|
}
|
|
69853
69937
|
function getNarrowableTypeForReference(type, reference, checkMode) {
|
|
@@ -69860,7 +69944,7 @@ var ts;
|
|
|
69860
69944
|
// 'string | undefined' to give control flow analysis the opportunity to narrow to type 'string'.
|
|
69861
69945
|
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
|
|
69862
69946
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
69863
|
-
(isConstraintPosition(type, reference) ||
|
|
69947
|
+
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
69864
69948
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
69865
69949
|
}
|
|
69866
69950
|
function isExportOrExportExpression(location) {
|
|
@@ -69928,7 +70012,7 @@ var ts;
|
|
|
69928
70012
|
var links = getNodeLinks(location);
|
|
69929
70013
|
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
|
|
69930
70014
|
links.flags |= 268435456 /* InCheckIdentifier */;
|
|
69931
|
-
var parentType = getTypeForBindingElementParent(parent);
|
|
70015
|
+
var parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
69932
70016
|
links.flags &= ~268435456 /* InCheckIdentifier */;
|
|
69933
70017
|
if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
69934
70018
|
var pattern = declaration.parent;
|
|
@@ -70781,7 +70865,7 @@ var ts;
|
|
|
70781
70865
|
var parent = declaration.parent.parent;
|
|
70782
70866
|
var name = declaration.propertyName || declaration.name;
|
|
70783
70867
|
var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
|
|
70784
|
-
parent.kind !== 202 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent);
|
|
70868
|
+
parent.kind !== 202 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */);
|
|
70785
70869
|
if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))
|
|
70786
70870
|
return undefined;
|
|
70787
70871
|
if (parent.name.kind === 201 /* ArrayBindingPattern */) {
|
|
@@ -71552,7 +71636,7 @@ var ts;
|
|
|
71552
71636
|
!leftName ? rightName :
|
|
71553
71637
|
!rightName ? leftName :
|
|
71554
71638
|
undefined;
|
|
71555
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
71639
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
71556
71640
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
71557
71641
|
params[i] = paramSymbol;
|
|
71558
71642
|
}
|
|
@@ -73022,7 +73106,7 @@ var ts;
|
|
|
73022
73106
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
73023
73107
|
return errorType;
|
|
73024
73108
|
}
|
|
73025
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
73109
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73026
73110
|
}
|
|
73027
73111
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73028
73112
|
}
|
|
@@ -75492,8 +75576,8 @@ var ts;
|
|
|
75492
75576
|
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
75493
75577
|
var synthType = type;
|
|
75494
75578
|
if (!synthType.defaultOnlyType) {
|
|
75495
|
-
var
|
|
75496
|
-
synthType.defaultOnlyType =
|
|
75579
|
+
var type_5 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
75580
|
+
synthType.defaultOnlyType = type_5;
|
|
75497
75581
|
}
|
|
75498
75582
|
return synthType.defaultOnlyType;
|
|
75499
75583
|
}
|
|
@@ -75947,7 +76031,7 @@ var ts;
|
|
|
75947
76031
|
var links = getSymbolLinks(parameter);
|
|
75948
76032
|
if (!links.type) {
|
|
75949
76033
|
var declaration = parameter.valueDeclaration;
|
|
75950
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*
|
|
76034
|
+
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
75951
76035
|
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
75952
76036
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
75953
76037
|
if (links.type === unknownType) {
|
|
@@ -76220,12 +76304,12 @@ var ts;
|
|
|
76220
76304
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false);
|
|
76221
76305
|
// notEqualFacts states that the type of the switched value is not equal to every type in the switch.
|
|
76222
76306
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true);
|
|
76223
|
-
var
|
|
76307
|
+
var type_6 = getBaseConstraintOfType(operandType) || operandType;
|
|
76224
76308
|
// Take any/unknown as a special condition. Or maybe we could change `type` to a union containing all primitive types.
|
|
76225
|
-
if (
|
|
76309
|
+
if (type_6.flags & 3 /* AnyOrUnknown */) {
|
|
76226
76310
|
return (556800 /* AllTypeofNE */ & notEqualFacts_1) === 556800 /* AllTypeofNE */;
|
|
76227
76311
|
}
|
|
76228
|
-
return !!(filterType(
|
|
76312
|
+
return !!(filterType(type_6, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);
|
|
76229
76313
|
}
|
|
76230
76314
|
var type = getTypeOfExpression(node.expression);
|
|
76231
76315
|
if (!isLiteralType(type)) {
|
|
@@ -77678,11 +77762,11 @@ var ts;
|
|
|
77678
77762
|
}
|
|
77679
77763
|
}
|
|
77680
77764
|
function checkExpressionCached(node, checkMode) {
|
|
77765
|
+
if (checkMode && checkMode !== 0 /* Normal */) {
|
|
77766
|
+
return checkExpression(node, checkMode);
|
|
77767
|
+
}
|
|
77681
77768
|
var links = getNodeLinks(node);
|
|
77682
77769
|
if (!links.resolvedType) {
|
|
77683
|
-
if (checkMode && checkMode !== 0 /* Normal */) {
|
|
77684
|
-
return checkExpression(node, checkMode);
|
|
77685
|
-
}
|
|
77686
77770
|
// When computing a type that we're going to cache, we need to ignore any ongoing control flow
|
|
77687
77771
|
// analysis because variables may have transient types in indeterminable states. Moving flowLoopStart
|
|
77688
77772
|
// to the top of the stack ensures all transient types are computed from a known point.
|
|
@@ -77702,10 +77786,12 @@ var ts;
|
|
|
77702
77786
|
node.kind === 228 /* AsExpression */ ||
|
|
77703
77787
|
ts.isJSDocTypeAssertion(node);
|
|
77704
77788
|
}
|
|
77705
|
-
function checkDeclarationInitializer(declaration, contextualType) {
|
|
77789
|
+
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
77706
77790
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
77707
77791
|
var type = getQuickTypeOfExpression(initializer) ||
|
|
77708
|
-
(contextualType ?
|
|
77792
|
+
(contextualType ?
|
|
77793
|
+
checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, checkMode || 0 /* Normal */)
|
|
77794
|
+
: checkExpressionCached(initializer, checkMode));
|
|
77709
77795
|
return ts.isParameter(declaration) && declaration.name.kind === 201 /* ArrayBindingPattern */ &&
|
|
77710
77796
|
isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
|
|
77711
77797
|
padTupleType(type, declaration.name) : type;
|
|
@@ -78345,6 +78431,7 @@ var ts;
|
|
|
78345
78431
|
}
|
|
78346
78432
|
}
|
|
78347
78433
|
checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
|
|
78434
|
+
checkUnmatchedJSDocParameters(node);
|
|
78348
78435
|
ts.forEach(node.parameters, checkParameter);
|
|
78349
78436
|
// TODO(rbuckton): Should we start checking JSDoc types?
|
|
78350
78437
|
if (node.type) {
|
|
@@ -79916,31 +80003,6 @@ var ts;
|
|
|
79916
80003
|
}
|
|
79917
80004
|
function checkJSDocParameterTag(node) {
|
|
79918
80005
|
checkSourceElement(node.typeExpression);
|
|
79919
|
-
if (!ts.getParameterSymbolFromJSDoc(node)) {
|
|
79920
|
-
var decl = ts.getHostSignatureFromJSDoc(node);
|
|
79921
|
-
// don't issue an error for invalid hosts -- just functions --
|
|
79922
|
-
// and give a better error message when the host function mentions `arguments`
|
|
79923
|
-
// but the tag doesn't have an array type
|
|
79924
|
-
if (decl) {
|
|
79925
|
-
var i = ts.getJSDocTags(decl).filter(ts.isJSDocParameterTag).indexOf(node);
|
|
79926
|
-
if (i > -1 && i < decl.parameters.length && ts.isBindingPattern(decl.parameters[i].name)) {
|
|
79927
|
-
return;
|
|
79928
|
-
}
|
|
79929
|
-
if (!containsArgumentsReference(decl)) {
|
|
79930
|
-
if (ts.isQualifiedName(node.name)) {
|
|
79931
|
-
error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left));
|
|
79932
|
-
}
|
|
79933
|
-
else {
|
|
79934
|
-
error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name));
|
|
79935
|
-
}
|
|
79936
|
-
}
|
|
79937
|
-
else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&
|
|
79938
|
-
node.typeExpression && node.typeExpression.type &&
|
|
79939
|
-
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
|
|
79940
|
-
error(node.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(node.name.kind === 160 /* QualifiedName */ ? node.name.right : node.name));
|
|
79941
|
-
}
|
|
79942
|
-
}
|
|
79943
|
-
}
|
|
79944
80006
|
}
|
|
79945
80007
|
function checkJSDocPropertyTag(node) {
|
|
79946
80008
|
checkSourceElement(node.typeExpression);
|
|
@@ -80642,7 +80704,8 @@ var ts;
|
|
|
80642
80704
|
}
|
|
80643
80705
|
// check private/protected variable access
|
|
80644
80706
|
var parent = node.parent.parent;
|
|
80645
|
-
var
|
|
80707
|
+
var parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
80708
|
+
var parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
80646
80709
|
var name = node.propertyName || node.name;
|
|
80647
80710
|
if (parentType && !ts.isBindingPattern(name)) {
|
|
80648
80711
|
var exprType = getLiteralTypeFromPropertyName(name);
|
|
@@ -81440,7 +81503,7 @@ var ts;
|
|
|
81440
81503
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
81441
81504
|
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
|
|
81442
81505
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
81443
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
81506
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
|
|
81444
81507
|
}
|
|
81445
81508
|
/**
|
|
81446
81509
|
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
|
|
@@ -81881,7 +81944,7 @@ var ts;
|
|
|
81881
81944
|
var declaration = catchClause.variableDeclaration;
|
|
81882
81945
|
var typeNode = ts.getEffectiveTypeAnnotationNode(ts.getRootDeclaration(declaration));
|
|
81883
81946
|
if (typeNode) {
|
|
81884
|
-
var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false);
|
|
81947
|
+
var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false, 0 /* Normal */);
|
|
81885
81948
|
if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
|
|
81886
81949
|
grammarErrorOnFirstToken(typeNode, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
81887
81950
|
}
|
|
@@ -82012,6 +82075,45 @@ var ts;
|
|
|
82012
82075
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
|
|
82013
82076
|
}
|
|
82014
82077
|
}
|
|
82078
|
+
function checkUnmatchedJSDocParameters(node) {
|
|
82079
|
+
var jsdocParameters = ts.filter(ts.getJSDocTags(node), ts.isJSDocParameterTag);
|
|
82080
|
+
if (!ts.length(jsdocParameters))
|
|
82081
|
+
return;
|
|
82082
|
+
var isJs = ts.isInJSFile(node);
|
|
82083
|
+
var parameters = new ts.Set();
|
|
82084
|
+
var excludedParameters = new ts.Set();
|
|
82085
|
+
ts.forEach(node.parameters, function (_a, index) {
|
|
82086
|
+
var name = _a.name;
|
|
82087
|
+
if (ts.isIdentifier(name)) {
|
|
82088
|
+
parameters.add(name.escapedText);
|
|
82089
|
+
}
|
|
82090
|
+
if (ts.isBindingPattern(name)) {
|
|
82091
|
+
excludedParameters.add(index);
|
|
82092
|
+
}
|
|
82093
|
+
});
|
|
82094
|
+
var containsArguments = containsArgumentsReference(node);
|
|
82095
|
+
if (containsArguments) {
|
|
82096
|
+
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
82097
|
+
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
82098
|
+
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
82099
|
+
errorOrSuggestion(isJs, 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
|
+
}
|
|
82101
|
+
}
|
|
82102
|
+
else {
|
|
82103
|
+
ts.forEach(jsdocParameters, function (_a, index) {
|
|
82104
|
+
var name = _a.name;
|
|
82105
|
+
if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
|
|
82106
|
+
return;
|
|
82107
|
+
}
|
|
82108
|
+
if (ts.isQualifiedName(name)) {
|
|
82109
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
|
|
82110
|
+
}
|
|
82111
|
+
else {
|
|
82112
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
82113
|
+
}
|
|
82114
|
+
});
|
|
82115
|
+
}
|
|
82116
|
+
}
|
|
82015
82117
|
/**
|
|
82016
82118
|
* Check each type parameter and check that type parameters have no duplicate type parameter declarations
|
|
82017
82119
|
*/
|
|
@@ -82987,7 +83089,7 @@ var ts;
|
|
|
82987
83089
|
var isAmbientExternalModule = ts.isAmbientModule(node);
|
|
82988
83090
|
var contextErrorMessage = isAmbientExternalModule
|
|
82989
83091
|
? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file
|
|
82990
|
-
: ts.Diagnostics.
|
|
83092
|
+
: ts.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;
|
|
82991
83093
|
if (checkGrammarModuleElementContext(node, contextErrorMessage)) {
|
|
82992
83094
|
// If we hit a module declaration in an illegal context, just bail out to avoid cascading errors.
|
|
82993
83095
|
return;
|
|
@@ -83220,6 +83322,9 @@ var ts;
|
|
|
83220
83322
|
var name = ts.idText(node.kind === 269 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
|
|
83221
83323
|
addTypeOnlyDeclarationRelatedInfo(error(node, message, name), isType ? undefined : typeOnlyAlias, name);
|
|
83222
83324
|
}
|
|
83325
|
+
if (isType && node.kind === 264 /* ImportEqualsDeclaration */ && ts.hasEffectiveModifier(node, 1 /* Export */)) {
|
|
83326
|
+
error(node, ts.Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
|
|
83327
|
+
}
|
|
83223
83328
|
break;
|
|
83224
83329
|
}
|
|
83225
83330
|
case 274 /* ExportSpecifier */: {
|
|
@@ -83303,7 +83408,7 @@ var ts;
|
|
|
83303
83408
|
}
|
|
83304
83409
|
}
|
|
83305
83410
|
function checkImportDeclaration(node) {
|
|
83306
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83411
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83307
83412
|
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
|
|
83308
83413
|
return;
|
|
83309
83414
|
}
|
|
@@ -83336,7 +83441,7 @@ var ts;
|
|
|
83336
83441
|
checkAssertClause(node);
|
|
83337
83442
|
}
|
|
83338
83443
|
function checkImportEqualsDeclaration(node) {
|
|
83339
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83444
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83340
83445
|
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
|
|
83341
83446
|
return;
|
|
83342
83447
|
}
|
|
@@ -83373,7 +83478,7 @@ var ts;
|
|
|
83373
83478
|
}
|
|
83374
83479
|
}
|
|
83375
83480
|
function checkExportDeclaration(node) {
|
|
83376
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83481
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83377
83482
|
// If we hit an export in an illegal context, just bail out to avoid cascading errors.
|
|
83378
83483
|
return;
|
|
83379
83484
|
}
|
|
@@ -84607,7 +84712,7 @@ var ts;
|
|
|
84607
84712
|
return errorType;
|
|
84608
84713
|
}
|
|
84609
84714
|
if (ts.isBindingPattern(node)) {
|
|
84610
|
-
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true) || errorType;
|
|
84715
|
+
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true, 0 /* Normal */) || errorType;
|
|
84611
84716
|
}
|
|
84612
84717
|
if (isInRightSideOfImportOrExportAssignment(node)) {
|
|
84613
84718
|
var symbol = getSymbolAtLocation(node);
|
|
@@ -88450,7 +88555,7 @@ var ts;
|
|
|
88450
88555
|
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
|
|
88451
88556
|
value === 62 ? 43 /* plus */ :
|
|
88452
88557
|
value === 63 ? 47 /* slash */ :
|
|
88453
|
-
ts.Debug.fail(value
|
|
88558
|
+
ts.Debug.fail("".concat(value, ": not a base64 value"));
|
|
88454
88559
|
}
|
|
88455
88560
|
function base64FormatDecode(ch) {
|
|
88456
88561
|
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
|
|
@@ -88525,7 +88630,7 @@ var ts;
|
|
|
88525
88630
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
88526
88631
|
if (decoder.error !== undefined) {
|
|
88527
88632
|
if (host.log) {
|
|
88528
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
88633
|
+
host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
|
|
88529
88634
|
}
|
|
88530
88635
|
decodedMappings = ts.emptyArray;
|
|
88531
88636
|
}
|
|
@@ -92200,7 +92305,7 @@ var ts;
|
|
|
92200
92305
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
92201
92306
|
? ts.declarationNameToString(originalNode.name)
|
|
92202
92307
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92203
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " "
|
|
92308
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
|
|
92204
92309
|
}
|
|
92205
92310
|
return substitute;
|
|
92206
92311
|
}
|
|
@@ -93676,8 +93781,8 @@ var ts;
|
|
|
93676
93781
|
}
|
|
93677
93782
|
function createHoistedVariableForClass(name, node) {
|
|
93678
93783
|
var className = getPrivateIdentifierEnvironment().className;
|
|
93679
|
-
var prefix = className ? "_"
|
|
93680
|
-
var identifier = factory.createUniqueName(prefix
|
|
93784
|
+
var prefix = className ? "_".concat(className) : "";
|
|
93785
|
+
var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
|
|
93681
93786
|
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
|
|
93682
93787
|
addBlockScopedVariable(identifier);
|
|
93683
93788
|
}
|
|
@@ -95682,7 +95787,7 @@ var ts;
|
|
|
95682
95787
|
specifierSourceImports = new ts.Map();
|
|
95683
95788
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
95684
95789
|
}
|
|
95685
|
-
var generatedName = factory.createUniqueName("_"
|
|
95790
|
+
var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
|
|
95686
95791
|
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
|
|
95687
95792
|
generatedName.generatedImportReference = specifier;
|
|
95688
95793
|
specifierSourceImports.set(name, specifier);
|
|
@@ -96830,11 +96935,11 @@ var ts;
|
|
|
96830
96935
|
}
|
|
96831
96936
|
else {
|
|
96832
96937
|
if (node.kind === 245 /* BreakStatement */) {
|
|
96833
|
-
labelMarker = "break-"
|
|
96938
|
+
labelMarker = "break-".concat(label.escapedText);
|
|
96834
96939
|
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
|
|
96835
96940
|
}
|
|
96836
96941
|
else {
|
|
96837
|
-
labelMarker = "continue-"
|
|
96942
|
+
labelMarker = "continue-".concat(label.escapedText);
|
|
96838
96943
|
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
|
|
96839
96944
|
}
|
|
96840
96945
|
}
|
|
@@ -105691,7 +105796,7 @@ var ts;
|
|
|
105691
105796
|
return getTypeAliasDeclarationVisibilityError;
|
|
105692
105797
|
}
|
|
105693
105798
|
else {
|
|
105694
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
105799
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
|
|
105695
105800
|
}
|
|
105696
105801
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
105697
105802
|
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
|
|
@@ -105902,7 +106007,7 @@ var ts;
|
|
|
105902
106007
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
105903
106008
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
105904
106009
|
default:
|
|
105905
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
106010
|
+
return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
|
|
105906
106011
|
}
|
|
105907
106012
|
}
|
|
105908
106013
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -106660,7 +106765,7 @@ var ts;
|
|
|
106660
106765
|
while (ts.length(lateMarkedStatements)) {
|
|
106661
106766
|
var i = lateMarkedStatements.shift();
|
|
106662
106767
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
106663
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
106768
|
+
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));
|
|
106664
106769
|
}
|
|
106665
106770
|
var priorNeedsDeclare = needsDeclare;
|
|
106666
106771
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -106849,7 +106954,7 @@ var ts;
|
|
|
106849
106954
|
return cleanup(input);
|
|
106850
106955
|
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));
|
|
106851
106956
|
}
|
|
106852
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
106957
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
|
|
106853
106958
|
}
|
|
106854
106959
|
}
|
|
106855
106960
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -107140,7 +107245,7 @@ var ts;
|
|
|
107140
107245
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
|
|
107141
107246
|
// We must add a temporary declaration for the extends clause expression
|
|
107142
107247
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
107143
|
-
var newId_1 = factory.createUniqueName(oldId
|
|
107248
|
+
var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
|
|
107144
107249
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
107145
107250
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
107146
107251
|
errorNode: extendsClause_1,
|
|
@@ -107181,7 +107286,7 @@ var ts;
|
|
|
107181
107286
|
}
|
|
107182
107287
|
}
|
|
107183
107288
|
// Anything left unhandled is an error, so this should be unreachable
|
|
107184
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
107289
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
|
|
107185
107290
|
function cleanup(node) {
|
|
107186
107291
|
if (isEnclosingDeclaration(input)) {
|
|
107187
107292
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -108073,13 +108178,13 @@ var ts;
|
|
|
108073
108178
|
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
|
|
108074
108179
|
return;
|
|
108075
108180
|
if (js && configFile.options.sourceMap) {
|
|
108076
|
-
addOutput(js
|
|
108181
|
+
addOutput("".concat(js, ".map"));
|
|
108077
108182
|
}
|
|
108078
108183
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
108079
108184
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
108080
108185
|
addOutput(dts);
|
|
108081
108186
|
if (configFile.options.declarationMap) {
|
|
108082
|
-
addOutput(dts
|
|
108187
|
+
addOutput("".concat(dts, ".map"));
|
|
108083
108188
|
}
|
|
108084
108189
|
}
|
|
108085
108190
|
}
|
|
@@ -108148,7 +108253,7 @@ var ts;
|
|
|
108148
108253
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
108149
108254
|
if (ts.outFile(configFile.options)) {
|
|
108150
108255
|
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
|
|
108151
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
108256
|
+
return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108152
108257
|
}
|
|
108153
108258
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
108154
108259
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -108167,7 +108272,7 @@ var ts;
|
|
|
108167
108272
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
108168
108273
|
if (buildInfoPath)
|
|
108169
108274
|
return buildInfoPath;
|
|
108170
|
-
return ts.Debug.fail("project "
|
|
108275
|
+
return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108171
108276
|
}
|
|
108172
108277
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
108173
108278
|
/*@internal*/
|
|
@@ -108393,7 +108498,7 @@ var ts;
|
|
|
108393
108498
|
if (sourceMappingURL) {
|
|
108394
108499
|
if (!writer.isAtStartOfLine())
|
|
108395
108500
|
writer.rawWrite(newLine);
|
|
108396
|
-
writer.writeComment("//# "
|
|
108501
|
+
writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
|
|
108397
108502
|
}
|
|
108398
108503
|
// Write the source map
|
|
108399
108504
|
if (sourceMapFilePath) {
|
|
@@ -108442,7 +108547,7 @@ var ts;
|
|
|
108442
108547
|
// Encode the sourceMap into the sourceMap url
|
|
108443
108548
|
var sourceMapText = sourceMapGenerator.toString();
|
|
108444
108549
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
108445
|
-
return "data:application/json;base64,"
|
|
108550
|
+
return "data:application/json;base64,".concat(base64SourceMapText);
|
|
108446
108551
|
}
|
|
108447
108552
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
108448
108553
|
if (mapOptions.mapRoot) {
|
|
@@ -108622,7 +108727,7 @@ var ts;
|
|
|
108622
108727
|
return;
|
|
108623
108728
|
break;
|
|
108624
108729
|
default:
|
|
108625
|
-
ts.Debug.fail("Unexpected path: "
|
|
108730
|
+
ts.Debug.fail("Unexpected path: ".concat(name));
|
|
108626
108731
|
}
|
|
108627
108732
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
108628
108733
|
},
|
|
@@ -109482,7 +109587,7 @@ var ts;
|
|
|
109482
109587
|
return writeTokenNode(node, writeKeyword);
|
|
109483
109588
|
if (ts.isTokenKind(node.kind))
|
|
109484
109589
|
return writeTokenNode(node, writePunctuation);
|
|
109485
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
109590
|
+
ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109486
109591
|
}
|
|
109487
109592
|
function emitMappedTypeParameter(node) {
|
|
109488
109593
|
emit(node.name);
|
|
@@ -109652,16 +109757,16 @@ var ts;
|
|
|
109652
109757
|
}
|
|
109653
109758
|
}
|
|
109654
109759
|
function emitPlaceholder(hint, node, snippet) {
|
|
109655
|
-
nonEscapingWrite("${"
|
|
109760
|
+
nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
|
|
109656
109761
|
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
109657
109762
|
nonEscapingWrite("}"); // `}`
|
|
109658
109763
|
// `${2:...}`
|
|
109659
109764
|
}
|
|
109660
109765
|
function emitTabStop(hint, node, snippet) {
|
|
109661
109766
|
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
|
|
109662
|
-
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind "
|
|
109767
|
+
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109663
109768
|
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
|
|
109664
|
-
nonEscapingWrite("$"
|
|
109769
|
+
nonEscapingWrite("$".concat(snippet.order));
|
|
109665
109770
|
}
|
|
109666
109771
|
//
|
|
109667
109772
|
// Identifiers
|
|
@@ -111423,17 +111528,17 @@ var ts;
|
|
|
111423
111528
|
writeLine();
|
|
111424
111529
|
}
|
|
111425
111530
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
111426
|
-
writeComment("/// <amd-module name=\""
|
|
111531
|
+
writeComment("/// <amd-module name=\"".concat(currentSourceFile.moduleName, "\" />"));
|
|
111427
111532
|
writeLine();
|
|
111428
111533
|
}
|
|
111429
111534
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
111430
111535
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
111431
111536
|
var dep = _b[_a];
|
|
111432
111537
|
if (dep.name) {
|
|
111433
|
-
writeComment("/// <amd-dependency name=\""
|
|
111538
|
+
writeComment("/// <amd-dependency name=\"".concat(dep.name, "\" path=\"").concat(dep.path, "\" />"));
|
|
111434
111539
|
}
|
|
111435
111540
|
else {
|
|
111436
|
-
writeComment("/// <amd-dependency path=\""
|
|
111541
|
+
writeComment("/// <amd-dependency path=\"".concat(dep.path, "\" />"));
|
|
111437
111542
|
}
|
|
111438
111543
|
writeLine();
|
|
111439
111544
|
}
|
|
@@ -111441,7 +111546,7 @@ var ts;
|
|
|
111441
111546
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
111442
111547
|
var directive = files_2[_c];
|
|
111443
111548
|
var pos = writer.getTextPos();
|
|
111444
|
-
writeComment("/// <reference path=\""
|
|
111549
|
+
writeComment("/// <reference path=\"".concat(directive.fileName, "\" />"));
|
|
111445
111550
|
if (bundleFileInfo)
|
|
111446
111551
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
111447
111552
|
writeLine();
|
|
@@ -111449,7 +111554,7 @@ var ts;
|
|
|
111449
111554
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
111450
111555
|
var directive = types_24[_d];
|
|
111451
111556
|
var pos = writer.getTextPos();
|
|
111452
|
-
writeComment("/// <reference types=\""
|
|
111557
|
+
writeComment("/// <reference types=\"".concat(directive.fileName, "\" />"));
|
|
111453
111558
|
if (bundleFileInfo)
|
|
111454
111559
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
|
|
111455
111560
|
writeLine();
|
|
@@ -111457,7 +111562,7 @@ var ts;
|
|
|
111457
111562
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
111458
111563
|
var directive = libs_1[_e];
|
|
111459
111564
|
var pos = writer.getTextPos();
|
|
111460
|
-
writeComment("/// <reference lib=\""
|
|
111565
|
+
writeComment("/// <reference lib=\"".concat(directive.fileName, "\" />"));
|
|
111461
111566
|
if (bundleFileInfo)
|
|
111462
111567
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
|
|
111463
111568
|
writeLine();
|
|
@@ -112237,9 +112342,9 @@ var ts;
|
|
|
112237
112342
|
var textSourceNode = node.textSourceNode;
|
|
112238
112343
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
112239
112344
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
112240
|
-
return jsxAttributeEscape ? "\""
|
|
112241
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\""
|
|
112242
|
-
"\""
|
|
112345
|
+
return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
|
|
112346
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
|
|
112347
|
+
"\"".concat(ts.escapeNonAsciiString(text), "\"");
|
|
112243
112348
|
}
|
|
112244
112349
|
else {
|
|
112245
112350
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -112716,8 +112821,8 @@ var ts;
|
|
|
112716
112821
|
}
|
|
112717
112822
|
function formatSynthesizedComment(comment) {
|
|
112718
112823
|
return comment.kind === 3 /* MultiLineCommentTrivia */
|
|
112719
|
-
? "/*"
|
|
112720
|
-
: "//"
|
|
112824
|
+
? "/*".concat(comment.text, "*/")
|
|
112825
|
+
: "//".concat(comment.text);
|
|
112721
112826
|
}
|
|
112722
112827
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
112723
112828
|
enterComment();
|
|
@@ -113438,7 +113543,7 @@ var ts;
|
|
|
113438
113543
|
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;
|
|
113439
113544
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
113440
113545
|
if (!newPath) {
|
|
113441
|
-
writeLog("Project: "
|
|
113546
|
+
writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
|
|
113442
113547
|
return true;
|
|
113443
113548
|
}
|
|
113444
113549
|
fileOrDirectoryPath = newPath;
|
|
@@ -113447,11 +113552,11 @@ var ts;
|
|
|
113447
113552
|
// If the the added or created file or directory is not supported file name, ignore the file
|
|
113448
113553
|
// But when watched directory is added/removed, we need to reload the file list
|
|
113449
113554
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
113450
|
-
writeLog("Project: "
|
|
113555
|
+
writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
|
|
113451
113556
|
return true;
|
|
113452
113557
|
}
|
|
113453
113558
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
113454
|
-
writeLog("Project: "
|
|
113559
|
+
writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
|
|
113455
113560
|
return true;
|
|
113456
113561
|
}
|
|
113457
113562
|
if (!program)
|
|
@@ -113475,7 +113580,7 @@ var ts;
|
|
|
113475
113580
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
113476
113581
|
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
|
|
113477
113582
|
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
|
|
113478
|
-
writeLog("Project: "
|
|
113583
|
+
writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
|
|
113479
113584
|
return true;
|
|
113480
113585
|
}
|
|
113481
113586
|
return false;
|
|
@@ -113543,36 +113648,36 @@ var ts;
|
|
|
113543
113648
|
host.useCaseSensitiveFileNames();
|
|
113544
113649
|
}
|
|
113545
113650
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
113546
|
-
log("ExcludeWatcher:: Added:: "
|
|
113651
|
+
log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113547
113652
|
return {
|
|
113548
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
113653
|
+
close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
|
|
113549
113654
|
};
|
|
113550
113655
|
}
|
|
113551
113656
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113552
|
-
log("FileWatcher:: Added:: "
|
|
113657
|
+
log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113553
113658
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113554
113659
|
return {
|
|
113555
113660
|
close: function () {
|
|
113556
|
-
log("FileWatcher:: Close:: "
|
|
113661
|
+
log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113557
113662
|
watcher.close();
|
|
113558
113663
|
}
|
|
113559
113664
|
};
|
|
113560
113665
|
}
|
|
113561
113666
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113562
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
113667
|
+
var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113563
113668
|
log(watchInfo);
|
|
113564
113669
|
var start = ts.timestamp();
|
|
113565
113670
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113566
113671
|
var elapsed = ts.timestamp() - start;
|
|
113567
|
-
log("Elapsed:: "
|
|
113672
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113568
113673
|
return {
|
|
113569
113674
|
close: function () {
|
|
113570
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
113675
|
+
var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113571
113676
|
log(watchInfo);
|
|
113572
113677
|
var start = ts.timestamp();
|
|
113573
113678
|
watcher.close();
|
|
113574
113679
|
var elapsed = ts.timestamp() - start;
|
|
113575
|
-
log("Elapsed:: "
|
|
113680
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113576
113681
|
}
|
|
113577
113682
|
};
|
|
113578
113683
|
}
|
|
@@ -113582,16 +113687,16 @@ var ts;
|
|
|
113582
113687
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
113583
113688
|
args[_i] = arguments[_i];
|
|
113584
113689
|
}
|
|
113585
|
-
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"
|
|
113690
|
+
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));
|
|
113586
113691
|
log(triggerredInfo);
|
|
113587
113692
|
var start = ts.timestamp();
|
|
113588
113693
|
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
|
|
113589
113694
|
var elapsed = ts.timestamp() - start;
|
|
113590
|
-
log("Elapsed:: "
|
|
113695
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
|
|
113591
113696
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
113592
113697
|
}
|
|
113593
113698
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
113594
|
-
return "WatchInfo: "
|
|
113699
|
+
return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
|
|
113595
113700
|
}
|
|
113596
113701
|
}
|
|
113597
113702
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -113898,12 +114003,12 @@ var ts;
|
|
|
113898
114003
|
}
|
|
113899
114004
|
ts.formatDiagnostics = formatDiagnostics;
|
|
113900
114005
|
function formatDiagnostic(diagnostic, host) {
|
|
113901
|
-
var errorMessage = ts.diagnosticCategoryName(diagnostic)
|
|
114006
|
+
var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
|
|
113902
114007
|
if (diagnostic.file) {
|
|
113903
114008
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
|
|
113904
114009
|
var fileName = diagnostic.file.fileName;
|
|
113905
114010
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
113906
|
-
return relativeFileName
|
|
114011
|
+
return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
|
|
113907
114012
|
}
|
|
113908
114013
|
return errorMessage;
|
|
113909
114014
|
}
|
|
@@ -113991,9 +114096,9 @@ var ts;
|
|
|
113991
114096
|
var output = "";
|
|
113992
114097
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
113993
114098
|
output += ":";
|
|
113994
|
-
output += color(""
|
|
114099
|
+
output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
113995
114100
|
output += ":";
|
|
113996
|
-
output += color(""
|
|
114101
|
+
output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
113997
114102
|
return output;
|
|
113998
114103
|
}
|
|
113999
114104
|
ts.formatLocation = formatLocation;
|
|
@@ -114007,7 +114112,7 @@ var ts;
|
|
|
114007
114112
|
output += " - ";
|
|
114008
114113
|
}
|
|
114009
114114
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
114010
|
-
output += formatColorAndReset(" TS"
|
|
114115
|
+
output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
|
|
114011
114116
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
114012
114117
|
if (diagnostic.file) {
|
|
114013
114118
|
output += host.getNewLine();
|
|
@@ -114116,7 +114221,7 @@ var ts;
|
|
|
114116
114221
|
var result = void 0;
|
|
114117
114222
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
114118
114223
|
i++;
|
|
114119
|
-
var cacheKey = mode !== undefined ? mode
|
|
114224
|
+
var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
|
|
114120
114225
|
if (cache.has(cacheKey)) {
|
|
114121
114226
|
result = cache.get(cacheKey);
|
|
114122
114227
|
}
|
|
@@ -114354,9 +114459,9 @@ var ts;
|
|
|
114354
114459
|
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
114355
114460
|
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
114356
114461
|
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
114357
|
-
ts.Diagnostics.
|
|
114462
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
114358
114463
|
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
114359
|
-
ts.Diagnostics.
|
|
114464
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
114360
114465
|
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
114361
114466
|
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
114362
114467
|
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
@@ -115424,7 +115529,7 @@ var ts;
|
|
|
115424
115529
|
ts.Debug.assert(!!sourceFile.bindDiagnostics);
|
|
115425
115530
|
var isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
115426
115531
|
var isCheckJs = isJs && ts.isCheckJsEnabledForFile(sourceFile, options);
|
|
115427
|
-
var isPlainJs =
|
|
115532
|
+
var isPlainJs = ts.isPlainJsFile(sourceFile, options.checkJs);
|
|
115428
115533
|
var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
|
|
115429
115534
|
// By default, only type-check .ts, .tsx, Deferred, plain JS, checked JS and External
|
|
115430
115535
|
// - plain JS: .js files with no // ts-check and checkJs: undefined
|
|
@@ -116305,7 +116410,7 @@ var ts;
|
|
|
116305
116410
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
116306
116411
|
i++;
|
|
116307
116412
|
}
|
|
116308
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
116413
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
|
|
116309
116414
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
116310
116415
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
116311
116416
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -117126,12 +117231,12 @@ var ts;
|
|
|
117126
117231
|
}
|
|
117127
117232
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
117128
117233
|
var dirPath = host.toPath(dir);
|
|
117129
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
117234
|
+
var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
|
|
117130
117235
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
117131
117236
|
// Any parent directory of declaration dir
|
|
117132
117237
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
117133
117238
|
// Any directory inside declaration dir
|
|
117134
|
-
ts.startsWith(dirPath, declDirPath
|
|
117239
|
+
ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
|
|
117135
117240
|
}
|
|
117136
117241
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
117137
117242
|
var _a;
|
|
@@ -117184,7 +117289,7 @@ var ts;
|
|
|
117184
117289
|
if (isFile && result) {
|
|
117185
117290
|
// Store the real path for the file'
|
|
117186
117291
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
117187
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
117292
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
|
|
117188
117293
|
}
|
|
117189
117294
|
return result;
|
|
117190
117295
|
}) || false;
|
|
@@ -117642,7 +117747,7 @@ var ts;
|
|
|
117642
117747
|
/*forceDtsEmit*/ true);
|
|
117643
117748
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
117644
117749
|
if (firstDts_1) {
|
|
117645
|
-
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: "
|
|
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: ".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; }))); });
|
|
117646
117751
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
117647
117752
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
117648
117753
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -118150,7 +118255,7 @@ var ts;
|
|
|
118150
118255
|
return;
|
|
118151
118256
|
}
|
|
118152
118257
|
else {
|
|
118153
|
-
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: "
|
|
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: ".concat(affectedFile.fileName));
|
|
118154
118259
|
}
|
|
118155
118260
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
118156
118261
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -119295,7 +119400,7 @@ var ts;
|
|
|
119295
119400
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
119296
119401
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
119297
119402
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
119298
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
119403
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
|
|
119299
119404
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
119300
119405
|
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
|
|
119301
119406
|
return {
|
|
@@ -120377,7 +120482,7 @@ var ts;
|
|
|
120377
120482
|
}
|
|
120378
120483
|
function getJSExtensionForFile(fileName, options) {
|
|
120379
120484
|
var _a;
|
|
120380
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
120485
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
|
|
120381
120486
|
}
|
|
120382
120487
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
120383
120488
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -120480,8 +120585,8 @@ var ts;
|
|
|
120480
120585
|
return pretty ?
|
|
120481
120586
|
function (diagnostic, newLine, options) {
|
|
120482
120587
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
120483
|
-
var output = "["
|
|
120484
|
-
output += ""
|
|
120588
|
+
var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
|
|
120589
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
|
|
120485
120590
|
system.write(output);
|
|
120486
120591
|
} :
|
|
120487
120592
|
function (diagnostic, newLine, options) {
|
|
@@ -120489,8 +120594,8 @@ var ts;
|
|
|
120489
120594
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
120490
120595
|
output += newLine;
|
|
120491
120596
|
}
|
|
120492
|
-
output += getLocaleTimeString(system)
|
|
120493
|
-
output += ""
|
|
120597
|
+
output += "".concat(getLocaleTimeString(system), " - ");
|
|
120598
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
|
|
120494
120599
|
system.write(output);
|
|
120495
120600
|
};
|
|
120496
120601
|
}
|
|
@@ -120513,7 +120618,7 @@ var ts;
|
|
|
120513
120618
|
.map(function (errorDiagnostic) {
|
|
120514
120619
|
if (errorDiagnostic.file === undefined)
|
|
120515
120620
|
return;
|
|
120516
|
-
return ""
|
|
120621
|
+
return "".concat(errorDiagnostic.file.fileName);
|
|
120517
120622
|
});
|
|
120518
120623
|
return filesInError.map(function (fileName) {
|
|
120519
120624
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
@@ -120546,7 +120651,7 @@ var ts;
|
|
|
120546
120651
|
if (errorCount === 0)
|
|
120547
120652
|
return "";
|
|
120548
120653
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120549
|
-
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName
|
|
120654
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
|
|
120550
120655
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120551
120656
|
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120552
120657
|
var d = errorCount === 1 ?
|
|
@@ -120559,7 +120664,7 @@ var ts;
|
|
|
120559
120664
|
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120560
120665
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120561
120666
|
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120562
|
-
return ""
|
|
120667
|
+
return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
|
|
120563
120668
|
}
|
|
120564
120669
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120565
120670
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120582,7 +120687,7 @@ var ts;
|
|
|
120582
120687
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120583
120688
|
: "";
|
|
120584
120689
|
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120585
|
-
tabularData += ""
|
|
120690
|
+
tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
|
|
120586
120691
|
});
|
|
120587
120692
|
return tabularData;
|
|
120588
120693
|
}
|
|
@@ -120609,9 +120714,9 @@ var ts;
|
|
|
120609
120714
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
120610
120715
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
120611
120716
|
var file = _c[_i];
|
|
120612
|
-
write(""
|
|
120613
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
120614
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
120717
|
+
write("".concat(toFileName(file, relativeFileName)));
|
|
120718
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
|
|
120719
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
|
|
120615
120720
|
}
|
|
120616
120721
|
}
|
|
120617
120722
|
ts.explainFiles = explainFiles;
|
|
@@ -120651,7 +120756,7 @@ var ts;
|
|
|
120651
120756
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
|
|
120652
120757
|
return false;
|
|
120653
120758
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
120654
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
120759
|
+
return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
|
|
120655
120760
|
});
|
|
120656
120761
|
}
|
|
120657
120762
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -120660,7 +120765,7 @@ var ts;
|
|
|
120660
120765
|
var options = program.getCompilerOptions();
|
|
120661
120766
|
if (ts.isReferencedFile(reason)) {
|
|
120662
120767
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
120663
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
120768
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
|
|
120664
120769
|
var message = void 0;
|
|
120665
120770
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
120666
120771
|
switch (reason.kind) {
|
|
@@ -120784,7 +120889,7 @@ var ts;
|
|
|
120784
120889
|
var currentDir_1 = program.getCurrentDirectory();
|
|
120785
120890
|
ts.forEach(emittedFiles, function (file) {
|
|
120786
120891
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
120787
|
-
write("TSFILE: "
|
|
120892
|
+
write("TSFILE: ".concat(filepath));
|
|
120788
120893
|
});
|
|
120789
120894
|
listFiles(program, write);
|
|
120790
120895
|
}
|
|
@@ -121113,7 +121218,7 @@ var ts;
|
|
|
121113
121218
|
}
|
|
121114
121219
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
121115
121220
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
121116
|
-
writeLog("Current directory: "
|
|
121221
|
+
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
121117
121222
|
var configFileWatcher;
|
|
121118
121223
|
if (configFileName) {
|
|
121119
121224
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -121269,10 +121374,10 @@ var ts;
|
|
|
121269
121374
|
function createNewProgram(hasInvalidatedResolution) {
|
|
121270
121375
|
// Compile the program
|
|
121271
121376
|
writeLog("CreatingProgramWith::");
|
|
121272
|
-
writeLog(" roots: "
|
|
121273
|
-
writeLog(" options: "
|
|
121377
|
+
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
121378
|
+
writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
|
|
121274
121379
|
if (projectReferences)
|
|
121275
|
-
writeLog(" projectReferences: "
|
|
121380
|
+
writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
|
|
121276
121381
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
121277
121382
|
hasChangedCompilerOptions = false;
|
|
121278
121383
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -121433,7 +121538,7 @@ var ts;
|
|
|
121433
121538
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
121434
121539
|
}
|
|
121435
121540
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
121436
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
121541
|
+
writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
|
|
121437
121542
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
121438
121543
|
}
|
|
121439
121544
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -121493,7 +121598,7 @@ var ts;
|
|
|
121493
121598
|
synchronizeProgram();
|
|
121494
121599
|
}
|
|
121495
121600
|
function reloadConfigFile() {
|
|
121496
|
-
writeLog("Reloading config file: "
|
|
121601
|
+
writeLog("Reloading config file: ".concat(configFileName));
|
|
121497
121602
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
121498
121603
|
if (cachedDirectoryStructureHost) {
|
|
121499
121604
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -121534,7 +121639,7 @@ var ts;
|
|
|
121534
121639
|
return config.parsedCommandLine;
|
|
121535
121640
|
}
|
|
121536
121641
|
}
|
|
121537
|
-
writeLog("Loading config file: "
|
|
121642
|
+
writeLog("Loading config file: ".concat(configFileName));
|
|
121538
121643
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
121539
121644
|
host.getParsedCommandLine(configFileName) :
|
|
121540
121645
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -121838,8 +121943,8 @@ var ts;
|
|
|
121838
121943
|
*/
|
|
121839
121944
|
function createBuilderStatusReporter(system, pretty) {
|
|
121840
121945
|
return function (diagnostic) {
|
|
121841
|
-
var output = pretty ? "["
|
|
121842
|
-
output += ""
|
|
121946
|
+
var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
|
|
121947
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
|
|
121843
121948
|
system.write(output);
|
|
121844
121949
|
};
|
|
121845
121950
|
}
|
|
@@ -122614,7 +122719,7 @@ var ts;
|
|
|
122614
122719
|
function listEmittedFile(_a, proj, file) {
|
|
122615
122720
|
var write = _a.write;
|
|
122616
122721
|
if (write && proj.options.listEmittedFiles) {
|
|
122617
|
-
write("TSFILE: "
|
|
122722
|
+
write("TSFILE: ".concat(file));
|
|
122618
122723
|
}
|
|
122619
122724
|
}
|
|
122620
122725
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -122643,7 +122748,7 @@ var ts;
|
|
|
122643
122748
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
122644
122749
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
122645
122750
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
122646
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType
|
|
122751
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
|
|
122647
122752
|
if (canEmitBuildInfo)
|
|
122648
122753
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
122649
122754
|
afterProgramDone(state, program, config);
|
|
@@ -122671,7 +122776,7 @@ var ts;
|
|
|
122671
122776
|
if (!host.fileExists(inputFile)) {
|
|
122672
122777
|
return {
|
|
122673
122778
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
122674
|
-
reason: inputFile
|
|
122779
|
+
reason: "".concat(inputFile, " does not exist")
|
|
122675
122780
|
};
|
|
122676
122781
|
}
|
|
122677
122782
|
if (!force) {
|
|
@@ -123030,7 +123135,7 @@ var ts;
|
|
|
123030
123135
|
}
|
|
123031
123136
|
}
|
|
123032
123137
|
if (filesToDelete) {
|
|
123033
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
123138
|
+
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(""));
|
|
123034
123139
|
}
|
|
123035
123140
|
return ts.ExitStatus.Success;
|
|
123036
123141
|
}
|
|
@@ -123368,7 +123473,7 @@ var ts;
|
|
|
123368
123473
|
function nowString() {
|
|
123369
123474
|
// E.g. "12:34:56.789"
|
|
123370
123475
|
var d = new Date();
|
|
123371
|
-
return ts.padLeft(d.getHours().toString(), 2, "0")
|
|
123476
|
+
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"));
|
|
123372
123477
|
}
|
|
123373
123478
|
server.nowString = nowString;
|
|
123374
123479
|
})(server = ts.server || (ts.server = {}));
|
|
@@ -123379,7 +123484,7 @@ var ts;
|
|
|
123379
123484
|
var JsTyping;
|
|
123380
123485
|
(function (JsTyping) {
|
|
123381
123486
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
123382
|
-
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts"
|
|
123487
|
+
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
|
|
123383
123488
|
return availableVersion.compareTo(cachedTyping.version) <= 0;
|
|
123384
123489
|
}
|
|
123385
123490
|
JsTyping.isTypingUpToDate = isTypingUpToDate;
|
|
@@ -123432,7 +123537,7 @@ var ts;
|
|
|
123432
123537
|
"worker_threads",
|
|
123433
123538
|
"zlib"
|
|
123434
123539
|
];
|
|
123435
|
-
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:"
|
|
123540
|
+
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
|
|
123436
123541
|
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
|
|
123437
123542
|
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
|
|
123438
123543
|
function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
@@ -123505,7 +123610,7 @@ var ts;
|
|
|
123505
123610
|
var excludeTypingName = exclude_1[_i];
|
|
123506
123611
|
var didDelete = inferredTypings.delete(excludeTypingName);
|
|
123507
123612
|
if (didDelete && log)
|
|
123508
|
-
log("Typing for "
|
|
123613
|
+
log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
|
|
123509
123614
|
}
|
|
123510
123615
|
var newTypingNames = [];
|
|
123511
123616
|
var cachedTypingPaths = [];
|
|
@@ -123519,7 +123624,7 @@ var ts;
|
|
|
123519
123624
|
});
|
|
123520
123625
|
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
|
|
123521
123626
|
if (log)
|
|
123522
|
-
log("Result: "
|
|
123627
|
+
log("Result: ".concat(JSON.stringify(result)));
|
|
123523
123628
|
return result;
|
|
123524
123629
|
function addInferredTyping(typingName) {
|
|
123525
123630
|
if (!inferredTypings.has(typingName)) {
|
|
@@ -123528,7 +123633,7 @@ var ts;
|
|
|
123528
123633
|
}
|
|
123529
123634
|
function addInferredTypings(typingNames, message) {
|
|
123530
123635
|
if (log)
|
|
123531
|
-
log(message
|
|
123636
|
+
log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
|
|
123532
123637
|
ts.forEach(typingNames, addInferredTyping);
|
|
123533
123638
|
}
|
|
123534
123639
|
/**
|
|
@@ -123550,7 +123655,7 @@ var ts;
|
|
|
123550
123655
|
filesToWatch.push(manifestPath);
|
|
123551
123656
|
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
|
|
123552
123657
|
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
|
|
123553
|
-
addInferredTypings(manifestTypingNames, "Typing names in '"
|
|
123658
|
+
addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
|
|
123554
123659
|
}
|
|
123555
123660
|
// Now we scan the directories for typing information in
|
|
123556
123661
|
// already-installed dependencies (if present). Note that this
|
|
@@ -123594,7 +123699,7 @@ var ts;
|
|
|
123594
123699
|
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
|
|
123595
123700
|
});
|
|
123596
123701
|
if (log)
|
|
123597
|
-
log("Searching for typing names in "
|
|
123702
|
+
log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
|
|
123598
123703
|
// Once we have the names of things to look up, we iterate over
|
|
123599
123704
|
// and either collect their included typings, or add them to the
|
|
123600
123705
|
// list of typings we need to look up separately.
|
|
@@ -123613,12 +123718,12 @@ var ts;
|
|
|
123613
123718
|
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
|
|
123614
123719
|
if (host.fileExists(absolutePath)) {
|
|
123615
123720
|
if (log)
|
|
123616
|
-
log(" Package '"
|
|
123721
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types."));
|
|
123617
123722
|
inferredTypings.set(manifest_1.name, absolutePath);
|
|
123618
123723
|
}
|
|
123619
123724
|
else {
|
|
123620
123725
|
if (log)
|
|
123621
|
-
log(" Package '"
|
|
123726
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
|
|
123622
123727
|
}
|
|
123623
123728
|
}
|
|
123624
123729
|
else {
|
|
@@ -123714,15 +123819,15 @@ var ts;
|
|
|
123714
123819
|
var kind = isScopeName ? "Scope" : "Package";
|
|
123715
123820
|
switch (result) {
|
|
123716
123821
|
case 1 /* EmptyName */:
|
|
123717
|
-
return "'"
|
|
123822
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
|
|
123718
123823
|
case 2 /* NameTooLong */:
|
|
123719
|
-
return "'"
|
|
123824
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
|
|
123720
123825
|
case 3 /* NameStartsWithDot */:
|
|
123721
|
-
return "'"
|
|
123826
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
|
|
123722
123827
|
case 4 /* NameStartsWithUnderscore */:
|
|
123723
|
-
return "'"
|
|
123828
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
|
|
123724
123829
|
case 5 /* NameContainsNonURISafeCharacters */:
|
|
123725
|
-
return "'"
|
|
123830
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
|
|
123726
123831
|
case 0 /* Ok */:
|
|
123727
123832
|
return ts.Debug.fail(); // Shouldn't have called this.
|
|
123728
123833
|
default:
|
|
@@ -123748,7 +123853,7 @@ var ts;
|
|
|
123748
123853
|
}
|
|
123749
123854
|
catch (e) {
|
|
123750
123855
|
if (log.isEnabled()) {
|
|
123751
|
-
log.writeLine("Failed to resolve "
|
|
123856
|
+
log.writeLine("Failed to resolve ".concat(packageName, " in folder '").concat(cachePath, "': ").concat(e.message));
|
|
123752
123857
|
}
|
|
123753
123858
|
return undefined;
|
|
123754
123859
|
}
|
|
@@ -123769,7 +123874,7 @@ var ts;
|
|
|
123769
123874
|
var sliceStart = packageNames.length - remaining;
|
|
123770
123875
|
var command, toSlice = remaining;
|
|
123771
123876
|
while (true) {
|
|
123772
|
-
command = npmPath
|
|
123877
|
+
command = "".concat(npmPath, " install --ignore-scripts ").concat((toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" "), " --save-dev --user-agent=\"typesInstaller/").concat(tsVersion, "\"");
|
|
123773
123878
|
if (command.length < 8000) {
|
|
123774
123879
|
break;
|
|
123775
123880
|
}
|
|
@@ -123796,12 +123901,12 @@ var ts;
|
|
|
123796
123901
|
ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
|
|
123797
123902
|
})(ProjectWatcherType || (ProjectWatcherType = {}));
|
|
123798
123903
|
function getDetailWatchInfo(projectName, watchers) {
|
|
123799
|
-
return "Project: "
|
|
123904
|
+
return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
|
|
123800
123905
|
}
|
|
123801
123906
|
var TypingsInstaller = /** @class */ (function () {
|
|
123802
123907
|
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
|
|
123803
|
-
var _this = this;
|
|
123804
123908
|
if (log === void 0) { log = nullLog; }
|
|
123909
|
+
var _this = this;
|
|
123805
123910
|
this.installTypingHost = installTypingHost;
|
|
123806
123911
|
this.globalCachePath = globalCachePath;
|
|
123807
123912
|
this.safeListPath = safeListPath;
|
|
@@ -123820,7 +123925,7 @@ var ts;
|
|
|
123820
123925
|
this.globalCachePackageJsonPath = ts.combinePaths(globalCachePath, "package.json");
|
|
123821
123926
|
var isLoggingEnabled = this.log.isEnabled();
|
|
123822
123927
|
if (isLoggingEnabled) {
|
|
123823
|
-
this.log.writeLine("Global cache location '"
|
|
123928
|
+
this.log.writeLine("Global cache location '".concat(globalCachePath, "', safe file path '").concat(safeListPath, "', types map path ").concat(typesMapLocation));
|
|
123824
123929
|
}
|
|
123825
123930
|
this.watchFactory = ts.getWatchFactory(this.installTypingHost, isLoggingEnabled ? ts.WatchLogLevel.Verbose : ts.WatchLogLevel.None, function (s) { return _this.log.writeLine(s); }, getDetailWatchInfo);
|
|
123826
123931
|
this.processCacheLocation(this.globalCachePath);
|
|
@@ -123830,30 +123935,30 @@ var ts;
|
|
|
123830
123935
|
};
|
|
123831
123936
|
TypingsInstaller.prototype.closeWatchers = function (projectName) {
|
|
123832
123937
|
if (this.log.isEnabled()) {
|
|
123833
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
123938
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "'"));
|
|
123834
123939
|
}
|
|
123835
123940
|
var watchers = this.projectWatchers.get(projectName);
|
|
123836
123941
|
if (!watchers) {
|
|
123837
123942
|
if (this.log.isEnabled()) {
|
|
123838
|
-
this.log.writeLine("No watchers are registered for project '"
|
|
123943
|
+
this.log.writeLine("No watchers are registered for project '".concat(projectName, "'"));
|
|
123839
123944
|
}
|
|
123840
123945
|
return;
|
|
123841
123946
|
}
|
|
123842
123947
|
ts.clearMap(watchers, ts.closeFileWatcher);
|
|
123843
123948
|
this.projectWatchers.delete(projectName);
|
|
123844
123949
|
if (this.log.isEnabled()) {
|
|
123845
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
123950
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "' - done."));
|
|
123846
123951
|
}
|
|
123847
123952
|
};
|
|
123848
123953
|
TypingsInstaller.prototype.install = function (req) {
|
|
123849
123954
|
var _this = this;
|
|
123850
123955
|
if (this.log.isEnabled()) {
|
|
123851
|
-
this.log.writeLine("Got install request "
|
|
123956
|
+
this.log.writeLine("Got install request ".concat(JSON.stringify(req)));
|
|
123852
123957
|
}
|
|
123853
123958
|
// load existing typing information from the cache
|
|
123854
123959
|
if (req.cachePath) {
|
|
123855
123960
|
if (this.log.isEnabled()) {
|
|
123856
|
-
this.log.writeLine("Request specifies cache path '"
|
|
123961
|
+
this.log.writeLine("Request specifies cache path '".concat(req.cachePath, "', loading cached information..."));
|
|
123857
123962
|
}
|
|
123858
123963
|
this.processCacheLocation(req.cachePath);
|
|
123859
123964
|
}
|
|
@@ -123862,7 +123967,7 @@ var ts;
|
|
|
123862
123967
|
}
|
|
123863
123968
|
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);
|
|
123864
123969
|
if (this.log.isEnabled()) {
|
|
123865
|
-
this.log.writeLine("Finished typings discovery: "
|
|
123970
|
+
this.log.writeLine("Finished typings discovery: ".concat(JSON.stringify(discoverTypingsResult)));
|
|
123866
123971
|
}
|
|
123867
123972
|
// start watching files
|
|
123868
123973
|
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions);
|
|
@@ -123882,17 +123987,17 @@ var ts;
|
|
|
123882
123987
|
if (this.typesMapLocation) {
|
|
123883
123988
|
var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation);
|
|
123884
123989
|
if (safeListFromMap) {
|
|
123885
|
-
this.log.writeLine("Loaded safelist from types map file '"
|
|
123990
|
+
this.log.writeLine("Loaded safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
123886
123991
|
this.safeList = safeListFromMap;
|
|
123887
123992
|
return;
|
|
123888
123993
|
}
|
|
123889
|
-
this.log.writeLine("Failed to load safelist from types map file '"
|
|
123994
|
+
this.log.writeLine("Failed to load safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
123890
123995
|
}
|
|
123891
123996
|
this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
|
|
123892
123997
|
};
|
|
123893
123998
|
TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) {
|
|
123894
123999
|
if (this.log.isEnabled()) {
|
|
123895
|
-
this.log.writeLine("Processing cache location '"
|
|
124000
|
+
this.log.writeLine("Processing cache location '".concat(cacheLocation, "'"));
|
|
123896
124001
|
}
|
|
123897
124002
|
if (this.knownCachesSet.has(cacheLocation)) {
|
|
123898
124003
|
if (this.log.isEnabled()) {
|
|
@@ -123903,14 +124008,14 @@ var ts;
|
|
|
123903
124008
|
var packageJson = ts.combinePaths(cacheLocation, "package.json");
|
|
123904
124009
|
var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json");
|
|
123905
124010
|
if (this.log.isEnabled()) {
|
|
123906
|
-
this.log.writeLine("Trying to find '"
|
|
124011
|
+
this.log.writeLine("Trying to find '".concat(packageJson, "'..."));
|
|
123907
124012
|
}
|
|
123908
124013
|
if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) {
|
|
123909
124014
|
var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); // TODO: GH#18217
|
|
123910
124015
|
var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); // TODO: GH#18217
|
|
123911
124016
|
if (this.log.isEnabled()) {
|
|
123912
|
-
this.log.writeLine("Loaded content of '"
|
|
123913
|
-
this.log.writeLine("Loaded content of '"
|
|
124017
|
+
this.log.writeLine("Loaded content of '".concat(packageJson, "': ").concat(JSON.stringify(npmConfig)));
|
|
124018
|
+
this.log.writeLine("Loaded content of '".concat(packageLockJson, "'"));
|
|
123914
124019
|
}
|
|
123915
124020
|
if (npmConfig.devDependencies && npmLock.dependencies) {
|
|
123916
124021
|
for (var key in npmConfig.devDependencies) {
|
|
@@ -123934,11 +124039,11 @@ var ts;
|
|
|
123934
124039
|
continue;
|
|
123935
124040
|
}
|
|
123936
124041
|
if (this.log.isEnabled()) {
|
|
123937
|
-
this.log.writeLine("New typing for package "
|
|
124042
|
+
this.log.writeLine("New typing for package ".concat(packageName, " from '").concat(typingFile, "' conflicts with existing typing file '").concat(existingTypingFile, "'"));
|
|
123938
124043
|
}
|
|
123939
124044
|
}
|
|
123940
124045
|
if (this.log.isEnabled()) {
|
|
123941
|
-
this.log.writeLine("Adding entry into typings cache: '"
|
|
124046
|
+
this.log.writeLine("Adding entry into typings cache: '".concat(packageName, "' => '").concat(typingFile, "'"));
|
|
123942
124047
|
}
|
|
123943
124048
|
var info = ts.getProperty(npmLock.dependencies, key);
|
|
123944
124049
|
var version_1 = info && info.version;
|
|
@@ -123951,7 +124056,7 @@ var ts;
|
|
|
123951
124056
|
}
|
|
123952
124057
|
}
|
|
123953
124058
|
if (this.log.isEnabled()) {
|
|
123954
|
-
this.log.writeLine("Finished processing cache location '"
|
|
124059
|
+
this.log.writeLine("Finished processing cache location '".concat(cacheLocation, "'"));
|
|
123955
124060
|
}
|
|
123956
124061
|
this.knownCachesSet.add(cacheLocation);
|
|
123957
124062
|
};
|
|
@@ -123961,7 +124066,7 @@ var ts;
|
|
|
123961
124066
|
var typingKey = ts.mangleScopedPackageName(typing);
|
|
123962
124067
|
if (_this.missingTypingsSet.has(typingKey)) {
|
|
123963
124068
|
if (_this.log.isEnabled())
|
|
123964
|
-
_this.log.writeLine("'"
|
|
124069
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' is in missingTypingsSet - skipping..."));
|
|
123965
124070
|
return undefined;
|
|
123966
124071
|
}
|
|
123967
124072
|
var validationResult = ts.JsTyping.validatePackageName(typing);
|
|
@@ -123974,12 +124079,12 @@ var ts;
|
|
|
123974
124079
|
}
|
|
123975
124080
|
if (!_this.typesRegistry.has(typingKey)) {
|
|
123976
124081
|
if (_this.log.isEnabled())
|
|
123977
|
-
_this.log.writeLine("'"
|
|
124082
|
+
_this.log.writeLine("'".concat(typing, "':: Entry for package '").concat(typingKey, "' does not exist in local types registry - skipping..."));
|
|
123978
124083
|
return undefined;
|
|
123979
124084
|
}
|
|
123980
124085
|
if (_this.packageNameToTypingLocation.get(typingKey) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typingKey), _this.typesRegistry.get(typingKey))) {
|
|
123981
124086
|
if (_this.log.isEnabled())
|
|
123982
|
-
_this.log.writeLine("'"
|
|
124087
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' already has an up-to-date typing - skipping..."));
|
|
123983
124088
|
return undefined;
|
|
123984
124089
|
}
|
|
123985
124090
|
return typingKey;
|
|
@@ -123988,11 +124093,11 @@ var ts;
|
|
|
123988
124093
|
TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) {
|
|
123989
124094
|
var npmConfigPath = ts.combinePaths(directory, "package.json");
|
|
123990
124095
|
if (this.log.isEnabled()) {
|
|
123991
|
-
this.log.writeLine("Npm config file: "
|
|
124096
|
+
this.log.writeLine("Npm config file: ".concat(npmConfigPath));
|
|
123992
124097
|
}
|
|
123993
124098
|
if (!this.installTypingHost.fileExists(npmConfigPath)) {
|
|
123994
124099
|
if (this.log.isEnabled()) {
|
|
123995
|
-
this.log.writeLine("Npm config file: '"
|
|
124100
|
+
this.log.writeLine("Npm config file: '".concat(npmConfigPath, "' is missing, creating new one..."));
|
|
123996
124101
|
}
|
|
123997
124102
|
this.ensureDirectoryExists(directory, this.installTypingHost);
|
|
123998
124103
|
this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }');
|
|
@@ -124001,7 +124106,7 @@ var ts;
|
|
|
124001
124106
|
TypingsInstaller.prototype.installTypings = function (req, cachePath, currentlyCachedTypings, typingsToInstall) {
|
|
124002
124107
|
var _this = this;
|
|
124003
124108
|
if (this.log.isEnabled()) {
|
|
124004
|
-
this.log.writeLine("Installing typings "
|
|
124109
|
+
this.log.writeLine("Installing typings ".concat(JSON.stringify(typingsToInstall)));
|
|
124005
124110
|
}
|
|
124006
124111
|
var filteredTypings = this.filterTypings(typingsToInstall);
|
|
124007
124112
|
if (filteredTypings.length === 0) {
|
|
@@ -124028,7 +124133,7 @@ var ts;
|
|
|
124028
124133
|
try {
|
|
124029
124134
|
if (!ok) {
|
|
124030
124135
|
if (_this.log.isEnabled()) {
|
|
124031
|
-
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: "
|
|
124136
|
+
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: ".concat(JSON.stringify(filteredTypings)));
|
|
124032
124137
|
}
|
|
124033
124138
|
for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
|
|
124034
124139
|
var typing = filteredTypings_1[_i];
|
|
@@ -124038,7 +124143,7 @@ var ts;
|
|
|
124038
124143
|
}
|
|
124039
124144
|
// TODO: watch project directory
|
|
124040
124145
|
if (_this.log.isEnabled()) {
|
|
124041
|
-
_this.log.writeLine("Installed typings "
|
|
124146
|
+
_this.log.writeLine("Installed typings ".concat(JSON.stringify(scopedTypings)));
|
|
124042
124147
|
}
|
|
124043
124148
|
var installedTypingFiles = [];
|
|
124044
124149
|
for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
|
|
@@ -124050,13 +124155,13 @@ var ts;
|
|
|
124050
124155
|
}
|
|
124051
124156
|
// packageName is guaranteed to exist in typesRegistry by filterTypings
|
|
124052
124157
|
var distTags = _this.typesRegistry.get(packageName);
|
|
124053
|
-
var newVersion = new ts.Version(distTags["ts"
|
|
124158
|
+
var newVersion = new ts.Version(distTags["ts".concat(ts.versionMajorMinor)] || distTags[_this.latestDistTag]);
|
|
124054
124159
|
var newTyping = { typingLocation: typingFile, version: newVersion };
|
|
124055
124160
|
_this.packageNameToTypingLocation.set(packageName, newTyping);
|
|
124056
124161
|
installedTypingFiles.push(typingFile);
|
|
124057
124162
|
}
|
|
124058
124163
|
if (_this.log.isEnabled()) {
|
|
124059
|
-
_this.log.writeLine("Installed typing files "
|
|
124164
|
+
_this.log.writeLine("Installed typing files ".concat(JSON.stringify(installedTypingFiles)));
|
|
124060
124165
|
}
|
|
124061
124166
|
_this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles)));
|
|
124062
124167
|
}
|
|
@@ -124110,7 +124215,7 @@ var ts;
|
|
|
124110
124215
|
return;
|
|
124111
124216
|
}
|
|
124112
124217
|
if (isLoggingEnabled) {
|
|
124113
|
-
_this.log.writeLine(projectWatcherType
|
|
124218
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Added:: WatchInfo: ").concat(path));
|
|
124114
124219
|
}
|
|
124115
124220
|
var watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ?
|
|
124116
124221
|
_this.watchFactory.watchFile(path, function () {
|
|
@@ -124131,7 +124236,7 @@ var ts;
|
|
|
124131
124236
|
}, 1 /* Recursive */, options, projectName, watchers);
|
|
124132
124237
|
watchers.set(canonicalPath, isLoggingEnabled ? {
|
|
124133
124238
|
close: function () {
|
|
124134
|
-
_this.log.writeLine(projectWatcherType
|
|
124239
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Closed:: WatchInfo: ").concat(path));
|
|
124135
124240
|
watcher.close();
|
|
124136
124241
|
}
|
|
124137
124242
|
} : watcher);
|
|
@@ -124206,7 +124311,7 @@ var ts;
|
|
|
124206
124311
|
typingsInstaller.TypingsInstaller = TypingsInstaller;
|
|
124207
124312
|
/* @internal */
|
|
124208
124313
|
function typingsName(packageName) {
|
|
124209
|
-
return "@types/"
|
|
124314
|
+
return "@types/".concat(packageName, "@ts").concat(ts.versionMajorMinor);
|
|
124210
124315
|
}
|
|
124211
124316
|
typingsInstaller.typingsName = typingsName;
|
|
124212
124317
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|
|
@@ -124231,7 +124336,7 @@ var ts;
|
|
|
124231
124336
|
if (typeof _this.logFile !== "string")
|
|
124232
124337
|
return;
|
|
124233
124338
|
try {
|
|
124234
|
-
fs.appendFileSync(_this.logFile, "["
|
|
124339
|
+
fs.appendFileSync(_this.logFile, "[".concat(server.nowString(), "] ").concat(text).concat(ts.sys.newLine));
|
|
124235
124340
|
}
|
|
124236
124341
|
catch (e) {
|
|
124237
124342
|
_this.logFile = undefined;
|
|
@@ -124247,7 +124352,7 @@ var ts;
|
|
|
124247
124352
|
return npmPath;
|
|
124248
124353
|
}
|
|
124249
124354
|
if (host.fileExists(npmPath)) {
|
|
124250
|
-
return "\""
|
|
124355
|
+
return "\"".concat(npmPath, "\"");
|
|
124251
124356
|
}
|
|
124252
124357
|
}
|
|
124253
124358
|
return "npm";
|
|
@@ -124255,7 +124360,7 @@ var ts;
|
|
|
124255
124360
|
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
|
|
124256
124361
|
if (!host.fileExists(typesRegistryFilePath)) {
|
|
124257
124362
|
if (log.isEnabled()) {
|
|
124258
|
-
log.writeLine("Types registry file '"
|
|
124363
|
+
log.writeLine("Types registry file '".concat(typesRegistryFilePath, "' does not exist"));
|
|
124259
124364
|
}
|
|
124260
124365
|
return new ts.Map();
|
|
124261
124366
|
}
|
|
@@ -124265,14 +124370,14 @@ var ts;
|
|
|
124265
124370
|
}
|
|
124266
124371
|
catch (e) {
|
|
124267
124372
|
if (log.isEnabled()) {
|
|
124268
|
-
log.writeLine("Error when loading types registry file '"
|
|
124373
|
+
log.writeLine("Error when loading types registry file '".concat(typesRegistryFilePath, "': ").concat(e.message, ", ").concat(e.stack));
|
|
124269
124374
|
}
|
|
124270
124375
|
return new ts.Map();
|
|
124271
124376
|
}
|
|
124272
124377
|
}
|
|
124273
124378
|
var typesRegistryPackageName = "types-registry";
|
|
124274
124379
|
function getTypesRegistryFileLocation(globalTypingsCacheLocation) {
|
|
124275
|
-
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/"
|
|
124380
|
+
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/".concat(typesRegistryPackageName, "/index.json"));
|
|
124276
124381
|
}
|
|
124277
124382
|
var NodeTypingsInstaller = (function (_super) {
|
|
124278
124383
|
__extends(NodeTypingsInstaller, _super);
|
|
@@ -124280,27 +124385,27 @@ var ts;
|
|
|
124280
124385
|
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;
|
|
124281
124386
|
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
|
|
124282
124387
|
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
|
|
124283
|
-
_this.npmPath = "\""
|
|
124388
|
+
_this.npmPath = "\"".concat(_this.npmPath, "\"");
|
|
124284
124389
|
}
|
|
124285
124390
|
if (_this.log.isEnabled()) {
|
|
124286
|
-
_this.log.writeLine("Process id: "
|
|
124287
|
-
_this.log.writeLine("NPM location: "
|
|
124288
|
-
_this.log.writeLine("validateDefaultNpmLocation: "
|
|
124391
|
+
_this.log.writeLine("Process id: ".concat(process.pid));
|
|
124392
|
+
_this.log.writeLine("NPM location: ".concat(_this.npmPath, " (explicit '").concat(server.Arguments.NpmLocation, "' ").concat(npmLocation === undefined ? "not " : "", " provided)"));
|
|
124393
|
+
_this.log.writeLine("validateDefaultNpmLocation: ".concat(validateDefaultNpmLocation));
|
|
124289
124394
|
}
|
|
124290
124395
|
(_this.nodeExecSync = require("child_process").execSync);
|
|
124291
124396
|
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
|
|
124292
124397
|
try {
|
|
124293
124398
|
if (_this.log.isEnabled()) {
|
|
124294
|
-
_this.log.writeLine("Updating "
|
|
124399
|
+
_this.log.writeLine("Updating ".concat(typesRegistryPackageName, " npm package..."));
|
|
124295
124400
|
}
|
|
124296
|
-
_this.execSyncAndLog(_this.npmPath
|
|
124401
|
+
_this.execSyncAndLog("".concat(_this.npmPath, " install --ignore-scripts ").concat(typesRegistryPackageName, "@").concat(_this.latestDistTag), { cwd: globalTypingsCacheLocation });
|
|
124297
124402
|
if (_this.log.isEnabled()) {
|
|
124298
|
-
_this.log.writeLine("Updated "
|
|
124403
|
+
_this.log.writeLine("Updated ".concat(typesRegistryPackageName, " npm package"));
|
|
124299
124404
|
}
|
|
124300
124405
|
}
|
|
124301
124406
|
catch (e) {
|
|
124302
124407
|
if (_this.log.isEnabled()) {
|
|
124303
|
-
_this.log.writeLine("Error updating "
|
|
124408
|
+
_this.log.writeLine("Error updating ".concat(typesRegistryPackageName, " package: ").concat(e.message));
|
|
124304
124409
|
}
|
|
124305
124410
|
_this.delayedInitializationError = {
|
|
124306
124411
|
kind: "event::initializationFailed",
|
|
@@ -124339,7 +124444,7 @@ var ts;
|
|
|
124339
124444
|
var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
|
|
124340
124445
|
if (cwd) {
|
|
124341
124446
|
_this.installWorker(-1, [packageName_1], cwd, function (success) {
|
|
124342
|
-
var message = success ? "Package "
|
|
124447
|
+
var message = success ? "Package ".concat(packageName_1, " installed.") : "There was an error installing ".concat(packageName_1, ".");
|
|
124343
124448
|
var response = { kind: server.ActionPackageInstalled, projectName: projectName_1, success: success, message: message };
|
|
124344
124449
|
_this.sendResponse(response);
|
|
124345
124450
|
});
|
|
@@ -124357,7 +124462,7 @@ var ts;
|
|
|
124357
124462
|
};
|
|
124358
124463
|
NodeTypingsInstaller.prototype.sendResponse = function (response) {
|
|
124359
124464
|
if (this.log.isEnabled()) {
|
|
124360
|
-
this.log.writeLine("Sending response:\n "
|
|
124465
|
+
this.log.writeLine("Sending response:\n ".concat(JSON.stringify(response)));
|
|
124361
124466
|
}
|
|
124362
124467
|
process.send(response);
|
|
124363
124468
|
if (this.log.isEnabled()) {
|
|
@@ -124367,29 +124472,29 @@ var ts;
|
|
|
124367
124472
|
NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
|
|
124368
124473
|
var _this = this;
|
|
124369
124474
|
if (this.log.isEnabled()) {
|
|
124370
|
-
this.log.writeLine("#"
|
|
124475
|
+
this.log.writeLine("#".concat(requestId, " with arguments'").concat(JSON.stringify(packageNames), "'."));
|
|
124371
124476
|
}
|
|
124372
124477
|
var start = Date.now();
|
|
124373
124478
|
var hasError = typingsInstaller.installNpmPackages(this.npmPath, ts.version, packageNames, function (command) { return _this.execSyncAndLog(command, { cwd: cwd }); });
|
|
124374
124479
|
if (this.log.isEnabled()) {
|
|
124375
|
-
this.log.writeLine("npm install #"
|
|
124480
|
+
this.log.writeLine("npm install #".concat(requestId, " took: ").concat(Date.now() - start, " ms"));
|
|
124376
124481
|
}
|
|
124377
124482
|
onRequestCompleted(!hasError);
|
|
124378
124483
|
};
|
|
124379
124484
|
NodeTypingsInstaller.prototype.execSyncAndLog = function (command, options) {
|
|
124380
124485
|
if (this.log.isEnabled()) {
|
|
124381
|
-
this.log.writeLine("Exec: "
|
|
124486
|
+
this.log.writeLine("Exec: ".concat(command));
|
|
124382
124487
|
}
|
|
124383
124488
|
try {
|
|
124384
124489
|
var stdout = this.nodeExecSync(command, __assign(__assign({}, options), { encoding: "utf-8" }));
|
|
124385
124490
|
if (this.log.isEnabled()) {
|
|
124386
|
-
this.log.writeLine(" Succeeded. stdout:"
|
|
124491
|
+
this.log.writeLine(" Succeeded. stdout:".concat(indent(ts.sys.newLine, stdout)));
|
|
124387
124492
|
}
|
|
124388
124493
|
return false;
|
|
124389
124494
|
}
|
|
124390
124495
|
catch (error) {
|
|
124391
124496
|
var stdout = error.stdout, stderr = error.stderr;
|
|
124392
|
-
this.log.writeLine(" Failed. stdout:"
|
|
124497
|
+
this.log.writeLine(" Failed. stdout:".concat(indent(ts.sys.newLine, stdout)).concat(ts.sys.newLine, " stderr:").concat(indent(ts.sys.newLine, stderr)));
|
|
124393
124498
|
return true;
|
|
124394
124499
|
}
|
|
124395
124500
|
};
|
|
@@ -124412,7 +124517,7 @@ var ts;
|
|
|
124412
124517
|
var log = new FileLog(logFilePath);
|
|
124413
124518
|
if (log.isEnabled()) {
|
|
124414
124519
|
process.on("uncaughtException", function (e) {
|
|
124415
|
-
log.writeLine("Unhandled exception: "
|
|
124520
|
+
log.writeLine("Unhandled exception: ".concat(e, " at ").concat(e.stack));
|
|
124416
124521
|
});
|
|
124417
124522
|
}
|
|
124418
124523
|
process.on("disconnect", function () {
|
|
@@ -124425,7 +124530,7 @@ var ts;
|
|
|
124425
124530
|
installer.listen();
|
|
124426
124531
|
function indent(newline, str) {
|
|
124427
124532
|
return str && str.length
|
|
124428
|
-
? newline
|
|
124533
|
+
? "".concat(newline, " ") + str.replace(/\r?\n/, "".concat(newline, " "))
|
|
124429
124534
|
: "";
|
|
124430
124535
|
}
|
|
124431
124536
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|