@typescript-deploys/pr-build 4.7.0-pr-48581-7 → 4.7.0-pr-48788-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cs/diagnosticMessages.generated.json +2 -0
- package/lib/de/diagnosticMessages.generated.json +2 -0
- package/lib/es/diagnosticMessages.generated.json +2 -0
- package/lib/fr/diagnosticMessages.generated.json +2 -0
- package/lib/it/diagnosticMessages.generated.json +2 -0
- package/lib/ja/diagnosticMessages.generated.json +2 -0
- package/lib/ko/diagnosticMessages.generated.json +2 -0
- package/lib/pl/diagnosticMessages.generated.json +2 -0
- package/lib/protocol.d.ts +4 -0
- package/lib/pt-br/diagnosticMessages.generated.json +2 -0
- package/lib/ru/diagnosticMessages.generated.json +2 -0
- package/lib/tr/diagnosticMessages.generated.json +2 -0
- package/lib/tsc.js +297 -240
- package/lib/tsserver.js +782 -382
- package/lib/tsserverlibrary.d.ts +7 -2
- package/lib/tsserverlibrary.js +782 -382
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +541 -362
- package/lib/typescriptServices.d.ts +0 -1
- package/lib/typescriptServices.js +541 -362
- package/lib/typingsInstaller.js +364 -279
- package/lib/zh-cn/diagnosticMessages.generated.json +2 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +2 -0
- 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.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220420";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -5901,6 +5901,7 @@ var ts;
|
|
|
5901
5901
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
5902
5902
|
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
5903
5903
|
Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),
|
|
5904
|
+
Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, ts.DiagnosticCategory.Error, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),
|
|
5904
5905
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
5905
5906
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
5906
5907
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -11443,6 +11444,10 @@ var ts;
|
|
|
11443
11444
|
}
|
|
11444
11445
|
}
|
|
11445
11446
|
ts.isAnyImportSyntax = isAnyImportSyntax;
|
|
11447
|
+
function isAnyImportOrBareOrAccessedRequire(node) {
|
|
11448
|
+
return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
11449
|
+
}
|
|
11450
|
+
ts.isAnyImportOrBareOrAccessedRequire = isAnyImportOrBareOrAccessedRequire;
|
|
11446
11451
|
function isLateVisibilityPaintedStatement(node) {
|
|
11447
11452
|
switch (node.kind) {
|
|
11448
11453
|
case 266:
|
|
@@ -12673,17 +12678,13 @@ var ts;
|
|
|
12673
12678
|
if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) {
|
|
12674
12679
|
return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);
|
|
12675
12680
|
}
|
|
12676
|
-
if (ts.
|
|
12681
|
+
if (ts.isMemberName(name) && isLiteralLikeAccess(initializer) &&
|
|
12677
12682
|
(initializer.expression.kind === 108 ||
|
|
12678
12683
|
ts.isIdentifier(initializer.expression) &&
|
|
12679
12684
|
(initializer.expression.escapedText === "window" ||
|
|
12680
12685
|
initializer.expression.escapedText === "self" ||
|
|
12681
12686
|
initializer.expression.escapedText === "global"))) {
|
|
12682
|
-
|
|
12683
|
-
if (ts.isPrivateIdentifier(nameOrArgument)) {
|
|
12684
|
-
ts.Debug.fail("Unexpected PrivateIdentifier in name expression with literal-like access.");
|
|
12685
|
-
}
|
|
12686
|
-
return isSameEntityName(name, nameOrArgument);
|
|
12687
|
+
return isSameEntityName(name, getNameOrArgument(initializer));
|
|
12687
12688
|
}
|
|
12688
12689
|
if (isLiteralLikeAccess(name) && isLiteralLikeAccess(initializer)) {
|
|
12689
12690
|
return getElementOrPropertyAccessName(name) === getElementOrPropertyAccessName(initializer)
|
|
@@ -12873,14 +12874,14 @@ var ts;
|
|
|
12873
12874
|
}
|
|
12874
12875
|
ts.isFunctionSymbol = isFunctionSymbol;
|
|
12875
12876
|
function tryGetModuleSpecifierFromDeclaration(node) {
|
|
12876
|
-
var _a, _b
|
|
12877
|
+
var _a, _b;
|
|
12877
12878
|
switch (node.kind) {
|
|
12878
12879
|
case 254:
|
|
12879
|
-
return node.initializer.arguments[0]
|
|
12880
|
+
return (_a = ts.findAncestor(node.initializer, function (node) { return isRequireCall(node, true); })) === null || _a === void 0 ? void 0 : _a.arguments[0];
|
|
12880
12881
|
case 266:
|
|
12881
|
-
return
|
|
12882
|
+
return ts.tryCast(node.moduleSpecifier, ts.isStringLiteralLike);
|
|
12882
12883
|
case 265:
|
|
12883
|
-
return
|
|
12884
|
+
return ts.tryCast((_b = ts.tryCast(node.moduleReference, ts.isExternalModuleReference)) === null || _b === void 0 ? void 0 : _b.expression, ts.isStringLiteralLike);
|
|
12884
12885
|
default:
|
|
12885
12886
|
ts.Debug.assertNever(node);
|
|
12886
12887
|
}
|
|
@@ -13353,24 +13354,31 @@ var ts;
|
|
|
13353
13354
|
return parent.propertyName === node;
|
|
13354
13355
|
case 275:
|
|
13355
13356
|
case 285:
|
|
13357
|
+
case 279:
|
|
13358
|
+
case 280:
|
|
13359
|
+
case 281:
|
|
13356
13360
|
return true;
|
|
13357
13361
|
}
|
|
13358
13362
|
return false;
|
|
13359
13363
|
}
|
|
13360
13364
|
ts.isIdentifierName = isIdentifierName;
|
|
13361
13365
|
function isAliasSymbolDeclaration(node) {
|
|
13362
|
-
|
|
13366
|
+
if (node.kind === 265 ||
|
|
13363
13367
|
node.kind === 264 ||
|
|
13364
13368
|
node.kind === 267 && !!node.name ||
|
|
13365
13369
|
node.kind === 268 ||
|
|
13366
13370
|
node.kind === 274 ||
|
|
13367
13371
|
node.kind === 270 ||
|
|
13368
13372
|
node.kind === 275 ||
|
|
13369
|
-
node.kind === 271 && exportAssignmentIsAlias(node)
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13373
|
+
node.kind === 271 && exportAssignmentIsAlias(node)) {
|
|
13374
|
+
return true;
|
|
13375
|
+
}
|
|
13376
|
+
return isInJSFile(node) && (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) ||
|
|
13377
|
+
ts.isPropertyAccessExpression(node)
|
|
13378
|
+
&& ts.isBinaryExpression(node.parent)
|
|
13379
|
+
&& node.parent.left === node
|
|
13380
|
+
&& node.parent.operatorToken.kind === 63
|
|
13381
|
+
&& isAliasableExpression(node.parent.right));
|
|
13374
13382
|
}
|
|
13375
13383
|
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
|
|
13376
13384
|
function getAliasDeclarationFromName(node) {
|
|
@@ -13381,6 +13389,7 @@ var ts;
|
|
|
13381
13389
|
case 275:
|
|
13382
13390
|
case 271:
|
|
13383
13391
|
case 265:
|
|
13392
|
+
case 274:
|
|
13384
13393
|
return node.parent;
|
|
13385
13394
|
case 161:
|
|
13386
13395
|
do {
|
|
@@ -14880,6 +14889,11 @@ var ts;
|
|
|
14880
14889
|
(node.parent.kind === 206 && node.parent.name === node);
|
|
14881
14890
|
}
|
|
14882
14891
|
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
|
|
14892
|
+
function isRightSideOfAccessExpression(node) {
|
|
14893
|
+
return ts.isPropertyAccessExpression(node.parent) && node.parent.name === node
|
|
14894
|
+
|| ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
|
|
14895
|
+
}
|
|
14896
|
+
ts.isRightSideOfAccessExpression = isRightSideOfAccessExpression;
|
|
14883
14897
|
function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
|
|
14884
14898
|
return ts.isQualifiedName(node.parent) && node.parent.right === node
|
|
14885
14899
|
|| ts.isPropertyAccessExpression(node.parent) && node.parent.name === node
|
|
@@ -15440,6 +15454,38 @@ var ts;
|
|
|
15440
15454
|
return expr;
|
|
15441
15455
|
}
|
|
15442
15456
|
ts.getLeftmostAccessExpression = getLeftmostAccessExpression;
|
|
15457
|
+
function forEachNameInAccessChainWalkingLeft(name, action) {
|
|
15458
|
+
if (isAccessExpression(name.parent) && isRightSideOfAccessExpression(name)) {
|
|
15459
|
+
return walkAccessExpression(name.parent);
|
|
15460
|
+
}
|
|
15461
|
+
function walkAccessExpression(access) {
|
|
15462
|
+
if (access.kind === 206) {
|
|
15463
|
+
var res = action(access.name);
|
|
15464
|
+
if (res !== undefined) {
|
|
15465
|
+
return res;
|
|
15466
|
+
}
|
|
15467
|
+
}
|
|
15468
|
+
else if (access.kind === 207) {
|
|
15469
|
+
if (ts.isIdentifier(access.argumentExpression) || ts.isStringLiteralLike(access.argumentExpression)) {
|
|
15470
|
+
var res = action(access.argumentExpression);
|
|
15471
|
+
if (res !== undefined) {
|
|
15472
|
+
return res;
|
|
15473
|
+
}
|
|
15474
|
+
}
|
|
15475
|
+
else {
|
|
15476
|
+
return undefined;
|
|
15477
|
+
}
|
|
15478
|
+
}
|
|
15479
|
+
if (isAccessExpression(access.expression)) {
|
|
15480
|
+
return walkAccessExpression(access.expression);
|
|
15481
|
+
}
|
|
15482
|
+
if (ts.isIdentifier(access.expression)) {
|
|
15483
|
+
return action(access.expression);
|
|
15484
|
+
}
|
|
15485
|
+
return undefined;
|
|
15486
|
+
}
|
|
15487
|
+
}
|
|
15488
|
+
ts.forEachNameInAccessChainWalkingLeft = forEachNameInAccessChainWalkingLeft;
|
|
15443
15489
|
function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
15444
15490
|
while (true) {
|
|
15445
15491
|
switch (node.kind) {
|
|
@@ -16297,6 +16343,7 @@ var ts;
|
|
|
16297
16343
|
ts.supportedJSExtensionsFlat = ts.flatten(ts.supportedJSExtensions);
|
|
16298
16344
|
var allSupportedExtensions = [[".ts", ".tsx", ".d.ts", ".js", ".jsx"], [".cts", ".d.cts", ".cjs"], [".mts", ".d.mts", ".mjs"]];
|
|
16299
16345
|
var allSupportedExtensionsWithJson = __spreadArray(__spreadArray([], allSupportedExtensions, true), [[".json"]], false);
|
|
16346
|
+
ts.supportedDeclarationExtensions = [".d.ts", ".d.cts", ".d.mts"];
|
|
16300
16347
|
function getSupportedExtensions(options, extraFileExtensions) {
|
|
16301
16348
|
var needJsExtensions = options && getAllowJSCompilerOption(options);
|
|
16302
16349
|
if (!extraFileExtensions || extraFileExtensions.length === 0) {
|
|
@@ -16885,6 +16932,11 @@ var ts;
|
|
|
16885
16932
|
return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
|
|
16886
16933
|
}
|
|
16887
16934
|
ts.getNodeModulePathParts = getNodeModulePathParts;
|
|
16935
|
+
function getParameterTypeNode(parameter) {
|
|
16936
|
+
var _a;
|
|
16937
|
+
return parameter.kind === 340 ? (_a = parameter.typeExpression) === null || _a === void 0 ? void 0 : _a.type : parameter.type;
|
|
16938
|
+
}
|
|
16939
|
+
ts.getParameterTypeNode = getParameterTypeNode;
|
|
16888
16940
|
})(ts || (ts = {}));
|
|
16889
16941
|
var ts;
|
|
16890
16942
|
(function (ts) {
|
|
@@ -26681,7 +26733,7 @@ var ts;
|
|
|
26681
26733
|
var pos = getNodePos();
|
|
26682
26734
|
parseExpected(112);
|
|
26683
26735
|
var entityName = parseEntityName(true, true);
|
|
26684
|
-
var typeArguments = tryParseTypeArguments();
|
|
26736
|
+
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
26685
26737
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26686
26738
|
}
|
|
26687
26739
|
function parseTypeParameter() {
|
|
@@ -27744,9 +27796,7 @@ var ts;
|
|
|
27744
27796
|
return undefined;
|
|
27745
27797
|
}
|
|
27746
27798
|
}
|
|
27747
|
-
|
|
27748
|
-
return undefined;
|
|
27749
|
-
}
|
|
27799
|
+
var hasReturnColon = token() === 58;
|
|
27750
27800
|
var type = parseReturnType(58, false);
|
|
27751
27801
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27752
27802
|
return undefined;
|
|
@@ -27764,6 +27814,11 @@ var ts;
|
|
|
27764
27814
|
var body = (lastToken === 38 || lastToken === 18)
|
|
27765
27815
|
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier), disallowReturnTypeInArrowFunction)
|
|
27766
27816
|
: parseIdentifier();
|
|
27817
|
+
if (disallowReturnTypeInArrowFunction && hasReturnColon) {
|
|
27818
|
+
if (token() !== 58) {
|
|
27819
|
+
return undefined;
|
|
27820
|
+
}
|
|
27821
|
+
}
|
|
27767
27822
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
27768
27823
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
27769
27824
|
}
|
|
@@ -28386,29 +28441,9 @@ var ts;
|
|
|
28386
28441
|
case 20:
|
|
28387
28442
|
case 14:
|
|
28388
28443
|
case 15:
|
|
28389
|
-
case 27:
|
|
28390
|
-
case 24:
|
|
28391
|
-
case 28:
|
|
28392
|
-
case 21:
|
|
28393
|
-
case 23:
|
|
28394
|
-
case 58:
|
|
28395
|
-
case 26:
|
|
28396
|
-
case 57:
|
|
28397
|
-
case 34:
|
|
28398
|
-
case 36:
|
|
28399
|
-
case 35:
|
|
28400
|
-
case 37:
|
|
28401
|
-
case 55:
|
|
28402
|
-
case 56:
|
|
28403
|
-
case 60:
|
|
28404
|
-
case 52:
|
|
28405
|
-
case 50:
|
|
28406
|
-
case 51:
|
|
28407
|
-
case 19:
|
|
28408
|
-
case 1:
|
|
28409
28444
|
return true;
|
|
28410
28445
|
}
|
|
28411
|
-
return
|
|
28446
|
+
return !isStartOfExpression();
|
|
28412
28447
|
}
|
|
28413
28448
|
function parsePrimaryExpression() {
|
|
28414
28449
|
switch (token()) {
|
|
@@ -31134,7 +31169,7 @@ var ts;
|
|
|
31134
31169
|
IncrementalParser.createSyntaxCursor = createSyntaxCursor;
|
|
31135
31170
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
31136
31171
|
function isDeclarationFileName(fileName) {
|
|
31137
|
-
return ts.fileExtensionIsOneOf(fileName,
|
|
31172
|
+
return ts.fileExtensionIsOneOf(fileName, ts.supportedDeclarationExtensions);
|
|
31138
31173
|
}
|
|
31139
31174
|
ts.isDeclarationFileName = isDeclarationFileName;
|
|
31140
31175
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
@@ -34318,6 +34353,7 @@ var ts;
|
|
|
34318
34353
|
Extensions[Extensions["Json"] = 2] = "Json";
|
|
34319
34354
|
Extensions[Extensions["TSConfig"] = 3] = "TSConfig";
|
|
34320
34355
|
Extensions[Extensions["DtsOnly"] = 4] = "DtsOnly";
|
|
34356
|
+
Extensions[Extensions["TsOnly"] = 5] = "TsOnly";
|
|
34321
34357
|
})(Extensions || (Extensions = {}));
|
|
34322
34358
|
function resolvedTypeScriptOnly(resolved) {
|
|
34323
34359
|
if (!resolved) {
|
|
@@ -35114,13 +35150,31 @@ var ts;
|
|
|
35114
35150
|
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
35115
35151
|
}
|
|
35116
35152
|
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) {
|
|
35117
|
-
|
|
35153
|
+
var extensions;
|
|
35154
|
+
if (lookupConfig) {
|
|
35155
|
+
extensions = tsconfigExtensions;
|
|
35156
|
+
}
|
|
35157
|
+
else if (compilerOptions.noDtsResolution) {
|
|
35158
|
+
extensions = [Extensions.TsOnly];
|
|
35159
|
+
if (compilerOptions.allowJs)
|
|
35160
|
+
extensions.push(Extensions.JavaScript);
|
|
35161
|
+
if (compilerOptions.resolveJsonModule)
|
|
35162
|
+
extensions.push(Extensions.Json);
|
|
35163
|
+
}
|
|
35164
|
+
else {
|
|
35165
|
+
extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions;
|
|
35166
|
+
}
|
|
35167
|
+
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, ts.getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
|
|
35118
35168
|
}
|
|
35119
35169
|
ts.nodeModuleNameResolver = nodeModuleNameResolver;
|
|
35120
35170
|
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
35121
35171
|
var _a, _b;
|
|
35122
35172
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
35123
35173
|
var failedLookupLocations = [];
|
|
35174
|
+
var conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
|
|
35175
|
+
if (compilerOptions.noDtsResolution) {
|
|
35176
|
+
conditions.pop();
|
|
35177
|
+
}
|
|
35124
35178
|
var state = {
|
|
35125
35179
|
compilerOptions: compilerOptions,
|
|
35126
35180
|
host: host,
|
|
@@ -35128,7 +35182,7 @@ var ts;
|
|
|
35128
35182
|
failedLookupLocations: failedLookupLocations,
|
|
35129
35183
|
packageJsonInfoCache: cache,
|
|
35130
35184
|
features: features,
|
|
35131
|
-
conditions:
|
|
35185
|
+
conditions: conditions,
|
|
35132
35186
|
};
|
|
35133
35187
|
var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
|
|
35134
35188
|
return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
|
|
@@ -35273,9 +35327,9 @@ var ts;
|
|
|
35273
35327
|
}
|
|
35274
35328
|
}
|
|
35275
35329
|
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
35276
|
-
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.
|
|
35330
|
+
if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.isDeclarationFileName(candidate)) {
|
|
35277
35331
|
var result = tryFile(candidate, onlyRecordFailures, state);
|
|
35278
|
-
return result !== undefined ? { path: candidate, ext: ts.forEach(
|
|
35332
|
+
return result !== undefined ? { path: candidate, ext: ts.forEach(ts.supportedDeclarationExtensions, function (e) { return ts.fileExtensionIs(candidate, e) ? e : undefined; }) } : undefined;
|
|
35279
35333
|
}
|
|
35280
35334
|
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
35281
35335
|
}
|
|
@@ -35303,20 +35357,22 @@ var ts;
|
|
|
35303
35357
|
default: return tryExtension(".d.ts");
|
|
35304
35358
|
}
|
|
35305
35359
|
case Extensions.TypeScript:
|
|
35360
|
+
case Extensions.TsOnly:
|
|
35361
|
+
var useDts = extensions === Extensions.TypeScript;
|
|
35306
35362
|
switch (originalExtension) {
|
|
35307
35363
|
case ".mjs":
|
|
35308
35364
|
case ".mts":
|
|
35309
35365
|
case ".d.mts":
|
|
35310
|
-
return tryExtension(".mts") || tryExtension(".d.mts");
|
|
35366
|
+
return tryExtension(".mts") || (useDts ? tryExtension(".d.mts") : undefined);
|
|
35311
35367
|
case ".cjs":
|
|
35312
35368
|
case ".cts":
|
|
35313
35369
|
case ".d.cts":
|
|
35314
|
-
return tryExtension(".cts") || tryExtension(".d.cts");
|
|
35370
|
+
return tryExtension(".cts") || (useDts ? tryExtension(".d.cts") : undefined);
|
|
35315
35371
|
case ".json":
|
|
35316
35372
|
candidate += ".json";
|
|
35317
|
-
return tryExtension(".d.ts");
|
|
35373
|
+
return useDts ? tryExtension(".d.ts") : undefined;
|
|
35318
35374
|
default:
|
|
35319
|
-
return tryExtension(".ts") || tryExtension(".tsx") || tryExtension(".d.ts");
|
|
35375
|
+
return tryExtension(".ts") || tryExtension(".tsx") || (useDts ? tryExtension(".d.ts") : undefined);
|
|
35320
35376
|
}
|
|
35321
35377
|
case Extensions.JavaScript:
|
|
35322
35378
|
switch (originalExtension) {
|
|
@@ -35530,6 +35586,7 @@ var ts;
|
|
|
35530
35586
|
switch (extensions) {
|
|
35531
35587
|
case Extensions.JavaScript:
|
|
35532
35588
|
case Extensions.Json:
|
|
35589
|
+
case Extensions.TsOnly:
|
|
35533
35590
|
packageFile = readPackageJsonMainField(jsonContent, candidate, state);
|
|
35534
35591
|
break;
|
|
35535
35592
|
case Extensions.TypeScript:
|
|
@@ -35592,14 +35649,16 @@ var ts;
|
|
|
35592
35649
|
function extensionIsOk(extensions, extension) {
|
|
35593
35650
|
switch (extensions) {
|
|
35594
35651
|
case Extensions.JavaScript:
|
|
35595
|
-
return extension === ".js" || extension === ".jsx";
|
|
35652
|
+
return extension === ".js" || extension === ".jsx" || extension === ".mjs" || extension === ".cjs";
|
|
35596
35653
|
case Extensions.TSConfig:
|
|
35597
35654
|
case Extensions.Json:
|
|
35598
35655
|
return extension === ".json";
|
|
35599
35656
|
case Extensions.TypeScript:
|
|
35600
|
-
return extension === ".ts" || extension === ".tsx" || extension === ".d.ts";
|
|
35657
|
+
return extension === ".ts" || extension === ".tsx" || extension === ".mts" || extension === ".cts" || extension === ".d.ts" || extension === ".d.mts" || extension === ".d.cts";
|
|
35658
|
+
case Extensions.TsOnly:
|
|
35659
|
+
return extension === ".ts" || extension === ".tsx" || extension === ".mts" || extension === ".cts";
|
|
35601
35660
|
case Extensions.DtsOnly:
|
|
35602
|
-
return extension === ".d.ts";
|
|
35661
|
+
return extension === ".d.ts" || extension === ".d.mts" || extension === ".d.cts";
|
|
35603
35662
|
}
|
|
35604
35663
|
}
|
|
35605
35664
|
function parsePackageName(moduleName) {
|
|
@@ -37492,6 +37551,7 @@ var ts;
|
|
|
37492
37551
|
case 261:
|
|
37493
37552
|
case 259:
|
|
37494
37553
|
case 195:
|
|
37554
|
+
case 176:
|
|
37495
37555
|
return 1 | 32;
|
|
37496
37556
|
case 305:
|
|
37497
37557
|
return 1 | 4 | 32;
|
|
@@ -37509,7 +37569,6 @@ var ts;
|
|
|
37509
37569
|
case 317:
|
|
37510
37570
|
case 179:
|
|
37511
37571
|
case 175:
|
|
37512
|
-
case 176:
|
|
37513
37572
|
case 180:
|
|
37514
37573
|
case 170:
|
|
37515
37574
|
return 1 | 4 | 32 | 8;
|
|
@@ -41330,27 +41389,27 @@ var ts;
|
|
|
41330
41389
|
function resolveAlias(symbol) {
|
|
41331
41390
|
ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
|
|
41332
41391
|
var links = getSymbolLinks(symbol);
|
|
41333
|
-
if (!links.
|
|
41334
|
-
links.
|
|
41392
|
+
if (!links.aliasTarget) {
|
|
41393
|
+
links.aliasTarget = resolvingSymbol;
|
|
41335
41394
|
var node = getDeclarationOfAliasSymbol(symbol);
|
|
41336
41395
|
if (!node)
|
|
41337
41396
|
return ts.Debug.fail();
|
|
41338
41397
|
var target = getTargetOfAliasDeclaration(node);
|
|
41339
|
-
if (links.
|
|
41340
|
-
links.
|
|
41398
|
+
if (links.aliasTarget === resolvingSymbol) {
|
|
41399
|
+
links.aliasTarget = target || unknownSymbol;
|
|
41341
41400
|
}
|
|
41342
41401
|
else {
|
|
41343
41402
|
error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));
|
|
41344
41403
|
}
|
|
41345
41404
|
}
|
|
41346
|
-
else if (links.
|
|
41347
|
-
links.
|
|
41405
|
+
else if (links.aliasTarget === resolvingSymbol) {
|
|
41406
|
+
links.aliasTarget = unknownSymbol;
|
|
41348
41407
|
}
|
|
41349
|
-
return links.
|
|
41408
|
+
return links.aliasTarget;
|
|
41350
41409
|
}
|
|
41351
41410
|
function tryResolveAlias(symbol) {
|
|
41352
41411
|
var links = getSymbolLinks(symbol);
|
|
41353
|
-
if (links.
|
|
41412
|
+
if (links.aliasTarget !== resolvingSymbol) {
|
|
41354
41413
|
return resolveAlias(symbol);
|
|
41355
41414
|
}
|
|
41356
41415
|
return undefined;
|
|
@@ -42937,13 +42996,27 @@ var ts;
|
|
|
42937
42996
|
return ts.Debug.fail("Should be unreachable.");
|
|
42938
42997
|
function conditionalTypeToTypeNode(type) {
|
|
42939
42998
|
var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
|
|
42999
|
+
context.approximateLength += 15;
|
|
43000
|
+
if (context.flags & 4 && type.root.isDistributive && !(type.checkType.flags & 262144)) {
|
|
43001
|
+
var newParam = createTypeParameter(createSymbol(262144, "T"));
|
|
43002
|
+
var name = typeParameterToName(newParam, context);
|
|
43003
|
+
var newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
43004
|
+
context.approximateLength += 37;
|
|
43005
|
+
var newMapper = prependTypeMapping(type.root.checkType, newParam, type.combinedMapper || type.mapper);
|
|
43006
|
+
var saveInferTypeParameters_1 = context.inferTypeParameters;
|
|
43007
|
+
context.inferTypeParameters = type.root.inferTypeParameters;
|
|
43008
|
+
var extendsTypeNode_1 = typeToTypeNodeHelper(instantiateType(type.root.extendsType, newMapper), context);
|
|
43009
|
+
context.inferTypeParameters = saveInferTypeParameters_1;
|
|
43010
|
+
var trueTypeNode_1 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type.root.node.trueType), newMapper));
|
|
43011
|
+
var falseTypeNode_1 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type.root.node.falseType), newMapper));
|
|
43012
|
+
return ts.factory.createConditionalTypeNode(checkTypeNode, ts.factory.createInferTypeNode(ts.factory.createTypeParameterDeclaration(undefined, ts.factory.cloneNode(newTypeVariable.typeName))), ts.factory.createConditionalTypeNode(ts.factory.createTypeReferenceNode(ts.factory.cloneNode(name)), typeToTypeNodeHelper(type.checkType, context), ts.factory.createConditionalTypeNode(newTypeVariable, extendsTypeNode_1, trueTypeNode_1, falseTypeNode_1), ts.factory.createKeywordTypeNode(143)), ts.factory.createKeywordTypeNode(143));
|
|
43013
|
+
}
|
|
42940
43014
|
var saveInferTypeParameters = context.inferTypeParameters;
|
|
42941
43015
|
context.inferTypeParameters = type.root.inferTypeParameters;
|
|
42942
43016
|
var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context);
|
|
42943
43017
|
context.inferTypeParameters = saveInferTypeParameters;
|
|
42944
43018
|
var trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type));
|
|
42945
43019
|
var falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type));
|
|
42946
|
-
context.approximateLength += 15;
|
|
42947
43020
|
return ts.factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
|
|
42948
43021
|
}
|
|
42949
43022
|
function typeToTypeNodeOrCircularityElision(type) {
|
|
@@ -43044,7 +43117,7 @@ var ts;
|
|
|
43044
43117
|
type.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type.symbol) :
|
|
43045
43118
|
undefined;
|
|
43046
43119
|
if (!context.visitedTypes) {
|
|
43047
|
-
context.visitedTypes = new ts.
|
|
43120
|
+
context.visitedTypes = new ts.Set();
|
|
43048
43121
|
}
|
|
43049
43122
|
if (id && !context.symbolDepth) {
|
|
43050
43123
|
context.symbolDepth = new ts.Map();
|
|
@@ -43062,22 +43135,15 @@ var ts;
|
|
|
43062
43135
|
context.approximateLength += cachedResult.addedLength;
|
|
43063
43136
|
return deepCloneOrReuseNode(cachedResult);
|
|
43064
43137
|
}
|
|
43065
|
-
var
|
|
43066
|
-
var symbolDepth = id ? context.symbolDepth.get(id) : undefined;
|
|
43067
|
-
if (symbolDepth) {
|
|
43068
|
-
totalDepth += symbolDepth;
|
|
43069
|
-
}
|
|
43070
|
-
var visitedTypeDepth = context.visitedTypes.get(typeId);
|
|
43071
|
-
if (visitedTypeDepth) {
|
|
43072
|
-
totalDepth += visitedTypeDepth;
|
|
43073
|
-
}
|
|
43074
|
-
if (totalDepth > 10) {
|
|
43075
|
-
return createElidedInformationPlaceholder(context);
|
|
43076
|
-
}
|
|
43138
|
+
var depth;
|
|
43077
43139
|
if (id) {
|
|
43078
|
-
context.symbolDepth.
|
|
43140
|
+
depth = context.symbolDepth.get(id) || 0;
|
|
43141
|
+
if (depth > 10) {
|
|
43142
|
+
return createElidedInformationPlaceholder(context);
|
|
43143
|
+
}
|
|
43144
|
+
context.symbolDepth.set(id, depth + 1);
|
|
43079
43145
|
}
|
|
43080
|
-
context.visitedTypes.
|
|
43146
|
+
context.visitedTypes.add(typeId);
|
|
43081
43147
|
var startLength = context.approximateLength;
|
|
43082
43148
|
var result = transform(type);
|
|
43083
43149
|
var addedLength = context.approximateLength - startLength;
|
|
@@ -43088,19 +43154,9 @@ var ts;
|
|
|
43088
43154
|
result.addedLength = addedLength;
|
|
43089
43155
|
(_b = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _b === void 0 ? void 0 : _b.set(key, result);
|
|
43090
43156
|
}
|
|
43091
|
-
|
|
43092
|
-
context.visitedTypes.set(typeId, visitedTypeDepth);
|
|
43093
|
-
}
|
|
43094
|
-
else {
|
|
43095
|
-
context.visitedTypes.delete(typeId);
|
|
43096
|
-
}
|
|
43157
|
+
context.visitedTypes.delete(typeId);
|
|
43097
43158
|
if (id) {
|
|
43098
|
-
|
|
43099
|
-
context.symbolDepth.set(id, symbolDepth);
|
|
43100
|
-
}
|
|
43101
|
-
else {
|
|
43102
|
-
context.symbolDepth.delete(id);
|
|
43103
|
-
}
|
|
43159
|
+
context.symbolDepth.set(id, depth);
|
|
43104
43160
|
}
|
|
43105
43161
|
return result;
|
|
43106
43162
|
function deepCloneOrReuseNode(node) {
|
|
@@ -43604,9 +43660,6 @@ var ts;
|
|
|
43604
43660
|
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
|
|
43605
43661
|
parameterType = getOptionalType(parameterType);
|
|
43606
43662
|
}
|
|
43607
|
-
if ((context.flags & 1073741824) && parameterDeclaration && !ts.isJSDocParameterTag(parameterDeclaration) && isOptionalUninitializedParameter(parameterDeclaration)) {
|
|
43608
|
-
parameterType = getTypeWithFacts(parameterType, 524288);
|
|
43609
|
-
}
|
|
43610
43663
|
var parameterTypeNode = serializeTypeForDeclaration(context, parameterType, parameterSymbol, context.enclosingDeclaration, privateSymbolVisitor, bundledImports);
|
|
43611
43664
|
var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.factory.cloneNode) : undefined;
|
|
43612
43665
|
var isRest = parameterDeclaration && ts.isRestParameter(parameterDeclaration) || ts.getCheckFlags(parameterSymbol) & 32768;
|
|
@@ -44113,7 +44166,7 @@ var ts;
|
|
|
44113
44166
|
var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
44114
44167
|
if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation) && !ts.isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
44115
44168
|
var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
44116
|
-
if (
|
|
44169
|
+
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
44117
44170
|
var result_6 = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
|
|
44118
44171
|
if (result_6) {
|
|
44119
44172
|
return result_6;
|
|
@@ -44130,6 +44183,16 @@ var ts;
|
|
|
44130
44183
|
context.flags = oldFlags;
|
|
44131
44184
|
return result;
|
|
44132
44185
|
}
|
|
44186
|
+
function typeNodeIsEquivalentToType(typeNode, annotatedDeclaration, type) {
|
|
44187
|
+
var typeFromTypeNode = getTypeFromTypeNode(typeNode);
|
|
44188
|
+
if (typeFromTypeNode === type) {
|
|
44189
|
+
return true;
|
|
44190
|
+
}
|
|
44191
|
+
if (ts.isParameter(annotatedDeclaration) && annotatedDeclaration.questionToken) {
|
|
44192
|
+
return getTypeWithFacts(type, 524288) === typeFromTypeNode;
|
|
44193
|
+
}
|
|
44194
|
+
return false;
|
|
44195
|
+
}
|
|
44133
44196
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
44134
44197
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
44135
44198
|
var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
|
|
@@ -45983,7 +46046,7 @@ var ts;
|
|
|
45983
46046
|
}
|
|
45984
46047
|
}
|
|
45985
46048
|
var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~98304); }) ? constructorTypes : types;
|
|
45986
|
-
type = getUnionType(sourceTypes
|
|
46049
|
+
type = getUnionType(sourceTypes);
|
|
45987
46050
|
}
|
|
45988
46051
|
}
|
|
45989
46052
|
var widened = getWidenedType(addOptionality(type, false, definedInMethod && !definedInConstructor));
|
|
@@ -48369,8 +48432,9 @@ var ts;
|
|
|
48369
48432
|
return circularConstraintType;
|
|
48370
48433
|
}
|
|
48371
48434
|
var result = void 0;
|
|
48372
|
-
|
|
48373
|
-
|
|
48435
|
+
var identity_1 = getRecursionIdentity(t);
|
|
48436
|
+
if (stack.length < 10 || stack.length < 50 && !ts.contains(stack, identity_1)) {
|
|
48437
|
+
stack.push(identity_1);
|
|
48374
48438
|
result = computeBaseConstraint(getSimplifiedType(t, false));
|
|
48375
48439
|
stack.pop();
|
|
48376
48440
|
}
|
|
@@ -51357,8 +51421,11 @@ var ts;
|
|
|
51357
51421
|
return type[cache] = elementType;
|
|
51358
51422
|
}
|
|
51359
51423
|
}
|
|
51360
|
-
if (isGenericMappedType(objectType)
|
|
51361
|
-
|
|
51424
|
+
if (isGenericMappedType(objectType)) {
|
|
51425
|
+
var nameType = getNameTypeFromMappedType(objectType);
|
|
51426
|
+
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
51427
|
+
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), function (t) { return getSimplifiedType(t, writing); });
|
|
51428
|
+
}
|
|
51362
51429
|
}
|
|
51363
51430
|
return type[cache] = type;
|
|
51364
51431
|
}
|
|
@@ -55547,12 +55614,12 @@ var ts;
|
|
|
55547
55614
|
function isDeeplyNestedType(type, stack, depth, maxDepth) {
|
|
55548
55615
|
if (maxDepth === void 0) { maxDepth = 3; }
|
|
55549
55616
|
if (depth >= maxDepth) {
|
|
55550
|
-
var
|
|
55617
|
+
var identity_2 = getRecursionIdentity(type);
|
|
55551
55618
|
var count = 0;
|
|
55552
55619
|
var lastTypeId = 0;
|
|
55553
55620
|
for (var i = 0; i < depth; i++) {
|
|
55554
55621
|
var t = stack[i];
|
|
55555
|
-
if (getRecursionIdentity(t) ===
|
|
55622
|
+
if (getRecursionIdentity(t) === identity_2) {
|
|
55556
55623
|
if (t.id >= lastTypeId) {
|
|
55557
55624
|
count++;
|
|
55558
55625
|
if (count >= maxDepth) {
|
|
@@ -61936,7 +62003,9 @@ var ts;
|
|
|
61936
62003
|
}
|
|
61937
62004
|
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
61938
62005
|
}
|
|
61939
|
-
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
62006
|
+
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
62007
|
+
!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 && node.parent.kind === 299)) ||
|
|
62008
|
+
ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
|
|
61940
62009
|
markAliasReferenced(parentSymbol, node);
|
|
61941
62010
|
}
|
|
61942
62011
|
var propType;
|
|
@@ -64080,7 +64149,7 @@ var ts;
|
|
|
64080
64149
|
var newSymbol = createSymbol(2097152, "default");
|
|
64081
64150
|
newSymbol.parent = originalSymbol;
|
|
64082
64151
|
newSymbol.nameType = getStringLiteralType("default");
|
|
64083
|
-
newSymbol.
|
|
64152
|
+
newSymbol.aliasTarget = resolveSymbol(symbol);
|
|
64084
64153
|
memberTable.set("default", newSymbol);
|
|
64085
64154
|
return createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
64086
64155
|
}
|
|
@@ -66604,19 +66673,28 @@ var ts;
|
|
|
66604
66673
|
if (constraintType && defaultType) {
|
|
66605
66674
|
checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1);
|
|
66606
66675
|
}
|
|
66607
|
-
|
|
66676
|
+
checkNodeDeferred(node);
|
|
66677
|
+
addLazyDiagnostic(function () { return checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); });
|
|
66678
|
+
}
|
|
66679
|
+
function checkTypeParameterDeferred(node) {
|
|
66680
|
+
if (ts.isInterfaceDeclaration(node.parent) || ts.isClassLike(node.parent) || ts.isTypeAliasDeclaration(node.parent)) {
|
|
66681
|
+
var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));
|
|
66608
66682
|
var modifiers = getVarianceModifiers(typeParameter);
|
|
66609
|
-
if (modifiers
|
|
66683
|
+
if (modifiers) {
|
|
66610
66684
|
var symbol = getSymbolOfNode(node.parent);
|
|
66611
|
-
|
|
66612
|
-
|
|
66613
|
-
|
|
66614
|
-
|
|
66615
|
-
|
|
66616
|
-
|
|
66685
|
+
if (ts.isTypeAliasDeclaration(node.parent) && !(ts.getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 | 32))) {
|
|
66686
|
+
error(node, ts.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
|
|
66687
|
+
}
|
|
66688
|
+
else if (modifiers === 32768 || modifiers === 65536) {
|
|
66689
|
+
var source = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSubType : markerSuperType);
|
|
66690
|
+
var target = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSuperType : markerSubType);
|
|
66691
|
+
var saveVarianceTypeParameter = typeParameter;
|
|
66692
|
+
varianceTypeParameter = typeParameter;
|
|
66693
|
+
checkTypeAssignableTo(source, target, node, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
|
|
66694
|
+
varianceTypeParameter = saveVarianceTypeParameter;
|
|
66695
|
+
}
|
|
66617
66696
|
}
|
|
66618
66697
|
}
|
|
66619
|
-
addLazyDiagnostic(function () { return checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); });
|
|
66620
66698
|
}
|
|
66621
66699
|
function checkParameter(node) {
|
|
66622
66700
|
checkGrammarDecoratorsAndModifiers(node);
|
|
@@ -67043,7 +67121,7 @@ var ts;
|
|
|
67043
67121
|
superCallStatement = statement;
|
|
67044
67122
|
break;
|
|
67045
67123
|
}
|
|
67046
|
-
if (
|
|
67124
|
+
if (nodeImmediatelyReferencesSuperOrThis(statement)) {
|
|
67047
67125
|
break;
|
|
67048
67126
|
}
|
|
67049
67127
|
}
|
|
@@ -71581,6 +71659,9 @@ var ts;
|
|
|
71581
71659
|
case 226:
|
|
71582
71660
|
checkClassExpressionDeferred(node);
|
|
71583
71661
|
break;
|
|
71662
|
+
case 163:
|
|
71663
|
+
checkTypeParameterDeferred(node);
|
|
71664
|
+
break;
|
|
71584
71665
|
case 279:
|
|
71585
71666
|
checkJsxSelfClosingElementDeferred(node);
|
|
71586
71667
|
break;
|
|
@@ -72054,15 +72135,14 @@ var ts;
|
|
|
72054
72135
|
return propertyDeclaration;
|
|
72055
72136
|
}
|
|
72056
72137
|
}
|
|
72057
|
-
else if (ts.isMetaProperty(parent)) {
|
|
72058
|
-
|
|
72059
|
-
var propertyDeclaration = getPropertyOfType(parentType, node.escapedText);
|
|
72060
|
-
if (propertyDeclaration) {
|
|
72061
|
-
return propertyDeclaration;
|
|
72062
|
-
}
|
|
72063
|
-
if (parent.keywordToken === 103) {
|
|
72138
|
+
else if (ts.isMetaProperty(parent) && parent.name === node) {
|
|
72139
|
+
if (parent.keywordToken === 103 && ts.idText(node) === "target") {
|
|
72064
72140
|
return checkNewTargetMetaProperty(parent).symbol;
|
|
72065
72141
|
}
|
|
72142
|
+
if (parent.keywordToken === 100 && ts.idText(node) === "meta") {
|
|
72143
|
+
return getGlobalImportMetaExpressionType().members.get("meta");
|
|
72144
|
+
}
|
|
72145
|
+
return undefined;
|
|
72066
72146
|
}
|
|
72067
72147
|
}
|
|
72068
72148
|
switch (node.kind) {
|
|
@@ -72291,11 +72371,11 @@ var ts;
|
|
|
72291
72371
|
var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin;
|
|
72292
72372
|
return leftSpread ? [leftSpread, rightSpread]
|
|
72293
72373
|
: syntheticOrigin ? [syntheticOrigin]
|
|
72294
|
-
: ts.singleElementArray(
|
|
72374
|
+
: ts.singleElementArray(tryGetTarget(symbol));
|
|
72295
72375
|
}
|
|
72296
72376
|
return undefined;
|
|
72297
72377
|
}
|
|
72298
|
-
function
|
|
72378
|
+
function tryGetTarget(symbol) {
|
|
72299
72379
|
var target;
|
|
72300
72380
|
var next = symbol;
|
|
72301
72381
|
while (next = getSymbolLinks(next).target) {
|
|
@@ -72480,7 +72560,7 @@ var ts;
|
|
|
72480
72560
|
if (links === null || links === void 0 ? void 0 : links.referenced) {
|
|
72481
72561
|
return true;
|
|
72482
72562
|
}
|
|
72483
|
-
var target = getSymbolLinks(symbol).
|
|
72563
|
+
var target = getSymbolLinks(symbol).aliasTarget;
|
|
72484
72564
|
if (target && ts.getEffectiveModifierFlags(node) & 1 &&
|
|
72485
72565
|
target.flags & 111551 &&
|
|
72486
72566
|
(ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
@@ -72516,11 +72596,6 @@ var ts;
|
|
|
72516
72596
|
!parameter.initializer &&
|
|
72517
72597
|
ts.hasSyntacticModifier(parameter, 16476);
|
|
72518
72598
|
}
|
|
72519
|
-
function isOptionalUninitializedParameter(parameter) {
|
|
72520
|
-
return !!strictNullChecks &&
|
|
72521
|
-
isOptionalParameter(parameter) &&
|
|
72522
|
-
!parameter.initializer;
|
|
72523
|
-
}
|
|
72524
72599
|
function isExpandoFunctionDeclaration(node) {
|
|
72525
72600
|
var declaration = ts.getParseTreeNode(node, ts.isFunctionDeclaration);
|
|
72526
72601
|
if (!declaration) {
|
|
@@ -73385,8 +73460,7 @@ var ts;
|
|
|
73385
73460
|
case 144:
|
|
73386
73461
|
var inOutFlag = modifier.kind === 101 ? 32768 : 65536;
|
|
73387
73462
|
var inOutText = modifier.kind === 101 ? "in" : "out";
|
|
73388
|
-
if (node.kind !== 163 || (node.parent.
|
|
73389
|
-
node.parent.kind !== 257 && node.parent.kind !== 259)) {
|
|
73463
|
+
if (node.kind !== 163 || !(ts.isInterfaceDeclaration(node.parent) || ts.isClassLike(node.parent) || ts.isTypeAliasDeclaration(node.parent))) {
|
|
73390
73464
|
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText);
|
|
73391
73465
|
}
|
|
73392
73466
|
if (flags & inOutFlag) {
|
|
@@ -77582,19 +77656,19 @@ var ts;
|
|
|
77582
77656
|
}
|
|
77583
77657
|
var statements = [];
|
|
77584
77658
|
resumeLexicalEnvironment();
|
|
77585
|
-
var
|
|
77586
|
-
var superStatementIndex = ts.findSuperStatementIndex(body.statements,
|
|
77659
|
+
var prologueStatementCount = factory.copyPrologue(body.statements, statements, false, visitor);
|
|
77660
|
+
var superStatementIndex = ts.findSuperStatementIndex(body.statements, prologueStatementCount);
|
|
77587
77661
|
if (superStatementIndex >= 0) {
|
|
77588
|
-
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement,
|
|
77662
|
+
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, prologueStatementCount, superStatementIndex + 1 - prologueStatementCount));
|
|
77589
77663
|
}
|
|
77590
77664
|
var parameterPropertyAssignments = ts.mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment);
|
|
77591
77665
|
if (superStatementIndex >= 0) {
|
|
77592
77666
|
ts.addRange(statements, parameterPropertyAssignments);
|
|
77593
77667
|
}
|
|
77594
77668
|
else {
|
|
77595
|
-
statements =
|
|
77669
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), parameterPropertyAssignments, true), statements.slice(prologueStatementCount), true);
|
|
77596
77670
|
}
|
|
77597
|
-
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, superStatementIndex + 1));
|
|
77671
|
+
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, superStatementIndex + 1 + prologueStatementCount));
|
|
77598
77672
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
77599
77673
|
var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), body.statements), true);
|
|
77600
77674
|
ts.setTextRange(block, body);
|
|
@@ -79014,7 +79088,7 @@ var ts;
|
|
|
79014
79088
|
}
|
|
79015
79089
|
resumeLexicalEnvironment();
|
|
79016
79090
|
var needsSyntheticConstructor = !constructor && isDerivedClass;
|
|
79017
|
-
var
|
|
79091
|
+
var indexOfFirstStatementAfterSuperAndPrologue = 0;
|
|
79018
79092
|
var prologueStatementCount = 0;
|
|
79019
79093
|
var superStatementIndex = -1;
|
|
79020
79094
|
var statements = [];
|
|
@@ -79022,8 +79096,11 @@ var ts;
|
|
|
79022
79096
|
prologueStatementCount = factory.copyPrologue(constructor.body.statements, statements, false, visitor);
|
|
79023
79097
|
superStatementIndex = ts.findSuperStatementIndex(constructor.body.statements, prologueStatementCount);
|
|
79024
79098
|
if (superStatementIndex >= 0) {
|
|
79025
|
-
|
|
79026
|
-
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount,
|
|
79099
|
+
indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1;
|
|
79100
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), true), statements.slice(prologueStatementCount), true);
|
|
79101
|
+
}
|
|
79102
|
+
else if (prologueStatementCount >= 0) {
|
|
79103
|
+
indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount;
|
|
79027
79104
|
}
|
|
79028
79105
|
}
|
|
79029
79106
|
if (needsSyntheticConstructor) {
|
|
@@ -79042,19 +79119,17 @@ var ts;
|
|
|
79042
79119
|
}
|
|
79043
79120
|
}
|
|
79044
79121
|
if (parameterPropertyDeclarationCount > 0) {
|
|
79045
|
-
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement,
|
|
79122
|
+
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount);
|
|
79046
79123
|
if (superStatementIndex >= 0) {
|
|
79047
79124
|
ts.addRange(statements, parameterProperties);
|
|
79048
79125
|
}
|
|
79049
|
-
else if (needsSyntheticConstructor) {
|
|
79050
|
-
statements = __spreadArray(__spreadArray([
|
|
79051
|
-
statements[0]
|
|
79052
|
-
], parameterProperties, true), statements.slice(1), true);
|
|
79053
|
-
}
|
|
79054
79126
|
else {
|
|
79055
|
-
|
|
79127
|
+
var superAndPrologueStatementCount = prologueStatementCount;
|
|
79128
|
+
if (needsSyntheticConstructor)
|
|
79129
|
+
superAndPrologueStatementCount++;
|
|
79130
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, superAndPrologueStatementCount), true), parameterProperties, true), statements.slice(superAndPrologueStatementCount), true);
|
|
79056
79131
|
}
|
|
79057
|
-
|
|
79132
|
+
indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount;
|
|
79058
79133
|
}
|
|
79059
79134
|
}
|
|
79060
79135
|
}
|
|
@@ -79062,7 +79137,7 @@ var ts;
|
|
|
79062
79137
|
addMethodStatements(statements, privateMethodsAndAccessors, receiver);
|
|
79063
79138
|
addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
|
|
79064
79139
|
if (constructor) {
|
|
79065
|
-
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement,
|
|
79140
|
+
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue));
|
|
79066
79141
|
}
|
|
79067
79142
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
79068
79143
|
return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined);
|
|
@@ -82282,7 +82357,7 @@ var ts;
|
|
|
82282
82357
|
else {
|
|
82283
82358
|
insertCaptureThisForNodeIfNeeded(prologue, constructor);
|
|
82284
82359
|
}
|
|
82285
|
-
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex)), true), statements, true)), constructor.body.statements), true);
|
|
82360
|
+
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)), true), statements, true)), constructor.body.statements), true);
|
|
82286
82361
|
ts.setTextRange(body, constructor.body);
|
|
82287
82362
|
return body;
|
|
82288
82363
|
}
|
|
@@ -88880,6 +88955,10 @@ var ts;
|
|
|
88880
88955
|
return factory.updateModifiers(statement, modifiers);
|
|
88881
88956
|
}
|
|
88882
88957
|
function transformTopLevelDeclaration(input) {
|
|
88958
|
+
if (lateMarkedStatements) {
|
|
88959
|
+
while (ts.orderedRemoveItem(lateMarkedStatements, input))
|
|
88960
|
+
;
|
|
88961
|
+
}
|
|
88883
88962
|
if (shouldStripInternal(input))
|
|
88884
88963
|
return;
|
|
88885
88964
|
switch (input.kind) {
|
|
@@ -89846,7 +89925,7 @@ var ts;
|
|
|
89846
89925
|
addOutput(buildInfoPath);
|
|
89847
89926
|
}
|
|
89848
89927
|
function getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory) {
|
|
89849
|
-
if (ts.
|
|
89928
|
+
if (ts.isDeclarationFileName(inputFileName))
|
|
89850
89929
|
return;
|
|
89851
89930
|
var js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
89852
89931
|
addOutput(js);
|
|
@@ -89884,7 +89963,7 @@ var ts;
|
|
|
89884
89963
|
ts.getCommonSourceDirectory = getCommonSourceDirectory;
|
|
89885
89964
|
function getCommonSourceDirectoryOfConfig(_a, ignoreCase) {
|
|
89886
89965
|
var options = _a.options, fileNames = _a.fileNames;
|
|
89887
|
-
return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensionsFlat)) && !ts.
|
|
89966
|
+
return getCommonSourceDirectory(options, function () { return ts.filter(fileNames, function (file) { return !(options.noEmitForJsFiles && ts.fileExtensionIsOneOf(file, ts.supportedJSExtensionsFlat)) && !ts.isDeclarationFileName(file); }); }, ts.getDirectoryPath(ts.normalizeSlashes(ts.Debug.checkDefined(options.configFilePath))), ts.createGetCanonicalFileName(!ignoreCase));
|
|
89888
89967
|
}
|
|
89889
89968
|
ts.getCommonSourceDirectoryOfConfig = getCommonSourceDirectoryOfConfig;
|
|
89890
89969
|
function getAllProjectOutputs(configFile, ignoreCase) {
|
|
@@ -89924,7 +90003,7 @@ var ts;
|
|
|
89924
90003
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
89925
90004
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
89926
90005
|
var inputFileName = _b[_a];
|
|
89927
|
-
if (ts.
|
|
90006
|
+
if (ts.isDeclarationFileName(inputFileName))
|
|
89928
90007
|
continue;
|
|
89929
90008
|
var jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
89930
90009
|
if (jsFilePath)
|
|
@@ -94779,7 +94858,7 @@ var ts;
|
|
|
94779
94858
|
return false;
|
|
94780
94859
|
if (ts.outFile(options) || options.outDir)
|
|
94781
94860
|
return false;
|
|
94782
|
-
if (ts.
|
|
94861
|
+
if (ts.isDeclarationFileName(fileOrDirectoryPath)) {
|
|
94783
94862
|
if (options.declarationDir)
|
|
94784
94863
|
return false;
|
|
94785
94864
|
}
|
|
@@ -95837,7 +95916,7 @@ var ts;
|
|
|
95837
95916
|
var getCommonSourceDirectory_2 = ts.memoize(function () { return ts.getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames()); });
|
|
95838
95917
|
for (var _b = 0, _c = parsedRef.commandLine.fileNames; _b < _c.length; _b++) {
|
|
95839
95918
|
var fileName = _c[_b];
|
|
95840
|
-
if (!ts.
|
|
95919
|
+
if (!ts.isDeclarationFileName(fileName) && !ts.fileExtensionIs(fileName, ".json")) {
|
|
95841
95920
|
processProjectReferenceFile(ts.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_2), { kind: ts.FileIncludeKind.OutputFromProjectReference, index: index });
|
|
95842
95921
|
}
|
|
95843
95922
|
}
|
|
@@ -96013,7 +96092,7 @@ var ts;
|
|
|
96013
96092
|
}
|
|
96014
96093
|
function getRedirectReferenceForResolution(file) {
|
|
96015
96094
|
var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);
|
|
96016
|
-
if (redirect || !ts.
|
|
96095
|
+
if (redirect || !ts.isDeclarationFileName(file.originalFileName))
|
|
96017
96096
|
return redirect;
|
|
96018
96097
|
var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
96019
96098
|
if (resultFromDts)
|
|
@@ -97202,7 +97281,7 @@ var ts;
|
|
|
97202
97281
|
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
|
97203
97282
|
}
|
|
97204
97283
|
function getProjectReferenceRedirectProject(fileName) {
|
|
97205
|
-
if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.
|
|
97284
|
+
if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json")) {
|
|
97206
97285
|
return undefined;
|
|
97207
97286
|
}
|
|
97208
97287
|
return getResolvedProjectReferenceToRedirect(fileName);
|
|
@@ -97244,7 +97323,7 @@ var ts;
|
|
|
97244
97323
|
else {
|
|
97245
97324
|
var getCommonSourceDirectory_3 = ts.memoize(function () { return ts.getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()); });
|
|
97246
97325
|
ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) {
|
|
97247
|
-
if (!ts.
|
|
97326
|
+
if (!ts.isDeclarationFileName(fileName) && !ts.fileExtensionIs(fileName, ".json")) {
|
|
97248
97327
|
var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_3);
|
|
97249
97328
|
mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName);
|
|
97250
97329
|
}
|
|
@@ -97993,7 +98072,7 @@ var ts;
|
|
|
97993
98072
|
if (options.outDir) {
|
|
97994
98073
|
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
|
|
97995
98074
|
}
|
|
97996
|
-
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensionsFlat) || ts.
|
|
98075
|
+
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJSExtensionsFlat) || ts.isDeclarationFileName(filePath)) {
|
|
97997
98076
|
var filePathWithoutExtension = ts.removeFileExtension(filePath);
|
|
97998
98077
|
return !!getSourceFileByPath((filePathWithoutExtension + ".ts")) ||
|
|
97999
98078
|
!!getSourceFileByPath((filePathWithoutExtension + ".tsx"));
|
|
@@ -98285,13 +98364,9 @@ var ts;
|
|
|
98285
98364
|
ts.getFileEmitOutput = getFileEmitOutput;
|
|
98286
98365
|
var BuilderState;
|
|
98287
98366
|
(function (BuilderState) {
|
|
98288
|
-
var manyToManyPathMapCount = 0;
|
|
98289
98367
|
function createManyToManyPathMap() {
|
|
98290
98368
|
function create(forward, reverse, deleted) {
|
|
98291
|
-
var version = 0;
|
|
98292
98369
|
var map = {
|
|
98293
|
-
id: manyToManyPathMapCount++,
|
|
98294
|
-
version: function () { return version; },
|
|
98295
98370
|
clone: function () { return create(new ts.Map(forward), new ts.Map(reverse), deleted && new ts.Set(deleted)); },
|
|
98296
98371
|
forEach: function (fn) { return forward.forEach(fn); },
|
|
98297
98372
|
getKeys: function (v) { return reverse.get(v); },
|
|
@@ -98307,30 +98382,29 @@ var ts;
|
|
|
98307
98382
|
}
|
|
98308
98383
|
set.forEach(function (v) { return deleteFromMultimap(reverse, v, k); });
|
|
98309
98384
|
forward.delete(k);
|
|
98310
|
-
version++;
|
|
98311
98385
|
return true;
|
|
98312
98386
|
},
|
|
98313
98387
|
set: function (k, vSet) {
|
|
98314
|
-
|
|
98388
|
+
deleted === null || deleted === void 0 ? void 0 : deleted.delete(k);
|
|
98315
98389
|
var existingVSet = forward.get(k);
|
|
98316
98390
|
forward.set(k, vSet);
|
|
98317
98391
|
existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.forEach(function (v) {
|
|
98318
98392
|
if (!vSet.has(v)) {
|
|
98319
|
-
changed = true;
|
|
98320
98393
|
deleteFromMultimap(reverse, v, k);
|
|
98321
98394
|
}
|
|
98322
98395
|
});
|
|
98323
98396
|
vSet.forEach(function (v) {
|
|
98324
98397
|
if (!(existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.has(v))) {
|
|
98325
|
-
changed = true;
|
|
98326
98398
|
addToMultimap(reverse, v, k);
|
|
98327
98399
|
}
|
|
98328
98400
|
});
|
|
98329
|
-
if (changed) {
|
|
98330
|
-
version++;
|
|
98331
|
-
}
|
|
98332
98401
|
return map;
|
|
98333
98402
|
},
|
|
98403
|
+
clear: function () {
|
|
98404
|
+
forward.clear();
|
|
98405
|
+
reverse.clear();
|
|
98406
|
+
deleted === null || deleted === void 0 ? void 0 : deleted.clear();
|
|
98407
|
+
}
|
|
98334
98408
|
};
|
|
98335
98409
|
return map;
|
|
98336
98410
|
}
|
|
@@ -98345,11 +98419,10 @@ var ts;
|
|
|
98345
98419
|
}
|
|
98346
98420
|
set.add(v);
|
|
98347
98421
|
}
|
|
98348
|
-
function deleteFromMultimap(map, k, v
|
|
98349
|
-
if (removeEmpty === void 0) { removeEmpty = true; }
|
|
98422
|
+
function deleteFromMultimap(map, k, v) {
|
|
98350
98423
|
var set = map.get(k);
|
|
98351
98424
|
if (set === null || set === void 0 ? void 0 : set.delete(v)) {
|
|
98352
|
-
if (
|
|
98425
|
+
if (!set.size) {
|
|
98353
98426
|
map.delete(k);
|
|
98354
98427
|
}
|
|
98355
98428
|
return true;
|
|
@@ -98525,7 +98598,7 @@ var ts;
|
|
|
98525
98598
|
var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken, undefined, true);
|
|
98526
98599
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
98527
98600
|
if (firstDts_1) {
|
|
98528
|
-
ts.Debug.assert(ts.
|
|
98601
|
+
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; })); });
|
|
98529
98602
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
98530
98603
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
98531
98604
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -98574,18 +98647,6 @@ var ts;
|
|
|
98574
98647
|
var _a;
|
|
98575
98648
|
if (exportedModulesMapCache) {
|
|
98576
98649
|
ts.Debug.assert(!!state.exportedModulesMap);
|
|
98577
|
-
var cacheId = exportedModulesMapCache.id;
|
|
98578
|
-
var cacheVersion = exportedModulesMapCache.version();
|
|
98579
|
-
if (state.previousCache) {
|
|
98580
|
-
if (state.previousCache.id === cacheId && state.previousCache.version === cacheVersion) {
|
|
98581
|
-
return;
|
|
98582
|
-
}
|
|
98583
|
-
state.previousCache.id = cacheId;
|
|
98584
|
-
state.previousCache.version = cacheVersion;
|
|
98585
|
-
}
|
|
98586
|
-
else {
|
|
98587
|
-
state.previousCache = { id: cacheId, version: cacheVersion };
|
|
98588
|
-
}
|
|
98589
98650
|
(_a = exportedModulesMapCache.deletedKeys()) === null || _a === void 0 ? void 0 : _a.forEach(function (path) { return state.exportedModulesMap.deleteKey(path); });
|
|
98590
98651
|
exportedModulesMapCache.forEach(function (exportedModules, path) { return state.exportedModulesMap.set(path, exportedModules); });
|
|
98591
98652
|
}
|
|
@@ -98838,7 +98899,8 @@ var ts;
|
|
|
98838
98899
|
function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
|
|
98839
98900
|
ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
|
|
98840
98901
|
}
|
|
98841
|
-
function getNextAffectedFile(state, cancellationToken, computeHash) {
|
|
98902
|
+
function getNextAffectedFile(state, cancellationToken, computeHash, host) {
|
|
98903
|
+
var _a;
|
|
98842
98904
|
while (true) {
|
|
98843
98905
|
var affectedFiles = state.affectedFiles;
|
|
98844
98906
|
if (affectedFiles) {
|
|
@@ -98848,7 +98910,7 @@ var ts;
|
|
|
98848
98910
|
var affectedFile = affectedFiles[affectedFilesIndex];
|
|
98849
98911
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
98850
98912
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
98851
|
-
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash);
|
|
98913
|
+
handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
|
|
98852
98914
|
return affectedFile;
|
|
98853
98915
|
}
|
|
98854
98916
|
affectedFilesIndex++;
|
|
@@ -98858,6 +98920,7 @@ var ts;
|
|
|
98858
98920
|
ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures);
|
|
98859
98921
|
state.currentAffectedFilesSignatures.clear();
|
|
98860
98922
|
ts.BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
|
|
98923
|
+
(_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clear();
|
|
98861
98924
|
state.affectedFiles = undefined;
|
|
98862
98925
|
}
|
|
98863
98926
|
var nextKey = state.changedFilesSet.keys().next();
|
|
@@ -98882,6 +98945,11 @@ var ts;
|
|
|
98882
98945
|
state.seenAffectedFiles = new ts.Set();
|
|
98883
98946
|
}
|
|
98884
98947
|
}
|
|
98948
|
+
function clearAffectedFilesPendingEmit(state) {
|
|
98949
|
+
state.affectedFilesPendingEmit = undefined;
|
|
98950
|
+
state.affectedFilesPendingEmitKind = undefined;
|
|
98951
|
+
state.affectedFilesPendingEmitIndex = undefined;
|
|
98952
|
+
}
|
|
98885
98953
|
function getNextAffectedFilePendingEmit(state) {
|
|
98886
98954
|
var affectedFilesPendingEmit = state.affectedFilesPendingEmit;
|
|
98887
98955
|
if (affectedFilesPendingEmit) {
|
|
@@ -98897,13 +98965,11 @@ var ts;
|
|
|
98897
98965
|
}
|
|
98898
98966
|
}
|
|
98899
98967
|
}
|
|
98900
|
-
state
|
|
98901
|
-
state.affectedFilesPendingEmitKind = undefined;
|
|
98902
|
-
state.affectedFilesPendingEmitIndex = undefined;
|
|
98968
|
+
clearAffectedFilesPendingEmit(state);
|
|
98903
98969
|
}
|
|
98904
98970
|
return undefined;
|
|
98905
98971
|
}
|
|
98906
|
-
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash) {
|
|
98972
|
+
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
|
|
98907
98973
|
var _a;
|
|
98908
98974
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
98909
98975
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
@@ -98924,16 +98990,16 @@ var ts;
|
|
|
98924
98990
|
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
|
|
98925
98991
|
}
|
|
98926
98992
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
98927
|
-
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
98993
|
+
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host); });
|
|
98928
98994
|
}
|
|
98929
98995
|
}
|
|
98930
|
-
function handleDtsMayChangeOf(state, path, cancellationToken, computeHash) {
|
|
98996
|
+
function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host) {
|
|
98931
98997
|
removeSemanticDiagnosticsOf(state, path);
|
|
98932
98998
|
if (!state.changedFilesSet.has(path)) {
|
|
98933
98999
|
var program = ts.Debug.checkDefined(state.program);
|
|
98934
99000
|
var sourceFile = program.getSourceFileByPath(path);
|
|
98935
99001
|
if (sourceFile) {
|
|
98936
|
-
ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap,
|
|
99002
|
+
ts.BuilderState.updateShapeSignature(state, program, sourceFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap, !host.disableUseFileVersionAsSignature);
|
|
98937
99003
|
if (ts.getEmitDeclarations(state.compilerOptions)) {
|
|
98938
99004
|
addToAffectedFilesPendingEmit(state, path, 0);
|
|
98939
99005
|
}
|
|
@@ -99078,8 +99144,8 @@ var ts;
|
|
|
99078
99144
|
var signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
|
|
99079
99145
|
var actualSignature = signature !== null && signature !== void 0 ? signature : value.signature;
|
|
99080
99146
|
return value.version === actualSignature ?
|
|
99081
|
-
value.affectsGlobalScope ?
|
|
99082
|
-
{ version: value.version, signature: undefined, affectsGlobalScope:
|
|
99147
|
+
value.affectsGlobalScope || value.impliedFormat ?
|
|
99148
|
+
{ version: value.version, signature: undefined, affectsGlobalScope: value.affectsGlobalScope, impliedFormat: value.impliedFormat } :
|
|
99083
99149
|
value.version :
|
|
99084
99150
|
actualSignature !== undefined ?
|
|
99085
99151
|
signature === undefined ?
|
|
@@ -99312,7 +99378,7 @@ var ts;
|
|
|
99312
99378
|
return ts.emitSkippedWithNoDiagnostics;
|
|
99313
99379
|
}
|
|
99314
99380
|
function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
99315
|
-
var affected = getNextAffectedFile(state, cancellationToken, computeHash);
|
|
99381
|
+
var affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
|
|
99316
99382
|
var emitKind = 1;
|
|
99317
99383
|
var isPendingEmitFile = false;
|
|
99318
99384
|
if (!affected) {
|
|
@@ -99338,55 +99404,49 @@ var ts;
|
|
|
99338
99404
|
return toAffectedFileEmitResult(state, ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0, customTransformers), affected, emitKind, isPendingEmitFile);
|
|
99339
99405
|
}
|
|
99340
99406
|
function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
99341
|
-
var
|
|
99342
|
-
var savedAffectedFilesPendingEmit;
|
|
99343
|
-
var savedAffectedFilesPendingEmitKind;
|
|
99344
|
-
var savedAffectedFilesPendingEmitIndex;
|
|
99345
|
-
if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&
|
|
99346
|
-
!targetSourceFile &&
|
|
99347
|
-
!ts.outFile(state.compilerOptions) &&
|
|
99348
|
-
!state.compilerOptions.noEmit &&
|
|
99349
|
-
state.compilerOptions.noEmitOnError) {
|
|
99350
|
-
restorePendingEmitOnHandlingNoEmitSuccess = true;
|
|
99351
|
-
savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
|
|
99352
|
-
savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
|
|
99353
|
-
savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
|
|
99354
|
-
}
|
|
99407
|
+
var _a;
|
|
99355
99408
|
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
|
|
99356
99409
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
99357
99410
|
}
|
|
99358
99411
|
var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
|
|
99359
99412
|
if (result)
|
|
99360
99413
|
return result;
|
|
99361
|
-
if (
|
|
99362
|
-
|
|
99363
|
-
|
|
99364
|
-
|
|
99365
|
-
|
|
99366
|
-
|
|
99367
|
-
|
|
99368
|
-
|
|
99369
|
-
|
|
99370
|
-
|
|
99371
|
-
|
|
99372
|
-
|
|
99373
|
-
|
|
99374
|
-
|
|
99375
|
-
|
|
99376
|
-
|
|
99414
|
+
if (!targetSourceFile) {
|
|
99415
|
+
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
|
|
99416
|
+
var sourceMaps = [];
|
|
99417
|
+
var emitSkipped = false;
|
|
99418
|
+
var diagnostics = void 0;
|
|
99419
|
+
var emittedFiles = [];
|
|
99420
|
+
var affectedEmitResult = void 0;
|
|
99421
|
+
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
|
|
99422
|
+
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
99423
|
+
diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
99424
|
+
emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
99425
|
+
sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
|
|
99426
|
+
}
|
|
99427
|
+
return {
|
|
99428
|
+
emitSkipped: emitSkipped,
|
|
99429
|
+
diagnostics: diagnostics || ts.emptyArray,
|
|
99430
|
+
emittedFiles: emittedFiles,
|
|
99431
|
+
sourceMaps: sourceMaps
|
|
99432
|
+
};
|
|
99433
|
+
}
|
|
99434
|
+
else if ((_a = state.affectedFilesPendingEmitKind) === null || _a === void 0 ? void 0 : _a.size) {
|
|
99435
|
+
ts.Debug.assert(kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram);
|
|
99436
|
+
if (!emitOnlyDtsFiles
|
|
99437
|
+
|| ts.every(state.affectedFilesPendingEmit, function (path, index) {
|
|
99438
|
+
return index < state.affectedFilesPendingEmitIndex ||
|
|
99439
|
+
state.affectedFilesPendingEmitKind.get(path) === 0;
|
|
99440
|
+
})) {
|
|
99441
|
+
clearAffectedFilesPendingEmit(state);
|
|
99442
|
+
}
|
|
99377
99443
|
}
|
|
99378
|
-
return {
|
|
99379
|
-
emitSkipped: emitSkipped,
|
|
99380
|
-
diagnostics: diagnostics || ts.emptyArray,
|
|
99381
|
-
emittedFiles: emittedFiles,
|
|
99382
|
-
sourceMaps: sourceMaps
|
|
99383
|
-
};
|
|
99384
99444
|
}
|
|
99385
99445
|
return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
99386
99446
|
}
|
|
99387
99447
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
99388
99448
|
while (true) {
|
|
99389
|
-
var affected = getNextAffectedFile(state, cancellationToken, computeHash);
|
|
99449
|
+
var affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
|
|
99390
99450
|
if (!affected) {
|
|
99391
99451
|
return undefined;
|
|
99392
99452
|
}
|
|
@@ -102141,9 +102201,6 @@ var ts;
|
|
|
102141
102201
|
function newer(date1, date2) {
|
|
102142
102202
|
return date2 > date1 ? date2 : date1;
|
|
102143
102203
|
}
|
|
102144
|
-
function isDeclarationFile(fileName) {
|
|
102145
|
-
return ts.fileExtensionIs(fileName, ".d.ts");
|
|
102146
|
-
}
|
|
102147
102204
|
function isCircularBuildOrder(buildOrder) {
|
|
102148
102205
|
return !!buildOrder && !!buildOrder.buildOrder;
|
|
102149
102206
|
}
|
|
@@ -102681,7 +102738,7 @@ var ts;
|
|
|
102681
102738
|
outputFiles.forEach(function (_a) {
|
|
102682
102739
|
var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
|
|
102683
102740
|
var priorChangeTime;
|
|
102684
|
-
if (!anyDtsChanged &&
|
|
102741
|
+
if (!anyDtsChanged && ts.isDeclarationFileName(name)) {
|
|
102685
102742
|
if (host.fileExists(name) && state.readFileWithCache(name) === text) {
|
|
102686
102743
|
priorChangeTime = host.getModifiedTime(name);
|
|
102687
102744
|
}
|
|
@@ -102997,7 +103054,7 @@ var ts;
|
|
|
102997
103054
|
newestOutputFileTime = outputTime;
|
|
102998
103055
|
newestOutputFileName = output;
|
|
102999
103056
|
}
|
|
103000
|
-
if (
|
|
103057
|
+
if (ts.isDeclarationFileName(output)) {
|
|
103001
103058
|
var outputModifiedTime = ts.getModifiedTime(host, output);
|
|
103002
103059
|
newestDeclarationFileContentChangedTime = newer(newestDeclarationFileContentChangedTime, outputModifiedTime);
|
|
103003
103060
|
}
|
|
@@ -103137,7 +103194,7 @@ var ts;
|
|
|
103137
103194
|
reportVerbose = false;
|
|
103138
103195
|
reportStatus(state, verboseMessage, proj.options.configFilePath);
|
|
103139
103196
|
}
|
|
103140
|
-
if (
|
|
103197
|
+
if (ts.isDeclarationFileName(file)) {
|
|
103141
103198
|
priorNewestUpdateTime = newer(priorNewestUpdateTime, ts.getModifiedTime(host, file));
|
|
103142
103199
|
}
|
|
103143
103200
|
host.setModifiedTime(file, now);
|