typescript 4.8.0-dev.20220627 → 4.8.0-dev.20220630
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/tsc.js +164 -110
- package/lib/tsserver.js +211 -150
- package/lib/tsserverlibrary.js +211 -150
- package/lib/typescript.js +210 -149
- package/lib/typescriptServices.js +210 -149
- package/lib/typingsInstaller.js +169 -116
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220630";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2667,6 +2667,22 @@ var ts;
|
|
|
2667
2667
|
return wrapFunction(deprecation, func);
|
|
2668
2668
|
}
|
|
2669
2669
|
Debug.deprecate = deprecate;
|
|
2670
|
+
function formatVariance(varianceFlags) {
|
|
2671
|
+
var variance = varianceFlags & 7;
|
|
2672
|
+
var result = variance === 0 ? "in out" :
|
|
2673
|
+
variance === 3 ? "[bivariant]" :
|
|
2674
|
+
variance === 2 ? "in" :
|
|
2675
|
+
variance === 1 ? "out" :
|
|
2676
|
+
variance === 4 ? "[independent]" : "";
|
|
2677
|
+
if (varianceFlags & 8) {
|
|
2678
|
+
result += " (unmeasurable)";
|
|
2679
|
+
}
|
|
2680
|
+
else if (varianceFlags & 16) {
|
|
2681
|
+
result += " (unreliable)";
|
|
2682
|
+
}
|
|
2683
|
+
return result;
|
|
2684
|
+
}
|
|
2685
|
+
Debug.formatVariance = formatVariance;
|
|
2670
2686
|
})(Debug = ts.Debug || (ts.Debug = {}));
|
|
2671
2687
|
})(ts || (ts = {}));
|
|
2672
2688
|
var ts;
|
|
@@ -3239,9 +3255,9 @@ var ts;
|
|
|
3239
3255
|
eventStack.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp(), separateBeginAndEnd: separateBeginAndEnd });
|
|
3240
3256
|
}
|
|
3241
3257
|
tracingEnabled.push = push;
|
|
3242
|
-
function pop() {
|
|
3258
|
+
function pop(results) {
|
|
3243
3259
|
ts.Debug.assert(eventStack.length > 0);
|
|
3244
|
-
writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp());
|
|
3260
|
+
writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp(), results);
|
|
3245
3261
|
eventStack.length--;
|
|
3246
3262
|
}
|
|
3247
3263
|
tracingEnabled.pop = pop;
|
|
@@ -3254,13 +3270,14 @@ var ts;
|
|
|
3254
3270
|
}
|
|
3255
3271
|
tracingEnabled.popAll = popAll;
|
|
3256
3272
|
var sampleInterval = 1000 * 10;
|
|
3257
|
-
function writeStackEvent(index, endTime) {
|
|
3273
|
+
function writeStackEvent(index, endTime, results) {
|
|
3258
3274
|
var _a = eventStack[index], phase = _a.phase, name = _a.name, args = _a.args, time = _a.time, separateBeginAndEnd = _a.separateBeginAndEnd;
|
|
3259
3275
|
if (separateBeginAndEnd) {
|
|
3276
|
+
ts.Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`");
|
|
3260
3277
|
writeEvent("E", phase, name, args, undefined, endTime);
|
|
3261
3278
|
}
|
|
3262
3279
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3263
|
-
writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
|
|
3280
|
+
writeEvent("X", phase, name, __assign(__assign({}, args), { results: results }), "\"dur\":" + (endTime - time), time);
|
|
3264
3281
|
}
|
|
3265
3282
|
}
|
|
3266
3283
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -26618,11 +26635,11 @@ var ts;
|
|
|
26618
26635
|
}
|
|
26619
26636
|
return parseElement();
|
|
26620
26637
|
}
|
|
26621
|
-
function currentNode(parsingContext) {
|
|
26638
|
+
function currentNode(parsingContext, pos) {
|
|
26622
26639
|
if (!syntaxCursor || !isReusableParsingContext(parsingContext) || parseErrorBeforeNextFinishedNode) {
|
|
26623
26640
|
return undefined;
|
|
26624
26641
|
}
|
|
26625
|
-
var node = syntaxCursor.currentNode(scanner.getStartPos());
|
|
26642
|
+
var node = syntaxCursor.currentNode(pos !== null && pos !== void 0 ? pos : scanner.getStartPos());
|
|
26626
26643
|
if (ts.nodeIsMissing(node) || node.intersectsChange || ts.containsParseError(node)) {
|
|
26627
26644
|
return undefined;
|
|
26628
26645
|
}
|
|
@@ -29480,18 +29497,16 @@ var ts;
|
|
|
29480
29497
|
return modifier.kind === 135;
|
|
29481
29498
|
}
|
|
29482
29499
|
function parseDeclaration() {
|
|
29483
|
-
var isAmbient = ts.some(lookAhead(function () { return (parseDecorators(), parseModifiers()); }), isDeclareModifier);
|
|
29484
|
-
if (isAmbient) {
|
|
29485
|
-
var node = tryReuseAmbientDeclaration();
|
|
29486
|
-
if (node) {
|
|
29487
|
-
return node;
|
|
29488
|
-
}
|
|
29489
|
-
}
|
|
29490
29500
|
var pos = getNodePos();
|
|
29491
29501
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
29492
29502
|
var decorators = parseDecorators();
|
|
29493
29503
|
var modifiers = parseModifiers();
|
|
29504
|
+
var isAmbient = ts.some(modifiers, isDeclareModifier);
|
|
29494
29505
|
if (isAmbient) {
|
|
29506
|
+
var node = tryReuseAmbientDeclaration(pos);
|
|
29507
|
+
if (node) {
|
|
29508
|
+
return node;
|
|
29509
|
+
}
|
|
29495
29510
|
for (var _i = 0, _a = modifiers; _i < _a.length; _i++) {
|
|
29496
29511
|
var m = _a[_i];
|
|
29497
29512
|
m.flags |= 16777216;
|
|
@@ -29502,9 +29517,9 @@ var ts;
|
|
|
29502
29517
|
return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers);
|
|
29503
29518
|
}
|
|
29504
29519
|
}
|
|
29505
|
-
function tryReuseAmbientDeclaration() {
|
|
29520
|
+
function tryReuseAmbientDeclaration(pos) {
|
|
29506
29521
|
return doInsideOfContext(16777216, function () {
|
|
29507
|
-
var node = currentNode(parsingContext);
|
|
29522
|
+
var node = currentNode(parsingContext, pos);
|
|
29508
29523
|
if (node) {
|
|
29509
29524
|
return consumeNode(node);
|
|
29510
29525
|
}
|
|
@@ -56298,7 +56313,7 @@ var ts;
|
|
|
56298
56313
|
_loop_22(tp);
|
|
56299
56314
|
}
|
|
56300
56315
|
links.variances = variances;
|
|
56301
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
56316
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
56302
56317
|
}
|
|
56303
56318
|
return links.variances;
|
|
56304
56319
|
}
|
|
@@ -61331,8 +61346,8 @@ var ts;
|
|
|
61331
61346
|
var conditional = node.parent;
|
|
61332
61347
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : undefined;
|
|
61333
61348
|
}
|
|
61334
|
-
function getContextualTypeForChildJsxExpression(node, child) {
|
|
61335
|
-
var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName);
|
|
61349
|
+
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
61350
|
+
var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
61336
61351
|
var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
61337
61352
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
61338
61353
|
return undefined;
|
|
@@ -61349,24 +61364,24 @@ var ts;
|
|
|
61349
61364
|
}
|
|
61350
61365
|
}, true));
|
|
61351
61366
|
}
|
|
61352
|
-
function getContextualTypeForJsxExpression(node) {
|
|
61367
|
+
function getContextualTypeForJsxExpression(node, contextFlags) {
|
|
61353
61368
|
var exprParent = node.parent;
|
|
61354
61369
|
return ts.isJsxAttributeLike(exprParent)
|
|
61355
|
-
? getContextualType(node)
|
|
61370
|
+
? getContextualType(node, contextFlags)
|
|
61356
61371
|
: ts.isJsxElement(exprParent)
|
|
61357
|
-
? getContextualTypeForChildJsxExpression(exprParent, node)
|
|
61372
|
+
? getContextualTypeForChildJsxExpression(exprParent, node, contextFlags)
|
|
61358
61373
|
: undefined;
|
|
61359
61374
|
}
|
|
61360
|
-
function getContextualTypeForJsxAttribute(attribute) {
|
|
61375
|
+
function getContextualTypeForJsxAttribute(attribute, contextFlags) {
|
|
61361
61376
|
if (ts.isJsxAttribute(attribute)) {
|
|
61362
|
-
var attributesType = getApparentTypeOfContextualType(attribute.parent);
|
|
61377
|
+
var attributesType = getApparentTypeOfContextualType(attribute.parent, contextFlags);
|
|
61363
61378
|
if (!attributesType || isTypeAny(attributesType)) {
|
|
61364
61379
|
return undefined;
|
|
61365
61380
|
}
|
|
61366
61381
|
return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText);
|
|
61367
61382
|
}
|
|
61368
61383
|
else {
|
|
61369
|
-
return getContextualType(attribute.parent);
|
|
61384
|
+
return getContextualType(attribute.parent, contextFlags);
|
|
61370
61385
|
}
|
|
61371
61386
|
}
|
|
61372
61387
|
function isPossiblyDiscriminantValue(node) {
|
|
@@ -61490,10 +61505,10 @@ var ts;
|
|
|
61490
61505
|
case 271:
|
|
61491
61506
|
return tryGetTypeFromEffectiveTypeNode(parent);
|
|
61492
61507
|
case 288:
|
|
61493
|
-
return getContextualTypeForJsxExpression(parent);
|
|
61508
|
+
return getContextualTypeForJsxExpression(parent, contextFlags);
|
|
61494
61509
|
case 285:
|
|
61495
61510
|
case 287:
|
|
61496
|
-
return getContextualTypeForJsxAttribute(parent);
|
|
61511
|
+
return getContextualTypeForJsxAttribute(parent, contextFlags);
|
|
61497
61512
|
case 280:
|
|
61498
61513
|
case 279:
|
|
61499
61514
|
return getContextualJsxElementAttributesType(parent, contextFlags);
|
|
@@ -67586,12 +67601,14 @@ var ts;
|
|
|
67586
67601
|
error(node, ts.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
67587
67602
|
}
|
|
67588
67603
|
else if (modifiers === 32768 || modifiers === 65536) {
|
|
67604
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
|
|
67589
67605
|
var source = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSubTypeForCheck : markerSuperTypeForCheck);
|
|
67590
67606
|
var target = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSuperTypeForCheck : markerSubTypeForCheck);
|
|
67591
67607
|
var saveVarianceTypeParameter = typeParameter;
|
|
67592
67608
|
varianceTypeParameter = typeParameter;
|
|
67593
67609
|
checkTypeAssignableTo(source, target, node, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
67594
67610
|
varianceTypeParameter = saveVarianceTypeParameter;
|
|
67611
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
67595
67612
|
}
|
|
67596
67613
|
}
|
|
67597
67614
|
}
|
|
@@ -68800,8 +68817,17 @@ var ts;
|
|
|
68800
68817
|
return typeAsAwaitable.awaitedTypeOfType;
|
|
68801
68818
|
}
|
|
68802
68819
|
if (type.flags & 1048576) {
|
|
68820
|
+
if (awaitedTypeStack.lastIndexOf(type.id) >= 0) {
|
|
68821
|
+
if (errorNode) {
|
|
68822
|
+
error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method);
|
|
68823
|
+
}
|
|
68824
|
+
return undefined;
|
|
68825
|
+
}
|
|
68803
68826
|
var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
|
|
68804
|
-
|
|
68827
|
+
awaitedTypeStack.push(type.id);
|
|
68828
|
+
var mapped = mapType(type, mapper);
|
|
68829
|
+
awaitedTypeStack.pop();
|
|
68830
|
+
return typeAsAwaitable.awaitedTypeOfType = mapped;
|
|
68805
68831
|
}
|
|
68806
68832
|
var thisTypeForErrorOut = { value: undefined };
|
|
68807
68833
|
var promisedType = getPromisedTypeOfPromise(type, undefined, thisTypeForErrorOut);
|
|
@@ -73993,10 +74019,16 @@ var ts;
|
|
|
73993
74019
|
if (!fileToDirective) {
|
|
73994
74020
|
return undefined;
|
|
73995
74021
|
}
|
|
73996
|
-
var meaning
|
|
73997
|
-
if (
|
|
74022
|
+
var meaning;
|
|
74023
|
+
if (node.parent.kind === 162) {
|
|
73998
74024
|
meaning = 111551 | 1048576;
|
|
73999
74025
|
}
|
|
74026
|
+
else {
|
|
74027
|
+
meaning = 788968 | 1920;
|
|
74028
|
+
if ((node.kind === 79 && isInTypeQuery(node)) || (node.kind === 206 && !isInHeritageClause(node))) {
|
|
74029
|
+
meaning = 111551 | 1048576;
|
|
74030
|
+
}
|
|
74031
|
+
}
|
|
74000
74032
|
var symbol = resolveEntityName(node, meaning, true);
|
|
74001
74033
|
return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : undefined;
|
|
74002
74034
|
}
|
|
@@ -91407,7 +91439,6 @@ var ts;
|
|
|
91407
91439
|
var _b = ts.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _b.enter, exit = _b.exit;
|
|
91408
91440
|
var bundleBuildInfo;
|
|
91409
91441
|
var emitSkipped = false;
|
|
91410
|
-
var exportedModulesFromDeclarationEmit;
|
|
91411
91442
|
enter();
|
|
91412
91443
|
forEachEmittedFile(host, emitSourceFileOrBundle, ts.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile);
|
|
91413
91444
|
exit();
|
|
@@ -91416,7 +91447,6 @@ var ts;
|
|
|
91416
91447
|
diagnostics: emitterDiagnostics.getDiagnostics(),
|
|
91417
91448
|
emittedFiles: emittedFilesList,
|
|
91418
91449
|
sourceMaps: sourceMapDataList,
|
|
91419
|
-
exportedModulesFromDeclarationEmit: exportedModulesFromDeclarationEmit
|
|
91420
91450
|
};
|
|
91421
91451
|
function emitSourceFileOrBundle(_a, sourceFileOrBundle) {
|
|
91422
91452
|
var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;
|
|
@@ -91501,7 +91531,7 @@ var ts;
|
|
|
91501
91531
|
substituteNode: transform.substituteNode,
|
|
91502
91532
|
});
|
|
91503
91533
|
ts.Debug.assert(transform.transformed.length === 1, "Should only see one output from the transform");
|
|
91504
|
-
printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform
|
|
91534
|
+
printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, compilerOptions);
|
|
91505
91535
|
transform.dispose();
|
|
91506
91536
|
if (bundleBuildInfo)
|
|
91507
91537
|
bundleBuildInfo.js = printer.bundleFileInfo;
|
|
@@ -91533,7 +91563,7 @@ var ts;
|
|
|
91533
91563
|
noEmitHelpers: true,
|
|
91534
91564
|
module: compilerOptions.module,
|
|
91535
91565
|
target: compilerOptions.target,
|
|
91536
|
-
sourceMap: compilerOptions.
|
|
91566
|
+
sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
|
|
91537
91567
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
91538
91568
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
91539
91569
|
onlyPrintJsDocStyle: true,
|
|
@@ -91551,16 +91581,12 @@ var ts;
|
|
|
91551
91581
|
emitSkipped = emitSkipped || declBlocked;
|
|
91552
91582
|
if (!declBlocked || forceDtsEmit) {
|
|
91553
91583
|
ts.Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
|
|
91554
|
-
printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform
|
|
91555
|
-
sourceMap:
|
|
91584
|
+
printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform, declarationPrinter, {
|
|
91585
|
+
sourceMap: printerOptions.sourceMap,
|
|
91556
91586
|
sourceRoot: compilerOptions.sourceRoot,
|
|
91557
91587
|
mapRoot: compilerOptions.mapRoot,
|
|
91558
91588
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
91559
91589
|
});
|
|
91560
|
-
if (forceDtsEmit && declarationTransform.transformed[0].kind === 305) {
|
|
91561
|
-
var sourceFile = declarationTransform.transformed[0];
|
|
91562
|
-
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
|
|
91563
|
-
}
|
|
91564
91590
|
}
|
|
91565
91591
|
declarationTransform.dispose();
|
|
91566
91592
|
if (bundleBuildInfo)
|
|
@@ -91579,7 +91605,8 @@ var ts;
|
|
|
91579
91605
|
}
|
|
91580
91606
|
ts.forEachChild(node, collectLinkedAliases);
|
|
91581
91607
|
}
|
|
91582
|
-
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath,
|
|
91608
|
+
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, mapOptions) {
|
|
91609
|
+
var sourceFileOrBundle = transform.transformed[0];
|
|
91583
91610
|
var bundle = sourceFileOrBundle.kind === 306 ? sourceFileOrBundle : undefined;
|
|
91584
91611
|
var sourceFile = sourceFileOrBundle.kind === 305 ? sourceFileOrBundle : undefined;
|
|
91585
91612
|
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
|
|
@@ -91612,16 +91639,16 @@ var ts;
|
|
|
91612
91639
|
var sourceMap = sourceMapGenerator.toString();
|
|
91613
91640
|
ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
|
|
91614
91641
|
if (printer.bundleFileInfo)
|
|
91615
|
-
printer.bundleFileInfo.mapHash = ts.
|
|
91642
|
+
printer.bundleFileInfo.mapHash = ts.computeSignature(sourceMap, ts.maybeBind(host, host.createHash));
|
|
91616
91643
|
}
|
|
91617
91644
|
}
|
|
91618
91645
|
else {
|
|
91619
91646
|
writer.writeLine();
|
|
91620
91647
|
}
|
|
91621
91648
|
var text = writer.getText();
|
|
91622
|
-
ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos });
|
|
91649
|
+
ts.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos: sourceMapUrlPos, diagnostics: transform.diagnostics });
|
|
91623
91650
|
if (printer.bundleFileInfo)
|
|
91624
|
-
printer.bundleFileInfo.hash = ts.
|
|
91651
|
+
printer.bundleFileInfo.hash = ts.computeSignature(text, ts.maybeBind(host, host.createHash));
|
|
91625
91652
|
writer.clear();
|
|
91626
91653
|
}
|
|
91627
91654
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
@@ -91766,22 +91793,22 @@ var ts;
|
|
|
91766
91793
|
var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
|
|
91767
91794
|
if (!jsFileText)
|
|
91768
91795
|
return jsFilePath;
|
|
91769
|
-
if (ts.
|
|
91796
|
+
if (ts.computeSignature(jsFileText, createHash) !== buildInfo.bundle.js.hash)
|
|
91770
91797
|
return jsFilePath;
|
|
91771
91798
|
var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
|
|
91772
91799
|
if ((sourceMapFilePath && !sourceMapText) || config.options.inlineSourceMap)
|
|
91773
91800
|
return sourceMapFilePath || "inline sourcemap decoding";
|
|
91774
|
-
if (sourceMapFilePath && ts.
|
|
91801
|
+
if (sourceMapFilePath && ts.computeSignature(sourceMapText, createHash) !== buildInfo.bundle.js.mapHash)
|
|
91775
91802
|
return sourceMapFilePath;
|
|
91776
91803
|
var declarationText = declarationFilePath && host.readFile(declarationFilePath);
|
|
91777
91804
|
if (declarationFilePath && !declarationText)
|
|
91778
91805
|
return declarationFilePath;
|
|
91779
|
-
if (declarationFilePath && ts.
|
|
91806
|
+
if (declarationFilePath && ts.computeSignature(declarationText, createHash) !== buildInfo.bundle.dts.hash)
|
|
91780
91807
|
return declarationFilePath;
|
|
91781
91808
|
var declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
|
|
91782
91809
|
if ((declarationMapPath && !declarationMapText) || config.options.inlineSourceMap)
|
|
91783
91810
|
return declarationMapPath || "inline sourcemap decoding";
|
|
91784
|
-
if (declarationMapPath && ts.
|
|
91811
|
+
if (declarationMapPath && ts.computeSignature(declarationMapText, createHash) !== buildInfo.bundle.dts.mapHash)
|
|
91785
91812
|
return declarationMapPath;
|
|
91786
91813
|
var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
91787
91814
|
var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo, true);
|
|
@@ -91819,7 +91846,7 @@ var ts;
|
|
|
91819
91846
|
var newBuildInfo = data.buildInfo;
|
|
91820
91847
|
newBuildInfo.program = buildInfo.program;
|
|
91821
91848
|
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
|
91822
|
-
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText,
|
|
91849
|
+
newBuildInfo.program.outSignature = ts.computeSignature(changedDtsText, createHash, changedDtsData);
|
|
91823
91850
|
newBuildInfo.program.dtsChangeTime = ts.getCurrentTime(host).getTime();
|
|
91824
91851
|
}
|
|
91825
91852
|
var _a = buildInfo.bundle, js = _a.js, dts = _a.dts, sourceFiles = _a.sourceFiles;
|
|
@@ -98804,7 +98831,7 @@ var ts;
|
|
|
98804
98831
|
}
|
|
98805
98832
|
}
|
|
98806
98833
|
function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
98807
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!
|
|
98834
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
|
|
98808
98835
|
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason);
|
|
98809
98836
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
98810
98837
|
}
|
|
@@ -99793,8 +99820,8 @@ var ts;
|
|
|
99793
99820
|
(function (ts) {
|
|
99794
99821
|
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
|
|
99795
99822
|
var outputFiles = [];
|
|
99796
|
-
var _a = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a.emitSkipped, diagnostics = _a.diagnostics
|
|
99797
|
-
return { outputFiles: outputFiles, emitSkipped: emitSkipped, diagnostics: diagnostics
|
|
99823
|
+
var _a = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a.emitSkipped, diagnostics = _a.diagnostics;
|
|
99824
|
+
return { outputFiles: outputFiles, emitSkipped: emitSkipped, diagnostics: diagnostics };
|
|
99798
99825
|
function writeFile(fileName, text, writeByteOrderMark) {
|
|
99799
99826
|
outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text });
|
|
99800
99827
|
}
|
|
@@ -99985,23 +100012,23 @@ var ts;
|
|
|
99985
100012
|
state.allFileNames = undefined;
|
|
99986
100013
|
}
|
|
99987
100014
|
BuilderState.releaseCache = releaseCache;
|
|
99988
|
-
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash) {
|
|
100015
|
+
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, getCanonicalFileName) {
|
|
99989
100016
|
var _a, _b;
|
|
99990
|
-
var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash);
|
|
100017
|
+
var result = getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash, getCanonicalFileName);
|
|
99991
100018
|
(_a = state.oldSignatures) === null || _a === void 0 ? void 0 : _a.clear();
|
|
99992
100019
|
(_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear();
|
|
99993
100020
|
return result;
|
|
99994
100021
|
}
|
|
99995
100022
|
BuilderState.getFilesAffectedBy = getFilesAffectedBy;
|
|
99996
|
-
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash) {
|
|
100023
|
+
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, computeHash, getCanonicalFileName) {
|
|
99997
100024
|
var sourceFile = programOfThisState.getSourceFileByPath(path);
|
|
99998
100025
|
if (!sourceFile) {
|
|
99999
100026
|
return ts.emptyArray;
|
|
100000
100027
|
}
|
|
100001
|
-
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash)) {
|
|
100028
|
+
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName)) {
|
|
100002
100029
|
return [sourceFile];
|
|
100003
100030
|
}
|
|
100004
|
-
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash);
|
|
100031
|
+
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName);
|
|
100005
100032
|
}
|
|
100006
100033
|
BuilderState.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
|
|
100007
100034
|
function updateSignatureOfFile(state, signature, path) {
|
|
@@ -100009,7 +100036,7 @@ var ts;
|
|
|
100009
100036
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts.Set())).add(path);
|
|
100010
100037
|
}
|
|
100011
100038
|
BuilderState.updateSignatureOfFile = updateSignatureOfFile;
|
|
100012
|
-
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, useFileVersionAsSignature) {
|
|
100039
|
+
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName, useFileVersionAsSignature) {
|
|
100013
100040
|
var _a;
|
|
100014
100041
|
if (useFileVersionAsSignature === void 0) { useFileVersionAsSignature = state.useFileVersionAsSignature; }
|
|
100015
100042
|
if ((_a = state.hasCalledUpdateShapeSignature) === null || _a === void 0 ? void 0 : _a.has(sourceFile.resolvedPath))
|
|
@@ -100018,15 +100045,13 @@ var ts;
|
|
|
100018
100045
|
var prevSignature = info.signature;
|
|
100019
100046
|
var latestSignature;
|
|
100020
100047
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
100021
|
-
|
|
100022
|
-
|
|
100023
|
-
|
|
100024
|
-
ts.Debug.assert(ts.isDeclarationFileName(firstDts_1.name), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
|
|
100025
|
-
latestSignature = computeSignature(firstDts_1.text, computeHash);
|
|
100048
|
+
programOfThisState.emit(sourceFile, function (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) {
|
|
100049
|
+
ts.Debug.assert(ts.isDeclarationFileName(fileName), "File extension for signature expected to be dts: Got:: " + fileName);
|
|
100050
|
+
latestSignature = ts.computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data);
|
|
100026
100051
|
if (latestSignature !== prevSignature) {
|
|
100027
|
-
updateExportedModules(state, sourceFile,
|
|
100052
|
+
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
100028
100053
|
}
|
|
100029
|
-
}
|
|
100054
|
+
}, cancellationToken, true, undefined, true);
|
|
100030
100055
|
}
|
|
100031
100056
|
if (latestSignature === undefined) {
|
|
100032
100057
|
latestSignature = sourceFile.version;
|
|
@@ -100047,10 +100072,6 @@ var ts;
|
|
|
100047
100072
|
return latestSignature !== prevSignature;
|
|
100048
100073
|
}
|
|
100049
100074
|
BuilderState.updateShapeSignature = updateShapeSignature;
|
|
100050
|
-
function computeSignature(text, computeHash) {
|
|
100051
|
-
return (computeHash || ts.generateDjb2Hash)(text);
|
|
100052
|
-
}
|
|
100053
|
-
BuilderState.computeSignature = computeSignature;
|
|
100054
100075
|
function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) {
|
|
100055
100076
|
if (!state.exportedModulesMap)
|
|
100056
100077
|
return;
|
|
@@ -100160,7 +100181,7 @@ var ts;
|
|
|
100160
100181
|
}
|
|
100161
100182
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100162
100183
|
}
|
|
100163
|
-
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash) {
|
|
100184
|
+
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash, getCanonicalFileName) {
|
|
100164
100185
|
if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
|
|
100165
100186
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100166
100187
|
}
|
|
@@ -100176,7 +100197,7 @@ var ts;
|
|
|
100176
100197
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
100177
100198
|
var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
|
|
100178
100199
|
seenFileNamesMap.set(currentPath, currentSourceFile);
|
|
100179
|
-
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash)) {
|
|
100200
|
+
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash, getCanonicalFileName)) {
|
|
100180
100201
|
queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
100181
100202
|
}
|
|
100182
100203
|
}
|
|
@@ -100332,7 +100353,7 @@ var ts;
|
|
|
100332
100353
|
function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
|
|
100333
100354
|
ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
|
|
100334
100355
|
}
|
|
100335
|
-
function getNextAffectedFile(state, cancellationToken, computeHash, host) {
|
|
100356
|
+
function getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100336
100357
|
var _a, _b;
|
|
100337
100358
|
while (true) {
|
|
100338
100359
|
var affectedFiles = state.affectedFiles;
|
|
@@ -100343,7 +100364,7 @@ var ts;
|
|
|
100343
100364
|
var affectedFile = affectedFiles[affectedFilesIndex];
|
|
100344
100365
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
100345
100366
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
100346
|
-
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
|
|
100367
|
+
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100347
100368
|
return affectedFile;
|
|
100348
100369
|
}
|
|
100349
100370
|
affectedFilesIndex++;
|
|
@@ -100364,7 +100385,7 @@ var ts;
|
|
|
100364
100385
|
ts.Debug.assert(!state.semanticDiagnosticsPerFile);
|
|
100365
100386
|
return program;
|
|
100366
100387
|
}
|
|
100367
|
-
state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash);
|
|
100388
|
+
state.affectedFiles = ts.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash, getCanonicalFileName);
|
|
100368
100389
|
state.currentChangedFilePath = nextKey.value;
|
|
100369
100390
|
state.affectedFilesIndex = 0;
|
|
100370
100391
|
if (!state.seenAffectedFiles)
|
|
@@ -100407,24 +100428,24 @@ var ts;
|
|
|
100407
100428
|
});
|
|
100408
100429
|
}
|
|
100409
100430
|
}
|
|
100410
|
-
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
|
|
100431
|
+
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100411
100432
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
100412
100433
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
100413
100434
|
removeDiagnosticsOfLibraryFiles(state);
|
|
100414
|
-
ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash);
|
|
100435
|
+
ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash, getCanonicalFileName);
|
|
100415
100436
|
return;
|
|
100416
100437
|
}
|
|
100417
100438
|
if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
|
|
100418
100439
|
return;
|
|
100419
|
-
handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
|
|
100440
|
+
handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100420
100441
|
}
|
|
100421
|
-
function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host) {
|
|
100442
|
+
function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100422
100443
|
removeSemanticDiagnosticsOf(state, path);
|
|
100423
100444
|
if (!state.changedFilesSet.has(path)) {
|
|
100424
100445
|
var program = ts.Debug.checkDefined(state.program);
|
|
100425
100446
|
var sourceFile = program.getSourceFileByPath(path);
|
|
100426
100447
|
if (sourceFile) {
|
|
100427
|
-
ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, !host.disableUseFileVersionAsSignature);
|
|
100448
|
+
ts.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, getCanonicalFileName, !host.disableUseFileVersionAsSignature);
|
|
100428
100449
|
if (ts.getEmitDeclarations(state.compilerOptions)) {
|
|
100429
100450
|
addToAffectedFilesPendingEmit(state, path, 0);
|
|
100430
100451
|
}
|
|
@@ -100444,16 +100465,16 @@ var ts;
|
|
|
100444
100465
|
var newSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
100445
100466
|
return newSignature !== oldSignature;
|
|
100446
100467
|
}
|
|
100447
|
-
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
|
|
100468
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100448
100469
|
var _a;
|
|
100449
100470
|
if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
|
|
100450
100471
|
return false;
|
|
100451
100472
|
ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, state.program, undefined)
|
|
100452
|
-
.forEach(function (file) { return handleDtsMayChangeOf(state, file.resolvedPath, cancellationToken, computeHash, host); });
|
|
100473
|
+
.forEach(function (file) { return handleDtsMayChangeOf(state, file.resolvedPath, cancellationToken, computeHash, getCanonicalFileName, host); });
|
|
100453
100474
|
removeDiagnosticsOfLibraryFiles(state);
|
|
100454
100475
|
return true;
|
|
100455
100476
|
}
|
|
100456
|
-
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
|
|
100477
|
+
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100457
100478
|
var _a;
|
|
100458
100479
|
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
100459
100480
|
return;
|
|
@@ -100467,9 +100488,9 @@ var ts;
|
|
|
100467
100488
|
var currentPath = queue.pop();
|
|
100468
100489
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
100469
100490
|
seenFileNamesMap.set(currentPath, true);
|
|
100470
|
-
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, host))
|
|
100491
|
+
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host))
|
|
100471
100492
|
return;
|
|
100472
|
-
handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, host);
|
|
100493
|
+
handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100473
100494
|
if (isChangedSignature(state, currentPath)) {
|
|
100474
100495
|
var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
100475
100496
|
queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -100479,27 +100500,27 @@ var ts;
|
|
|
100479
100500
|
}
|
|
100480
100501
|
var seenFileAndExportsOfFile = new ts.Set();
|
|
100481
100502
|
(_a = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
|
|
100482
|
-
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
|
|
100503
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, getCanonicalFileName, host))
|
|
100483
100504
|
return true;
|
|
100484
100505
|
var references = state.referencedMap.getKeys(exportedFromPath);
|
|
100485
100506
|
return references && ts.forEachKey(references, function (filePath) {
|
|
100486
|
-
return handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
100507
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100487
100508
|
});
|
|
100488
100509
|
});
|
|
100489
100510
|
}
|
|
100490
|
-
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
|
|
100511
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host) {
|
|
100491
100512
|
var _a, _b;
|
|
100492
100513
|
if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
|
|
100493
100514
|
return undefined;
|
|
100494
|
-
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
|
|
100515
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host))
|
|
100495
100516
|
return true;
|
|
100496
|
-
handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
|
|
100517
|
+
handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100497
100518
|
(_a = state.exportedModulesMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (exportedFromPath) {
|
|
100498
|
-
return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
100519
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100499
100520
|
});
|
|
100500
100521
|
(_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (referencingFilePath) {
|
|
100501
100522
|
return !seenFileAndExportsOfFile.has(referencingFilePath) &&
|
|
100502
|
-
handleDtsMayChangeOf(state, referencingFilePath, cancellationToken, computeHash, host);
|
|
100523
|
+
handleDtsMayChangeOf(state, referencingFilePath, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100503
100524
|
});
|
|
100504
100525
|
return undefined;
|
|
100505
100526
|
}
|
|
@@ -100783,8 +100804,39 @@ var ts;
|
|
|
100783
100804
|
return { host: host, newProgram: newProgram, oldProgram: oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts.emptyArray };
|
|
100784
100805
|
}
|
|
100785
100806
|
ts.getBuilderCreationParameters = getBuilderCreationParameters;
|
|
100786
|
-
function
|
|
100787
|
-
return
|
|
100807
|
+
function getTextHandlingSourceMapForSignature(text, data) {
|
|
100808
|
+
return (data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== undefined ? text.substring(0, data.sourceMapUrlPos) : text;
|
|
100809
|
+
}
|
|
100810
|
+
function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data) {
|
|
100811
|
+
var _a;
|
|
100812
|
+
text = getTextHandlingSourceMapForSignature(text, data);
|
|
100813
|
+
var sourceFileDirectory;
|
|
100814
|
+
if ((_a = data === null || data === void 0 ? void 0 : data.diagnostics) === null || _a === void 0 ? void 0 : _a.length) {
|
|
100815
|
+
text += data.diagnostics.map(function (diagnostic) {
|
|
100816
|
+
return "" + locationInfo(diagnostic) + ts.DiagnosticCategory[diagnostic.category] + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText);
|
|
100817
|
+
}).join("\n");
|
|
100818
|
+
}
|
|
100819
|
+
return (computeHash !== null && computeHash !== void 0 ? computeHash : ts.generateDjb2Hash)(text);
|
|
100820
|
+
function flattenDiagnosticMessageText(diagnostic) {
|
|
100821
|
+
return ts.isString(diagnostic) ?
|
|
100822
|
+
diagnostic :
|
|
100823
|
+
diagnostic === undefined ?
|
|
100824
|
+
"" :
|
|
100825
|
+
!diagnostic.next ?
|
|
100826
|
+
diagnostic.messageText :
|
|
100827
|
+
diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText).join("\n");
|
|
100828
|
+
}
|
|
100829
|
+
function locationInfo(diagnostic) {
|
|
100830
|
+
if (diagnostic.file.resolvedPath === sourceFile.resolvedPath)
|
|
100831
|
+
return "(" + diagnostic.start + "," + diagnostic.length + ")";
|
|
100832
|
+
if (sourceFileDirectory === undefined)
|
|
100833
|
+
sourceFileDirectory = ts.getDirectoryPath(sourceFile.resolvedPath);
|
|
100834
|
+
return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceFileDirectory, diagnostic.file.resolvedPath, getCanonicalFileName)) + "(" + diagnostic.start + "," + diagnostic.length + ")";
|
|
100835
|
+
}
|
|
100836
|
+
}
|
|
100837
|
+
ts.computeSignatureWithDiagnostics = computeSignatureWithDiagnostics;
|
|
100838
|
+
function computeSignature(text, computeHash, data) {
|
|
100839
|
+
return (computeHash !== null && computeHash !== void 0 ? computeHash : ts.generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
100788
100840
|
}
|
|
100789
100841
|
ts.computeSignature = computeSignature;
|
|
100790
100842
|
function createBuilderProgram(kind, _a) {
|
|
@@ -100832,7 +100884,7 @@ var ts;
|
|
|
100832
100884
|
return ts.emitSkippedWithNoDiagnostics;
|
|
100833
100885
|
}
|
|
100834
100886
|
function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
100835
|
-
var affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
|
|
100887
|
+
var affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100836
100888
|
var emitKind = 1;
|
|
100837
100889
|
var isPendingEmitFile = false;
|
|
100838
100890
|
if (!affected) {
|
|
@@ -100861,46 +100913,48 @@ var ts;
|
|
|
100861
100913
|
}
|
|
100862
100914
|
function getWriteFileCallback(writeFile, customTransformers) {
|
|
100863
100915
|
return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
|
|
100864
|
-
var _a, _b, _c;
|
|
100916
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
100865
100917
|
if (ts.isDeclarationFileName(fileName)) {
|
|
100866
100918
|
if (!ts.outFile(state.compilerOptions)) {
|
|
100867
100919
|
ts.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1);
|
|
100868
|
-
var
|
|
100920
|
+
var emitSignature = void 0;
|
|
100869
100921
|
if (!customTransformers) {
|
|
100870
100922
|
var file = sourceFiles[0];
|
|
100871
100923
|
var info = state.fileInfos.get(file.resolvedPath);
|
|
100872
100924
|
if (info.signature === file.version) {
|
|
100873
|
-
|
|
100874
|
-
if (
|
|
100925
|
+
var signature = computeSignatureWithDiagnostics(file, text, computeHash, getCanonicalFileName, data);
|
|
100926
|
+
if (!((_a = data === null || data === void 0 ? void 0 : data.diagnostics) === null || _a === void 0 ? void 0 : _a.length))
|
|
100927
|
+
emitSignature = signature;
|
|
100928
|
+
if (signature !== file.version) {
|
|
100875
100929
|
if (host.storeFilesChangingSignatureDuringEmit)
|
|
100876
|
-
(state.filesChangingSignature
|
|
100930
|
+
((_b = state.filesChangingSignature) !== null && _b !== void 0 ? _b : (state.filesChangingSignature = new ts.Set())).add(file.resolvedPath);
|
|
100877
100931
|
if (state.exportedModulesMap)
|
|
100878
100932
|
ts.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit);
|
|
100879
100933
|
if (state.affectedFiles) {
|
|
100880
|
-
var existing = (
|
|
100934
|
+
var existing = (_c = state.oldSignatures) === null || _c === void 0 ? void 0 : _c.get(file.resolvedPath);
|
|
100881
100935
|
if (existing === undefined)
|
|
100882
|
-
(state.oldSignatures
|
|
100883
|
-
info.signature =
|
|
100936
|
+
((_d = state.oldSignatures) !== null && _d !== void 0 ? _d : (state.oldSignatures = new ts.Map())).set(file.resolvedPath, info.signature || false);
|
|
100937
|
+
info.signature = signature;
|
|
100884
100938
|
}
|
|
100885
100939
|
else {
|
|
100886
|
-
info.signature =
|
|
100887
|
-
(
|
|
100940
|
+
info.signature = signature;
|
|
100941
|
+
(_e = state.oldExportedModulesMap) === null || _e === void 0 ? void 0 : _e.clear();
|
|
100888
100942
|
}
|
|
100889
100943
|
}
|
|
100890
100944
|
}
|
|
100891
100945
|
}
|
|
100892
100946
|
if (state.compilerOptions.composite) {
|
|
100893
100947
|
var filePath = sourceFiles[0].resolvedPath;
|
|
100894
|
-
var oldSignature = (
|
|
100895
|
-
|
|
100896
|
-
if (
|
|
100897
|
-
(state.emitSignatures
|
|
100948
|
+
var oldSignature = (_f = state.emitSignatures) === null || _f === void 0 ? void 0 : _f.get(filePath);
|
|
100949
|
+
emitSignature !== null && emitSignature !== void 0 ? emitSignature : (emitSignature = computeSignature(text, computeHash, data));
|
|
100950
|
+
if (emitSignature !== oldSignature) {
|
|
100951
|
+
((_g = state.emitSignatures) !== null && _g !== void 0 ? _g : (state.emitSignatures = new ts.Map())).set(filePath, emitSignature);
|
|
100898
100952
|
state.hasChangedEmitSignature = true;
|
|
100899
100953
|
}
|
|
100900
100954
|
}
|
|
100901
100955
|
}
|
|
100902
100956
|
else if (state.compilerOptions.composite) {
|
|
100903
|
-
var newSignature = computeSignature(text,
|
|
100957
|
+
var newSignature = computeSignature(text, computeHash, data);
|
|
100904
100958
|
if (newSignature !== state.outSignature) {
|
|
100905
100959
|
state.outSignature = newSignature;
|
|
100906
100960
|
state.hasChangedEmitSignature = true;
|
|
@@ -100960,7 +101014,7 @@ var ts;
|
|
|
100960
101014
|
}
|
|
100961
101015
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
100962
101016
|
while (true) {
|
|
100963
|
-
var affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
|
|
101017
|
+
var affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host);
|
|
100964
101018
|
if (!affected) {
|
|
100965
101019
|
return undefined;
|
|
100966
101020
|
}
|