typescript 5.0.0-dev.20230112 → 5.0.0-dev.20230113
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 +262 -242
- package/lib/tsserver.js +347 -257
- package/lib/tsserverlibrary.d.ts +11 -2
- package/lib/tsserverlibrary.js +347 -258
- package/lib/typescript.d.ts +11 -2
- package/lib/typescript.js +338 -258
- package/lib/typingsInstaller.js +99 -160
- package/package.json +5 -2
package/lib/tsserver.js
CHANGED
|
@@ -194,6 +194,7 @@ __export(server_exports, {
|
|
|
194
194
|
addEmitHelper: () => addEmitHelper,
|
|
195
195
|
addEmitHelpers: () => addEmitHelpers,
|
|
196
196
|
addNodeFactoryPatcher: () => addNodeFactoryPatcher,
|
|
197
|
+
addObjectAllocatorPatcher: () => addObjectAllocatorPatcher,
|
|
197
198
|
addRange: () => addRange,
|
|
198
199
|
addRelatedInfo: () => addRelatedInfo,
|
|
199
200
|
addSyntheticLeadingComment: () => addSyntheticLeadingComment,
|
|
@@ -962,6 +963,9 @@ __export(server_exports, {
|
|
|
962
963
|
getGeneratedNameForNode: () => getGeneratedNameForNode,
|
|
963
964
|
getHeritageClause: () => getHeritageClause,
|
|
964
965
|
getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc,
|
|
966
|
+
getIdentifierAutoGenerate: () => getIdentifierAutoGenerate,
|
|
967
|
+
getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
|
|
968
|
+
getIdentifierTypeArguments: () => getIdentifierTypeArguments,
|
|
965
969
|
getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
|
|
966
970
|
getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
|
|
967
971
|
getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
|
|
@@ -1295,6 +1299,7 @@ __export(server_exports, {
|
|
|
1295
1299
|
hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames,
|
|
1296
1300
|
idText: () => idText,
|
|
1297
1301
|
identifierIsThisKeyword: () => identifierIsThisKeyword,
|
|
1302
|
+
identifierToKeywordKind: () => identifierToKeywordKind,
|
|
1298
1303
|
identity: () => identity,
|
|
1299
1304
|
identitySourceMapConsumer: () => identitySourceMapConsumer,
|
|
1300
1305
|
ignoreSourceNewlines: () => ignoreSourceNewlines,
|
|
@@ -2184,6 +2189,7 @@ __export(server_exports, {
|
|
|
2184
2189
|
sameMap: () => sameMap,
|
|
2185
2190
|
sameMapping: () => sameMapping,
|
|
2186
2191
|
scanShebangTrivia: () => scanShebangTrivia,
|
|
2192
|
+
scanTokenAtPosition: () => scanTokenAtPosition,
|
|
2187
2193
|
scanner: () => scanner,
|
|
2188
2194
|
screenStartingMessageCodes: () => screenStartingMessageCodes,
|
|
2189
2195
|
semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations,
|
|
@@ -2196,6 +2202,9 @@ __export(server_exports, {
|
|
|
2196
2202
|
setEachParent: () => setEachParent,
|
|
2197
2203
|
setEmitFlags: () => setEmitFlags,
|
|
2198
2204
|
setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned,
|
|
2205
|
+
setIdentifierAutoGenerate: () => setIdentifierAutoGenerate,
|
|
2206
|
+
setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference,
|
|
2207
|
+
setIdentifierTypeArguments: () => setIdentifierTypeArguments,
|
|
2199
2208
|
setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages,
|
|
2200
2209
|
setModuleDefaultHelper: () => setModuleDefaultHelper,
|
|
2201
2210
|
setNodeFlags: () => setNodeFlags,
|
|
@@ -2662,7 +2671,7 @@ __export(ts_server_exports3, {
|
|
|
2662
2671
|
|
|
2663
2672
|
// src/compiler/corePublic.ts
|
|
2664
2673
|
var versionMajorMinor = "5.0";
|
|
2665
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2674
|
+
var version = `${versionMajorMinor}.0-dev.20230113`;
|
|
2666
2675
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2667
2676
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2668
2677
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6542,6 +6551,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags4) => {
|
|
|
6542
6551
|
NodeFlags4[NodeFlags4["ContextFlags"] = 50720768] = "ContextFlags";
|
|
6543
6552
|
NodeFlags4[NodeFlags4["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags";
|
|
6544
6553
|
NodeFlags4[NodeFlags4["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags";
|
|
6554
|
+
NodeFlags4[NodeFlags4["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape";
|
|
6555
|
+
NodeFlags4[NodeFlags4["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace";
|
|
6545
6556
|
return NodeFlags4;
|
|
6546
6557
|
})(NodeFlags || {});
|
|
6547
6558
|
var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
|
|
@@ -10950,6 +10961,8 @@ var Diagnostics = {
|
|
|
10950
10961
|
package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."),
|
|
10951
10962
|
package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"),
|
|
10952
10963
|
Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
10964
|
+
Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
|
|
10965
|
+
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
10953
10966
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
10954
10967
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
10955
10968
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -14016,6 +14029,10 @@ function unescapeLeadingUnderscores(identifier) {
|
|
|
14016
14029
|
function idText(identifierOrPrivateName) {
|
|
14017
14030
|
return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText);
|
|
14018
14031
|
}
|
|
14032
|
+
function identifierToKeywordKind(node) {
|
|
14033
|
+
const token = stringToToken(node.escapedText);
|
|
14034
|
+
return token ? tryCast(token, isKeyword) : void 0;
|
|
14035
|
+
}
|
|
14019
14036
|
function symbolName(symbol) {
|
|
14020
14037
|
if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
|
|
14021
14038
|
return idText(symbol.valueDeclaration.name);
|
|
@@ -14323,15 +14340,17 @@ function getJSDocReturnType(node) {
|
|
|
14323
14340
|
}
|
|
14324
14341
|
}
|
|
14325
14342
|
function getJSDocTagsWorker(node, noCache) {
|
|
14343
|
+
var _a2, _b;
|
|
14326
14344
|
if (!canHaveJSDoc(node))
|
|
14327
14345
|
return emptyArray;
|
|
14328
|
-
let tags = node.jsDocCache;
|
|
14346
|
+
let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache;
|
|
14329
14347
|
if (tags === void 0 || noCache) {
|
|
14330
14348
|
const comments = getJSDocCommentsAndTags(node, noCache);
|
|
14331
14349
|
Debug.assert(comments.length < 2 || comments[0] !== comments[1]);
|
|
14332
14350
|
tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j);
|
|
14333
14351
|
if (!noCache) {
|
|
14334
|
-
node.
|
|
14352
|
+
(_b = node.jsDoc) != null ? _b : node.jsDoc = [];
|
|
14353
|
+
node.jsDoc.jsDocCache = tags;
|
|
14335
14354
|
}
|
|
14336
14355
|
}
|
|
14337
14356
|
return tags;
|
|
@@ -14530,10 +14549,12 @@ function isStringTextContainingNode(node) {
|
|
|
14530
14549
|
return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14531
14550
|
}
|
|
14532
14551
|
function isGeneratedIdentifier(node) {
|
|
14533
|
-
|
|
14552
|
+
var _a2;
|
|
14553
|
+
return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
|
|
14534
14554
|
}
|
|
14535
14555
|
function isGeneratedPrivateIdentifier(node) {
|
|
14536
|
-
|
|
14556
|
+
var _a2;
|
|
14557
|
+
return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
|
|
14537
14558
|
}
|
|
14538
14559
|
function isPrivateIdentifierClassElementDeclaration(node) {
|
|
14539
14560
|
return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
|
|
@@ -15915,10 +15936,11 @@ function isComputedNonLiteralName(name) {
|
|
|
15915
15936
|
return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
15916
15937
|
}
|
|
15917
15938
|
function tryGetTextOfPropertyName(name) {
|
|
15939
|
+
var _a2;
|
|
15918
15940
|
switch (name.kind) {
|
|
15919
15941
|
case 79 /* Identifier */:
|
|
15920
15942
|
case 80 /* PrivateIdentifier */:
|
|
15921
|
-
return name.autoGenerate ? void 0 : name.escapedText;
|
|
15943
|
+
return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText;
|
|
15922
15944
|
case 10 /* StringLiteral */:
|
|
15923
15945
|
case 8 /* NumericLiteral */:
|
|
15924
15946
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -16036,6 +16058,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
|
|
|
16036
16058
|
const start2 = scanner2.getTokenPos();
|
|
16037
16059
|
return createTextSpanFromBounds(start2, scanner2.getTextPos());
|
|
16038
16060
|
}
|
|
16061
|
+
function scanTokenAtPosition(sourceFile, pos) {
|
|
16062
|
+
const scanner2 = createScanner(
|
|
16063
|
+
sourceFile.languageVersion,
|
|
16064
|
+
/*skipTrivia*/
|
|
16065
|
+
true,
|
|
16066
|
+
sourceFile.languageVariant,
|
|
16067
|
+
sourceFile.text,
|
|
16068
|
+
/*onError:*/
|
|
16069
|
+
void 0,
|
|
16070
|
+
pos
|
|
16071
|
+
);
|
|
16072
|
+
scanner2.scan();
|
|
16073
|
+
return scanner2.getToken();
|
|
16074
|
+
}
|
|
16039
16075
|
function getErrorSpanForArrowFunction(sourceFile, node) {
|
|
16040
16076
|
const pos = skipTrivia(sourceFile.text, node.pos);
|
|
16041
16077
|
if (node.body && node.body.kind === 238 /* Block */) {
|
|
@@ -17728,7 +17764,8 @@ function isStringAKeyword(name) {
|
|
|
17728
17764
|
const token = stringToToken(name);
|
|
17729
17765
|
return token !== void 0 && isKeyword(token);
|
|
17730
17766
|
}
|
|
17731
|
-
function isIdentifierANonContextualKeyword(
|
|
17767
|
+
function isIdentifierANonContextualKeyword(node) {
|
|
17768
|
+
const originalKeywordKind = identifierToKeywordKind(node);
|
|
17732
17769
|
return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
|
|
17733
17770
|
}
|
|
17734
17771
|
function isTrivia(token) {
|
|
@@ -18600,7 +18637,7 @@ function isThisInTypeQuery(node) {
|
|
|
18600
18637
|
return node.parent.kind === 183 /* TypeQuery */;
|
|
18601
18638
|
}
|
|
18602
18639
|
function identifierIsThisKeyword(id) {
|
|
18603
|
-
return id.
|
|
18640
|
+
return id.escapedText === "this";
|
|
18604
18641
|
}
|
|
18605
18642
|
function getAllAccessorDeclarations(declarations, accessor) {
|
|
18606
18643
|
let firstAccessor;
|
|
@@ -18911,7 +18948,7 @@ function getEffectiveModifierFlagsNoCache(node) {
|
|
|
18911
18948
|
}
|
|
18912
18949
|
function getSyntacticModifierFlagsNoCache(node) {
|
|
18913
18950
|
let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
|
|
18914
|
-
if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.
|
|
18951
|
+
if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
|
|
18915
18952
|
flags |= 1 /* Export */;
|
|
18916
18953
|
}
|
|
18917
18954
|
return flags;
|
|
@@ -19683,7 +19720,6 @@ function Identifier2(kind, pos, end) {
|
|
|
19683
19720
|
this.parent = void 0;
|
|
19684
19721
|
this.original = void 0;
|
|
19685
19722
|
this.emitNode = void 0;
|
|
19686
|
-
this.flowNode = void 0;
|
|
19687
19723
|
}
|
|
19688
19724
|
function SourceMapSource(fileName, text, skipTrivia2) {
|
|
19689
19725
|
this.fileName = fileName;
|
|
@@ -19701,8 +19737,14 @@ var objectAllocator = {
|
|
|
19701
19737
|
getSignatureConstructor: () => Signature2,
|
|
19702
19738
|
getSourceMapSourceConstructor: () => SourceMapSource
|
|
19703
19739
|
};
|
|
19740
|
+
var objectAllocatorPatchers = [];
|
|
19741
|
+
function addObjectAllocatorPatcher(fn) {
|
|
19742
|
+
objectAllocatorPatchers.push(fn);
|
|
19743
|
+
fn(objectAllocator);
|
|
19744
|
+
}
|
|
19704
19745
|
function setObjectAllocator(alloc) {
|
|
19705
19746
|
Object.assign(objectAllocator, alloc);
|
|
19747
|
+
forEach(objectAllocatorPatchers, (fn) => fn(objectAllocator));
|
|
19706
19748
|
}
|
|
19707
19749
|
function formatStringFromArgs(text, args, baseIndex = 0) {
|
|
19708
19750
|
return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex]));
|
|
@@ -21724,7 +21766,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21724
21766
|
createRegularExpressionLiteral: createRegularExpressionLiteral2,
|
|
21725
21767
|
createLiteralLikeNode,
|
|
21726
21768
|
createIdentifier: createIdentifier3,
|
|
21727
|
-
updateIdentifier,
|
|
21728
21769
|
createTempVariable: createTempVariable3,
|
|
21729
21770
|
createLoopVariable: createLoopVariable2,
|
|
21730
21771
|
createUniqueName: createUniqueName2,
|
|
@@ -22467,55 +22508,43 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22467
22508
|
);
|
|
22468
22509
|
}
|
|
22469
22510
|
}
|
|
22470
|
-
function createBaseIdentifier(escapedText
|
|
22511
|
+
function createBaseIdentifier(escapedText) {
|
|
22471
22512
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
22472
|
-
node.originalKeywordKind = originalKeywordKind;
|
|
22473
22513
|
node.escapedText = escapedText;
|
|
22474
|
-
node.autoGenerate = void 0;
|
|
22475
|
-
node.typeArguments = void 0;
|
|
22476
|
-
node.hasExtendedUnicodeEscape = void 0;
|
|
22477
22514
|
node.jsDoc = void 0;
|
|
22478
|
-
node.jsDocCache = void 0;
|
|
22479
22515
|
node.flowNode = void 0;
|
|
22480
22516
|
node.symbol = void 0;
|
|
22481
22517
|
return node;
|
|
22482
22518
|
}
|
|
22483
22519
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
22484
|
-
const node = createBaseIdentifier(
|
|
22485
|
-
|
|
22486
|
-
/*originalKeywordKind*/
|
|
22487
|
-
void 0
|
|
22488
|
-
);
|
|
22489
|
-
node.autoGenerate = {
|
|
22520
|
+
const node = createBaseIdentifier(escapeLeadingUnderscores(text));
|
|
22521
|
+
setIdentifierAutoGenerate(node, {
|
|
22490
22522
|
flags: autoGenerateFlags,
|
|
22491
22523
|
id: nextAutoGenerateId,
|
|
22492
22524
|
prefix,
|
|
22493
22525
|
suffix
|
|
22494
|
-
};
|
|
22526
|
+
});
|
|
22495
22527
|
nextAutoGenerateId++;
|
|
22496
22528
|
return node;
|
|
22497
22529
|
}
|
|
22498
|
-
function createIdentifier3(text,
|
|
22530
|
+
function createIdentifier3(text, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
22499
22531
|
if (originalKeywordKind === void 0 && text) {
|
|
22500
22532
|
originalKeywordKind = stringToToken(text);
|
|
22501
22533
|
}
|
|
22502
22534
|
if (originalKeywordKind === 79 /* Identifier */) {
|
|
22503
22535
|
originalKeywordKind = void 0;
|
|
22504
22536
|
}
|
|
22505
|
-
const node = createBaseIdentifier(escapeLeadingUnderscores(text)
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
if (node.
|
|
22537
|
+
const node = createBaseIdentifier(escapeLeadingUnderscores(text));
|
|
22538
|
+
if (hasExtendedUnicodeEscape)
|
|
22539
|
+
node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */;
|
|
22540
|
+
if (node.escapedText === "await") {
|
|
22509
22541
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
22510
22542
|
}
|
|
22511
|
-
if (node.
|
|
22543
|
+
if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
|
|
22512
22544
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
22513
22545
|
}
|
|
22514
22546
|
return node;
|
|
22515
22547
|
}
|
|
22516
|
-
function updateIdentifier(node, typeArguments) {
|
|
22517
|
-
return node.typeArguments !== typeArguments ? update(createIdentifier3(idText(node), typeArguments), node) : node;
|
|
22518
|
-
}
|
|
22519
22548
|
function createTempVariable3(recordTempVariable, reservedInNestedScopes, prefix, suffix) {
|
|
22520
22549
|
let flags2 = 1 /* Auto */;
|
|
22521
22550
|
if (reservedInNestedScopes)
|
|
@@ -22563,7 +22592,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22563
22592
|
function createBasePrivateIdentifier(escapedText) {
|
|
22564
22593
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
22565
22594
|
node.escapedText = escapedText;
|
|
22566
|
-
node.autoGenerate = void 0;
|
|
22567
22595
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
22568
22596
|
return node;
|
|
22569
22597
|
}
|
|
@@ -22574,12 +22602,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22574
22602
|
}
|
|
22575
22603
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
22576
22604
|
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
22577
|
-
node
|
|
22605
|
+
setIdentifierAutoGenerate(node, {
|
|
22578
22606
|
flags: autoGenerateFlags,
|
|
22579
22607
|
id: nextAutoGenerateId,
|
|
22580
22608
|
prefix,
|
|
22581
22609
|
suffix
|
|
22582
|
-
};
|
|
22610
|
+
});
|
|
22583
22611
|
nextAutoGenerateId++;
|
|
22584
22612
|
return node;
|
|
22585
22613
|
}
|
|
@@ -22741,7 +22769,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22741
22769
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22742
22770
|
node.expression = void 0;
|
|
22743
22771
|
node.jsDoc = void 0;
|
|
22744
|
-
node.jsDocCache = void 0;
|
|
22745
22772
|
return node;
|
|
22746
22773
|
}
|
|
22747
22774
|
function updateTypeParameterDeclaration2(node, modifiers, name, constraint, defaultType) {
|
|
@@ -22762,7 +22789,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22762
22789
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */);
|
|
22763
22790
|
}
|
|
22764
22791
|
node.jsDoc = void 0;
|
|
22765
|
-
node.jsDocCache = void 0;
|
|
22766
22792
|
return node;
|
|
22767
22793
|
}
|
|
22768
22794
|
function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
|
|
@@ -22790,7 +22816,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22790
22816
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22791
22817
|
node.initializer = void 0;
|
|
22792
22818
|
node.jsDoc = void 0;
|
|
22793
|
-
node.jsDocCache = void 0;
|
|
22794
22819
|
return node;
|
|
22795
22820
|
}
|
|
22796
22821
|
function updatePropertySignature3(node, modifiers, name, questionToken, type) {
|
|
@@ -22813,7 +22838,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22813
22838
|
const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
|
|
22814
22839
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */;
|
|
22815
22840
|
node.jsDoc = void 0;
|
|
22816
|
-
node.jsDocCache = void 0;
|
|
22817
22841
|
return node;
|
|
22818
22842
|
}
|
|
22819
22843
|
function updatePropertyDeclaration2(node, modifiers, name, questionOrExclamationToken, type, initializer) {
|
|
@@ -22829,7 +22853,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22829
22853
|
node.type = type;
|
|
22830
22854
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22831
22855
|
node.jsDoc = void 0;
|
|
22832
|
-
node.jsDocCache = void 0;
|
|
22833
22856
|
node.locals = void 0;
|
|
22834
22857
|
node.nextContainer = void 0;
|
|
22835
22858
|
node.typeArguments = void 0;
|
|
@@ -22859,7 +22882,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22859
22882
|
}
|
|
22860
22883
|
node.typeArguments = void 0;
|
|
22861
22884
|
node.jsDoc = void 0;
|
|
22862
|
-
node.jsDocCache = void 0;
|
|
22863
22885
|
node.locals = void 0;
|
|
22864
22886
|
node.nextContainer = void 0;
|
|
22865
22887
|
node.flowNode = void 0;
|
|
@@ -22883,7 +22905,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22883
22905
|
node.illegalDecorators = void 0;
|
|
22884
22906
|
node.modifiers = void 0;
|
|
22885
22907
|
node.jsDoc = void 0;
|
|
22886
|
-
node.jsDocCache = void 0;
|
|
22887
22908
|
node.locals = void 0;
|
|
22888
22909
|
node.nextContainer = void 0;
|
|
22889
22910
|
node.endFlowNode = void 0;
|
|
@@ -22911,7 +22932,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22911
22932
|
node.type = void 0;
|
|
22912
22933
|
node.typeArguments = void 0;
|
|
22913
22934
|
node.jsDoc = void 0;
|
|
22914
|
-
node.jsDocCache = void 0;
|
|
22915
22935
|
node.locals = void 0;
|
|
22916
22936
|
node.nextContainer = void 0;
|
|
22917
22937
|
node.endFlowNode = void 0;
|
|
@@ -22944,7 +22964,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22944
22964
|
node.typeArguments = void 0;
|
|
22945
22965
|
node.typeParameters = void 0;
|
|
22946
22966
|
node.jsDoc = void 0;
|
|
22947
|
-
node.jsDocCache = void 0;
|
|
22948
22967
|
node.locals = void 0;
|
|
22949
22968
|
node.nextContainer = void 0;
|
|
22950
22969
|
node.flowNode = void 0;
|
|
@@ -22976,7 +22995,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22976
22995
|
node.typeParameters = void 0;
|
|
22977
22996
|
node.type = void 0;
|
|
22978
22997
|
node.jsDoc = void 0;
|
|
22979
|
-
node.jsDocCache = void 0;
|
|
22980
22998
|
node.locals = void 0;
|
|
22981
22999
|
node.nextContainer = void 0;
|
|
22982
23000
|
node.flowNode = void 0;
|
|
@@ -23001,7 +23019,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23001
23019
|
node.type = type;
|
|
23002
23020
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23003
23021
|
node.jsDoc = void 0;
|
|
23004
|
-
node.jsDocCache = void 0;
|
|
23005
23022
|
node.locals = void 0;
|
|
23006
23023
|
node.nextContainer = void 0;
|
|
23007
23024
|
node.typeArguments = void 0;
|
|
@@ -23017,7 +23034,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23017
23034
|
node.type = type;
|
|
23018
23035
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23019
23036
|
node.jsDoc = void 0;
|
|
23020
|
-
node.jsDocCache = void 0;
|
|
23021
23037
|
node.locals = void 0;
|
|
23022
23038
|
node.nextContainer = void 0;
|
|
23023
23039
|
node.typeArguments = void 0;
|
|
@@ -23034,7 +23050,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23034
23050
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23035
23051
|
node.illegalDecorators = void 0;
|
|
23036
23052
|
node.jsDoc = void 0;
|
|
23037
|
-
node.jsDocCache = void 0;
|
|
23038
23053
|
node.locals = void 0;
|
|
23039
23054
|
node.nextContainer = void 0;
|
|
23040
23055
|
node.typeArguments = void 0;
|
|
@@ -23085,7 +23100,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23085
23100
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23086
23101
|
node.modifiers = void 0;
|
|
23087
23102
|
node.jsDoc = void 0;
|
|
23088
|
-
node.jsDocCache = void 0;
|
|
23089
23103
|
node.locals = void 0;
|
|
23090
23104
|
node.nextContainer = void 0;
|
|
23091
23105
|
node.typeArguments = void 0;
|
|
@@ -23111,7 +23125,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23111
23125
|
node.type = type;
|
|
23112
23126
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23113
23127
|
node.jsDoc = void 0;
|
|
23114
|
-
node.jsDocCache = void 0;
|
|
23115
23128
|
node.locals = void 0;
|
|
23116
23129
|
node.nextContainer = void 0;
|
|
23117
23130
|
node.typeArguments = void 0;
|
|
@@ -23180,7 +23193,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23180
23193
|
node.type = type;
|
|
23181
23194
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23182
23195
|
node.jsDoc = void 0;
|
|
23183
|
-
node.jsDocCache = void 0;
|
|
23184
23196
|
return node;
|
|
23185
23197
|
}
|
|
23186
23198
|
function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
|
|
@@ -23382,7 +23394,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23382
23394
|
node.multiLine = multiLine;
|
|
23383
23395
|
node.transformFlags |= propagateChildrenFlags(node.properties);
|
|
23384
23396
|
node.jsDoc = void 0;
|
|
23385
|
-
node.jsDocCache = void 0;
|
|
23386
23397
|
return node;
|
|
23387
23398
|
}
|
|
23388
23399
|
function updateObjectLiteralExpression(node, properties) {
|
|
@@ -23395,7 +23406,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23395
23406
|
node.name = name;
|
|
23396
23407
|
node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
|
|
23397
23408
|
node.jsDoc = void 0;
|
|
23398
|
-
node.jsDocCache = void 0;
|
|
23399
23409
|
node.flowNode = void 0;
|
|
23400
23410
|
return node;
|
|
23401
23411
|
}
|
|
@@ -23446,7 +23456,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23446
23456
|
node.argumentExpression = argumentExpression;
|
|
23447
23457
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
|
|
23448
23458
|
node.jsDoc = void 0;
|
|
23449
|
-
node.jsDocCache = void 0;
|
|
23450
23459
|
node.flowNode = void 0;
|
|
23451
23460
|
return node;
|
|
23452
23461
|
}
|
|
@@ -23597,7 +23606,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23597
23606
|
node.expression = expression;
|
|
23598
23607
|
node.transformFlags = propagateChildFlags(node.expression);
|
|
23599
23608
|
node.jsDoc = void 0;
|
|
23600
|
-
node.jsDocCache = void 0;
|
|
23601
23609
|
return node;
|
|
23602
23610
|
}
|
|
23603
23611
|
function updateParenthesizedExpression(node, expression) {
|
|
@@ -23618,7 +23626,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23618
23626
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
23619
23627
|
node.typeArguments = void 0;
|
|
23620
23628
|
node.jsDoc = void 0;
|
|
23621
|
-
node.jsDocCache = void 0;
|
|
23622
23629
|
node.locals = void 0;
|
|
23623
23630
|
node.nextContainer = void 0;
|
|
23624
23631
|
node.flowNode = void 0;
|
|
@@ -23641,7 +23648,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23641
23648
|
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */;
|
|
23642
23649
|
node.typeArguments = void 0;
|
|
23643
23650
|
node.jsDoc = void 0;
|
|
23644
|
-
node.jsDocCache = void 0;
|
|
23645
23651
|
node.locals = void 0;
|
|
23646
23652
|
node.nextContainer = void 0;
|
|
23647
23653
|
node.flowNode = void 0;
|
|
@@ -23739,7 +23745,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23739
23745
|
node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
|
|
23740
23746
|
}
|
|
23741
23747
|
node.jsDoc = void 0;
|
|
23742
|
-
node.jsDocCache = void 0;
|
|
23743
23748
|
return node;
|
|
23744
23749
|
}
|
|
23745
23750
|
function propagateAssignmentPatternFlags(node) {
|
|
@@ -23881,7 +23886,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23881
23886
|
node.members = createNodeArray2(members);
|
|
23882
23887
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
|
|
23883
23888
|
node.jsDoc = void 0;
|
|
23884
|
-
node.jsDocCache = void 0;
|
|
23885
23889
|
return node;
|
|
23886
23890
|
}
|
|
23887
23891
|
function updateClassExpression3(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
@@ -23997,7 +24001,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23997
24001
|
node.multiLine = multiLine;
|
|
23998
24002
|
node.transformFlags |= propagateChildrenFlags(node.statements);
|
|
23999
24003
|
node.jsDoc = void 0;
|
|
24000
|
-
node.jsDocCache = void 0;
|
|
24001
24004
|
node.locals = void 0;
|
|
24002
24005
|
node.nextContainer = void 0;
|
|
24003
24006
|
return node;
|
|
@@ -24015,7 +24018,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24015
24018
|
}
|
|
24016
24019
|
node.illegalDecorators = void 0;
|
|
24017
24020
|
node.jsDoc = void 0;
|
|
24018
|
-
node.jsDocCache = void 0;
|
|
24019
24021
|
node.flowNode = void 0;
|
|
24020
24022
|
return node;
|
|
24021
24023
|
}
|
|
@@ -24025,7 +24027,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24025
24027
|
function createEmptyStatement2() {
|
|
24026
24028
|
const node = createBaseNode(239 /* EmptyStatement */);
|
|
24027
24029
|
node.jsDoc = void 0;
|
|
24028
|
-
node.jsDocCache = void 0;
|
|
24029
24030
|
return node;
|
|
24030
24031
|
}
|
|
24031
24032
|
function createExpressionStatement2(expression) {
|
|
@@ -24033,7 +24034,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24033
24034
|
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
|
|
24034
24035
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
24035
24036
|
node.jsDoc = void 0;
|
|
24036
|
-
node.jsDocCache = void 0;
|
|
24037
24037
|
node.flowNode = void 0;
|
|
24038
24038
|
return node;
|
|
24039
24039
|
}
|
|
@@ -24047,7 +24047,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24047
24047
|
node.elseStatement = asEmbeddedStatement(elseStatement);
|
|
24048
24048
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
|
|
24049
24049
|
node.jsDoc = void 0;
|
|
24050
|
-
node.jsDocCache = void 0;
|
|
24051
24050
|
node.flowNode = void 0;
|
|
24052
24051
|
return node;
|
|
24053
24052
|
}
|
|
@@ -24060,7 +24059,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24060
24059
|
node.expression = expression;
|
|
24061
24060
|
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
|
|
24062
24061
|
node.jsDoc = void 0;
|
|
24063
|
-
node.jsDocCache = void 0;
|
|
24064
24062
|
node.flowNode = void 0;
|
|
24065
24063
|
return node;
|
|
24066
24064
|
}
|
|
@@ -24073,7 +24071,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24073
24071
|
node.statement = asEmbeddedStatement(statement);
|
|
24074
24072
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
|
|
24075
24073
|
node.jsDoc = void 0;
|
|
24076
|
-
node.jsDocCache = void 0;
|
|
24077
24074
|
node.flowNode = void 0;
|
|
24078
24075
|
return node;
|
|
24079
24076
|
}
|
|
@@ -24088,7 +24085,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24088
24085
|
node.statement = asEmbeddedStatement(statement);
|
|
24089
24086
|
node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
|
|
24090
24087
|
node.jsDoc = void 0;
|
|
24091
|
-
node.jsDocCache = void 0;
|
|
24092
24088
|
node.locals = void 0;
|
|
24093
24089
|
node.nextContainer = void 0;
|
|
24094
24090
|
node.flowNode = void 0;
|
|
@@ -24104,7 +24100,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24104
24100
|
node.statement = asEmbeddedStatement(statement);
|
|
24105
24101
|
node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
|
|
24106
24102
|
node.jsDoc = void 0;
|
|
24107
|
-
node.jsDocCache = void 0;
|
|
24108
24103
|
node.locals = void 0;
|
|
24109
24104
|
node.nextContainer = void 0;
|
|
24110
24105
|
node.flowNode = void 0;
|
|
@@ -24123,7 +24118,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24123
24118
|
if (awaitModifier)
|
|
24124
24119
|
node.transformFlags |= 128 /* ContainsES2018 */;
|
|
24125
24120
|
node.jsDoc = void 0;
|
|
24126
|
-
node.jsDocCache = void 0;
|
|
24127
24121
|
node.locals = void 0;
|
|
24128
24122
|
node.nextContainer = void 0;
|
|
24129
24123
|
node.flowNode = void 0;
|
|
@@ -24137,7 +24131,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24137
24131
|
node.label = asName(label);
|
|
24138
24132
|
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
24139
24133
|
node.jsDoc = void 0;
|
|
24140
|
-
node.jsDocCache = void 0;
|
|
24141
24134
|
node.flowNode = void 0;
|
|
24142
24135
|
return node;
|
|
24143
24136
|
}
|
|
@@ -24149,7 +24142,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24149
24142
|
node.label = asName(label);
|
|
24150
24143
|
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
24151
24144
|
node.jsDoc = void 0;
|
|
24152
|
-
node.jsDocCache = void 0;
|
|
24153
24145
|
node.flowNode = void 0;
|
|
24154
24146
|
return node;
|
|
24155
24147
|
}
|
|
@@ -24161,7 +24153,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24161
24153
|
node.expression = expression;
|
|
24162
24154
|
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
24163
24155
|
node.jsDoc = void 0;
|
|
24164
|
-
node.jsDocCache = void 0;
|
|
24165
24156
|
node.flowNode = void 0;
|
|
24166
24157
|
return node;
|
|
24167
24158
|
}
|
|
@@ -24174,7 +24165,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24174
24165
|
node.statement = asEmbeddedStatement(statement);
|
|
24175
24166
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
|
|
24176
24167
|
node.jsDoc = void 0;
|
|
24177
|
-
node.jsDocCache = void 0;
|
|
24178
24168
|
node.flowNode = void 0;
|
|
24179
24169
|
return node;
|
|
24180
24170
|
}
|
|
@@ -24187,7 +24177,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24187
24177
|
node.caseBlock = caseBlock;
|
|
24188
24178
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
|
|
24189
24179
|
node.jsDoc = void 0;
|
|
24190
|
-
node.jsDocCache = void 0;
|
|
24191
24180
|
node.flowNode = void 0;
|
|
24192
24181
|
node.possiblyExhaustive = false;
|
|
24193
24182
|
return node;
|
|
@@ -24201,7 +24190,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24201
24190
|
node.statement = asEmbeddedStatement(statement);
|
|
24202
24191
|
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
|
|
24203
24192
|
node.jsDoc = void 0;
|
|
24204
|
-
node.jsDocCache = void 0;
|
|
24205
24193
|
node.flowNode = void 0;
|
|
24206
24194
|
return node;
|
|
24207
24195
|
}
|
|
@@ -24213,7 +24201,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24213
24201
|
node.expression = expression;
|
|
24214
24202
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
24215
24203
|
node.jsDoc = void 0;
|
|
24216
|
-
node.jsDocCache = void 0;
|
|
24217
24204
|
node.flowNode = void 0;
|
|
24218
24205
|
return node;
|
|
24219
24206
|
}
|
|
@@ -24227,7 +24214,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24227
24214
|
node.finallyBlock = finallyBlock;
|
|
24228
24215
|
node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
|
|
24229
24216
|
node.jsDoc = void 0;
|
|
24230
|
-
node.jsDocCache = void 0;
|
|
24231
24217
|
node.flowNode = void 0;
|
|
24232
24218
|
return node;
|
|
24233
24219
|
}
|
|
@@ -24237,7 +24223,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24237
24223
|
function createDebuggerStatement2() {
|
|
24238
24224
|
const node = createBaseNode(256 /* DebuggerStatement */);
|
|
24239
24225
|
node.jsDoc = void 0;
|
|
24240
|
-
node.jsDocCache = void 0;
|
|
24241
24226
|
node.flowNode = void 0;
|
|
24242
24227
|
return node;
|
|
24243
24228
|
}
|
|
@@ -24250,7 +24235,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24250
24235
|
node.initializer = asInitializer(initializer);
|
|
24251
24236
|
node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
|
|
24252
24237
|
node.jsDoc = void 0;
|
|
24253
|
-
node.jsDocCache = void 0;
|
|
24254
24238
|
return node;
|
|
24255
24239
|
}
|
|
24256
24240
|
function updateVariableDeclaration3(node, name, exclamationToken, type, initializer) {
|
|
@@ -24289,7 +24273,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24289
24273
|
node.illegalDecorators = void 0;
|
|
24290
24274
|
node.typeArguments = void 0;
|
|
24291
24275
|
node.jsDoc = void 0;
|
|
24292
|
-
node.jsDocCache = void 0;
|
|
24293
24276
|
node.locals = void 0;
|
|
24294
24277
|
node.nextContainer = void 0;
|
|
24295
24278
|
node.endFlowNode = void 0;
|
|
@@ -24321,7 +24304,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24321
24304
|
}
|
|
24322
24305
|
}
|
|
24323
24306
|
node.jsDoc = void 0;
|
|
24324
|
-
node.jsDocCache = void 0;
|
|
24325
24307
|
return node;
|
|
24326
24308
|
}
|
|
24327
24309
|
function updateClassDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
@@ -24337,7 +24319,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24337
24319
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24338
24320
|
node.illegalDecorators = void 0;
|
|
24339
24321
|
node.jsDoc = void 0;
|
|
24340
|
-
node.jsDocCache = void 0;
|
|
24341
24322
|
return node;
|
|
24342
24323
|
}
|
|
24343
24324
|
function updateInterfaceDeclaration2(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
@@ -24358,7 +24339,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24358
24339
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
24359
24340
|
node.illegalDecorators = void 0;
|
|
24360
24341
|
node.jsDoc = void 0;
|
|
24361
|
-
node.jsDocCache = void 0;
|
|
24362
24342
|
node.locals = void 0;
|
|
24363
24343
|
node.nextContainer = void 0;
|
|
24364
24344
|
return node;
|
|
@@ -24381,7 +24361,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24381
24361
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24382
24362
|
node.illegalDecorators = void 0;
|
|
24383
24363
|
node.jsDoc = void 0;
|
|
24384
|
-
node.jsDocCache = void 0;
|
|
24385
24364
|
return node;
|
|
24386
24365
|
}
|
|
24387
24366
|
function updateEnumDeclaration2(node, modifiers, name, members) {
|
|
@@ -24407,7 +24386,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24407
24386
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24408
24387
|
node.illegalDecorators = void 0;
|
|
24409
24388
|
node.jsDoc = void 0;
|
|
24410
|
-
node.jsDocCache = void 0;
|
|
24411
24389
|
node.locals = void 0;
|
|
24412
24390
|
node.nextContainer = void 0;
|
|
24413
24391
|
return node;
|
|
@@ -24426,7 +24404,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24426
24404
|
node.statements = createNodeArray2(statements);
|
|
24427
24405
|
node.transformFlags |= propagateChildrenFlags(node.statements);
|
|
24428
24406
|
node.jsDoc = void 0;
|
|
24429
|
-
node.jsDocCache = void 0;
|
|
24430
24407
|
return node;
|
|
24431
24408
|
}
|
|
24432
24409
|
function updateModuleBlock2(node, statements) {
|
|
@@ -24450,7 +24427,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24450
24427
|
node.illegalDecorators = void 0;
|
|
24451
24428
|
node.modifiers = void 0;
|
|
24452
24429
|
node.jsDoc = void 0;
|
|
24453
|
-
node.jsDocCache = void 0;
|
|
24454
24430
|
return node;
|
|
24455
24431
|
}
|
|
24456
24432
|
function updateNamespaceExportDeclaration2(node, name) {
|
|
@@ -24476,7 +24452,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24476
24452
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24477
24453
|
node.illegalDecorators = void 0;
|
|
24478
24454
|
node.jsDoc = void 0;
|
|
24479
|
-
node.jsDocCache = void 0;
|
|
24480
24455
|
return node;
|
|
24481
24456
|
}
|
|
24482
24457
|
function updateImportEqualsDeclaration2(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
@@ -24498,7 +24473,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24498
24473
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24499
24474
|
node.illegalDecorators = void 0;
|
|
24500
24475
|
node.jsDoc = void 0;
|
|
24501
|
-
node.jsDocCache = void 0;
|
|
24502
24476
|
return node;
|
|
24503
24477
|
}
|
|
24504
24478
|
function updateImportDeclaration2(node, modifiers, importClause, moduleSpecifier, assertClause) {
|
|
@@ -24610,7 +24584,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24610
24584
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24611
24585
|
node.illegalDecorators = void 0;
|
|
24612
24586
|
node.jsDoc = void 0;
|
|
24613
|
-
node.jsDocCache = void 0;
|
|
24614
24587
|
return node;
|
|
24615
24588
|
}
|
|
24616
24589
|
function updateExportAssignment2(node, modifiers, expression) {
|
|
@@ -24633,7 +24606,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24633
24606
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24634
24607
|
node.illegalDecorators = void 0;
|
|
24635
24608
|
node.jsDoc = void 0;
|
|
24636
|
-
node.jsDocCache = void 0;
|
|
24637
24609
|
return node;
|
|
24638
24610
|
}
|
|
24639
24611
|
function updateExportDeclaration3(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
|
|
@@ -24663,7 +24635,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24663
24635
|
node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
|
|
24664
24636
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24665
24637
|
node.jsDoc = void 0;
|
|
24666
|
-
node.jsDocCache = void 0;
|
|
24667
24638
|
return node;
|
|
24668
24639
|
}
|
|
24669
24640
|
function updateExportSpecifier2(node, isTypeOnly, propertyName, name) {
|
|
@@ -24672,7 +24643,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24672
24643
|
function createMissingDeclaration() {
|
|
24673
24644
|
const node = createBaseDeclaration(279 /* MissingDeclaration */);
|
|
24674
24645
|
node.jsDoc = void 0;
|
|
24675
|
-
node.jsDocCache = void 0;
|
|
24676
24646
|
return node;
|
|
24677
24647
|
}
|
|
24678
24648
|
function createExternalModuleReference2(expression) {
|
|
@@ -24713,7 +24683,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24713
24683
|
node.type = type;
|
|
24714
24684
|
node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
|
|
24715
24685
|
node.jsDoc = void 0;
|
|
24716
|
-
node.jsDocCache = void 0;
|
|
24717
24686
|
node.locals = void 0;
|
|
24718
24687
|
node.nextContainer = void 0;
|
|
24719
24688
|
node.typeArguments = void 0;
|
|
@@ -24745,7 +24714,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24745
24714
|
node.parameters = createNodeArray2(parameters);
|
|
24746
24715
|
node.type = type;
|
|
24747
24716
|
node.jsDoc = void 0;
|
|
24748
|
-
node.jsDocCache = void 0;
|
|
24749
24717
|
node.locals = void 0;
|
|
24750
24718
|
node.nextContainer = void 0;
|
|
24751
24719
|
return node;
|
|
@@ -25073,7 +25041,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25073
25041
|
node.statements = createNodeArray2(statements);
|
|
25074
25042
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
|
|
25075
25043
|
node.jsDoc = void 0;
|
|
25076
|
-
node.jsDocCache = void 0;
|
|
25077
25044
|
return node;
|
|
25078
25045
|
}
|
|
25079
25046
|
function updateCaseClause2(node, expression, statements) {
|
|
@@ -25130,7 +25097,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25130
25097
|
node.questionToken = void 0;
|
|
25131
25098
|
node.exclamationToken = void 0;
|
|
25132
25099
|
node.jsDoc = void 0;
|
|
25133
|
-
node.jsDocCache = void 0;
|
|
25134
25100
|
return node;
|
|
25135
25101
|
}
|
|
25136
25102
|
function updatePropertyAssignment2(node, name, initializer) {
|
|
@@ -25156,7 +25122,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25156
25122
|
node.questionToken = void 0;
|
|
25157
25123
|
node.exclamationToken = void 0;
|
|
25158
25124
|
node.jsDoc = void 0;
|
|
25159
|
-
node.jsDocCache = void 0;
|
|
25160
25125
|
return node;
|
|
25161
25126
|
}
|
|
25162
25127
|
function updateShorthandPropertyAssignment2(node, name, objectAssignmentInitializer) {
|
|
@@ -25177,7 +25142,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25177
25142
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
25178
25143
|
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
|
|
25179
25144
|
node.jsDoc = void 0;
|
|
25180
|
-
node.jsDocCache = void 0;
|
|
25181
25145
|
return node;
|
|
25182
25146
|
}
|
|
25183
25147
|
function updateSpreadAssignment2(node, expression) {
|
|
@@ -25189,7 +25153,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25189
25153
|
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
|
|
25190
25154
|
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
|
|
25191
25155
|
node.jsDoc = void 0;
|
|
25192
|
-
node.jsDocCache = void 0;
|
|
25193
25156
|
return node;
|
|
25194
25157
|
}
|
|
25195
25158
|
function updateEnumMember2(node, name, initializer) {
|
|
@@ -25435,36 +25398,32 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25435
25398
|
return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
|
|
25436
25399
|
}
|
|
25437
25400
|
function cloneGeneratedIdentifier(node) {
|
|
25438
|
-
const clone2 = createBaseIdentifier(
|
|
25439
|
-
node.escapedText,
|
|
25440
|
-
/*originalKeywordKind*/
|
|
25441
|
-
void 0
|
|
25442
|
-
);
|
|
25401
|
+
const clone2 = createBaseIdentifier(node.escapedText);
|
|
25443
25402
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
25444
|
-
clone2.autoGenerate = { ...node.autoGenerate };
|
|
25445
25403
|
clone2.transformFlags = node.transformFlags;
|
|
25446
25404
|
setOriginalNode(clone2, node);
|
|
25405
|
+
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
25447
25406
|
return clone2;
|
|
25448
25407
|
}
|
|
25449
25408
|
function cloneIdentifier(node) {
|
|
25450
|
-
const clone2 = createBaseIdentifier(node.escapedText
|
|
25409
|
+
const clone2 = createBaseIdentifier(node.escapedText);
|
|
25451
25410
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
25452
|
-
clone2.typeArguments = node.typeArguments;
|
|
25453
|
-
clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
|
|
25454
25411
|
clone2.jsDoc = node.jsDoc;
|
|
25455
|
-
clone2.jsDocCache = node.jsDocCache;
|
|
25456
25412
|
clone2.flowNode = node.flowNode;
|
|
25457
25413
|
clone2.symbol = node.symbol;
|
|
25458
25414
|
clone2.transformFlags = node.transformFlags;
|
|
25459
25415
|
setOriginalNode(clone2, node);
|
|
25416
|
+
const typeArguments = getIdentifierTypeArguments(node);
|
|
25417
|
+
if (typeArguments)
|
|
25418
|
+
setIdentifierTypeArguments(clone2, typeArguments);
|
|
25460
25419
|
return clone2;
|
|
25461
25420
|
}
|
|
25462
25421
|
function cloneGeneratedPrivateIdentifier(node) {
|
|
25463
25422
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
25464
25423
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
25465
|
-
clone2.autoGenerate = { ...node.autoGenerate };
|
|
25466
25424
|
clone2.transformFlags = node.transformFlags;
|
|
25467
25425
|
setOriginalNode(clone2, node);
|
|
25426
|
+
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
25468
25427
|
return clone2;
|
|
25469
25428
|
}
|
|
25470
25429
|
function clonePrivateIdentifier(node) {
|
|
@@ -26718,6 +26677,30 @@ function getTypeNode(node) {
|
|
|
26718
26677
|
var _a2;
|
|
26719
26678
|
return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode;
|
|
26720
26679
|
}
|
|
26680
|
+
function setIdentifierTypeArguments(node, typeArguments) {
|
|
26681
|
+
getOrCreateEmitNode(node).identifierTypeArguments = typeArguments;
|
|
26682
|
+
return node;
|
|
26683
|
+
}
|
|
26684
|
+
function getIdentifierTypeArguments(node) {
|
|
26685
|
+
var _a2;
|
|
26686
|
+
return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments;
|
|
26687
|
+
}
|
|
26688
|
+
function setIdentifierAutoGenerate(node, autoGenerate) {
|
|
26689
|
+
getOrCreateEmitNode(node).autoGenerate = autoGenerate;
|
|
26690
|
+
return node;
|
|
26691
|
+
}
|
|
26692
|
+
function getIdentifierAutoGenerate(node) {
|
|
26693
|
+
var _a2;
|
|
26694
|
+
return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
|
|
26695
|
+
}
|
|
26696
|
+
function setIdentifierGeneratedImportReference(node, value) {
|
|
26697
|
+
getOrCreateEmitNode(node).generatedImportReference = value;
|
|
26698
|
+
return node;
|
|
26699
|
+
}
|
|
26700
|
+
function getIdentifierGeneratedImportReference(node) {
|
|
26701
|
+
var _a2;
|
|
26702
|
+
return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference;
|
|
26703
|
+
}
|
|
26721
26704
|
|
|
26722
26705
|
// src/compiler/factory/emitHelpers.ts
|
|
26723
26706
|
function createEmitHelperFactory(context) {
|
|
@@ -29065,13 +29048,16 @@ function elideNodes(factory2, nodes) {
|
|
|
29065
29048
|
return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
|
|
29066
29049
|
}
|
|
29067
29050
|
function getNodeForGeneratedName(name) {
|
|
29068
|
-
|
|
29069
|
-
|
|
29051
|
+
var _a2;
|
|
29052
|
+
const autoGenerate = name.emitNode.autoGenerate;
|
|
29053
|
+
if (autoGenerate.flags & 4 /* Node */) {
|
|
29054
|
+
const autoGenerateId = autoGenerate.id;
|
|
29070
29055
|
let node = name;
|
|
29071
29056
|
let original = node.original;
|
|
29072
29057
|
while (original) {
|
|
29073
29058
|
node = original;
|
|
29074
|
-
|
|
29059
|
+
const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
|
|
29060
|
+
if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) {
|
|
29075
29061
|
break;
|
|
29076
29062
|
}
|
|
29077
29063
|
original = node.original;
|
|
@@ -30685,8 +30671,6 @@ var Parser;
|
|
|
30685
30671
|
const pos = getNodePos();
|
|
30686
30672
|
const result = kind === 79 /* Identifier */ ? factory2.createIdentifier(
|
|
30687
30673
|
"",
|
|
30688
|
-
/*typeArguments*/
|
|
30689
|
-
void 0,
|
|
30690
30674
|
/*originalKeywordKind*/
|
|
30691
30675
|
void 0
|
|
30692
30676
|
) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(
|
|
@@ -30721,13 +30705,7 @@ var Parser;
|
|
|
30721
30705
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
30722
30706
|
const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape();
|
|
30723
30707
|
nextTokenWithoutCheck();
|
|
30724
|
-
return finishNode(factory2.createIdentifier(
|
|
30725
|
-
text,
|
|
30726
|
-
/*typeArguments*/
|
|
30727
|
-
void 0,
|
|
30728
|
-
originalKeywordKind,
|
|
30729
|
-
hasExtendedUnicodeEscape
|
|
30730
|
-
), pos);
|
|
30708
|
+
return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
30731
30709
|
}
|
|
30732
30710
|
if (token() === 80 /* PrivateIdentifier */) {
|
|
30733
30711
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -31069,6 +31047,7 @@ var Parser;
|
|
|
31069
31047
|
return parseElement();
|
|
31070
31048
|
}
|
|
31071
31049
|
function currentNode(parsingContext2, pos) {
|
|
31050
|
+
var _a2;
|
|
31072
31051
|
if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
|
|
31073
31052
|
return void 0;
|
|
31074
31053
|
}
|
|
@@ -31083,8 +31062,8 @@ var Parser;
|
|
|
31083
31062
|
if (!canReuseNode(node, parsingContext2)) {
|
|
31084
31063
|
return void 0;
|
|
31085
31064
|
}
|
|
31086
|
-
if (canHaveJSDoc(node) && node.jsDocCache) {
|
|
31087
|
-
node.jsDocCache = void 0;
|
|
31065
|
+
if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) {
|
|
31066
|
+
node.jsDoc.jsDocCache = void 0;
|
|
31088
31067
|
}
|
|
31089
31068
|
return node;
|
|
31090
31069
|
}
|
|
@@ -31143,7 +31122,7 @@ var Parser;
|
|
|
31143
31122
|
return true;
|
|
31144
31123
|
case 171 /* MethodDeclaration */:
|
|
31145
31124
|
const methodDeclaration = node;
|
|
31146
|
-
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.
|
|
31125
|
+
const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor";
|
|
31147
31126
|
return !nameIsConstructor;
|
|
31148
31127
|
}
|
|
31149
31128
|
}
|
|
@@ -31365,13 +31344,10 @@ var Parser;
|
|
|
31365
31344
|
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
31366
31345
|
const pos = getNodePos();
|
|
31367
31346
|
let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
31368
|
-
let dotPos = getNodePos();
|
|
31369
31347
|
while (parseOptional(24 /* DotToken */)) {
|
|
31370
31348
|
if (token() === 29 /* LessThanToken */) {
|
|
31371
|
-
entity.jsdocDotPos = dotPos;
|
|
31372
31349
|
break;
|
|
31373
31350
|
}
|
|
31374
|
-
dotPos = getNodePos();
|
|
31375
31351
|
entity = finishNode(
|
|
31376
31352
|
factory2.createQualifiedName(
|
|
31377
31353
|
entity,
|
|
@@ -36151,7 +36127,7 @@ var Parser;
|
|
|
36151
36127
|
return finishNode(jsDocNamespaceNode, pos);
|
|
36152
36128
|
}
|
|
36153
36129
|
if (nested) {
|
|
36154
|
-
typeNameOrNamespaceName.
|
|
36130
|
+
typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
|
|
36155
36131
|
}
|
|
36156
36132
|
return typeNameOrNamespaceName;
|
|
36157
36133
|
}
|
|
@@ -36355,12 +36331,7 @@ var Parser;
|
|
|
36355
36331
|
const end2 = scanner2.getTextPos();
|
|
36356
36332
|
const originalKeywordKind = token();
|
|
36357
36333
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
36358
|
-
const result = finishNode(factory2.createIdentifier(
|
|
36359
|
-
text,
|
|
36360
|
-
/*typeArguments*/
|
|
36361
|
-
void 0,
|
|
36362
|
-
originalKeywordKind
|
|
36363
|
-
), pos, end2);
|
|
36334
|
+
const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2);
|
|
36364
36335
|
nextTokenJSDoc();
|
|
36365
36336
|
return result;
|
|
36366
36337
|
}
|
|
@@ -40288,7 +40259,7 @@ function resolvedTypeScriptOnly(resolved) {
|
|
|
40288
40259
|
Debug.assert(extensionIsTS(resolved.extension));
|
|
40289
40260
|
return { fileName: resolved.path, packageId: resolved.packageId };
|
|
40290
40261
|
}
|
|
40291
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) {
|
|
40262
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
|
|
40292
40263
|
if (resultFromCache) {
|
|
40293
40264
|
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
40294
40265
|
resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
|
|
@@ -40306,7 +40277,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
|
|
|
40306
40277
|
},
|
|
40307
40278
|
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
40308
40279
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
40309
|
-
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
40280
|
+
resolutionDiagnostics: initializeResolutionField(diagnostics),
|
|
40281
|
+
node10Result: legacyResult
|
|
40310
40282
|
};
|
|
40311
40283
|
}
|
|
40312
40284
|
function initializeResolutionField(value) {
|
|
@@ -41361,7 +41333,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
|
41361
41333
|
);
|
|
41362
41334
|
}
|
|
41363
41335
|
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
41364
|
-
var _a2, _b;
|
|
41336
|
+
var _a2, _b, _c, _d;
|
|
41365
41337
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
41366
41338
|
const failedLookupLocations = [];
|
|
41367
41339
|
const affectingLocations = [];
|
|
@@ -41388,44 +41360,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
41388
41360
|
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
|
|
41389
41361
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
41390
41362
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
41391
|
-
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
41363
|
+
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
41392
41364
|
} else {
|
|
41393
|
-
result = tryResolve(extensions);
|
|
41365
|
+
result = tryResolve(extensions, state);
|
|
41366
|
+
}
|
|
41367
|
+
let legacyResult;
|
|
41368
|
+
if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) {
|
|
41369
|
+
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
41370
|
+
const diagnosticState = {
|
|
41371
|
+
...state,
|
|
41372
|
+
features: state.features & ~8 /* Exports */,
|
|
41373
|
+
failedLookupLocations: [],
|
|
41374
|
+
affectingLocations: [],
|
|
41375
|
+
reportDiagnostic: noop
|
|
41376
|
+
};
|
|
41377
|
+
const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
|
|
41378
|
+
if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
|
|
41379
|
+
legacyResult = diagnosticResult.value.resolved.path;
|
|
41380
|
+
}
|
|
41394
41381
|
}
|
|
41395
41382
|
return createResolvedModuleWithFailedLookupLocations(
|
|
41396
|
-
(
|
|
41397
|
-
(
|
|
41383
|
+
(_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
|
|
41384
|
+
(_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
|
|
41398
41385
|
failedLookupLocations,
|
|
41399
41386
|
affectingLocations,
|
|
41400
41387
|
diagnostics,
|
|
41401
|
-
state.resultFromCache
|
|
41388
|
+
state.resultFromCache,
|
|
41389
|
+
legacyResult
|
|
41402
41390
|
);
|
|
41403
|
-
function tryResolve(extensions2) {
|
|
41404
|
-
const loader = (extensions3, candidate, onlyRecordFailures,
|
|
41391
|
+
function tryResolve(extensions2, state2) {
|
|
41392
|
+
const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
|
|
41405
41393
|
extensions3,
|
|
41406
41394
|
candidate,
|
|
41407
41395
|
onlyRecordFailures,
|
|
41408
|
-
|
|
41396
|
+
state3,
|
|
41409
41397
|
/*considerPackageJson*/
|
|
41410
41398
|
true
|
|
41411
41399
|
);
|
|
41412
|
-
const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader,
|
|
41400
|
+
const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2);
|
|
41413
41401
|
if (resolved) {
|
|
41414
41402
|
return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
|
|
41415
41403
|
}
|
|
41416
41404
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
41417
41405
|
let resolved2;
|
|
41418
41406
|
if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
|
|
41419
|
-
resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory,
|
|
41407
|
+
resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
41420
41408
|
}
|
|
41421
41409
|
if (!resolved2 && features & 4 /* SelfName */) {
|
|
41422
|
-
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory,
|
|
41410
|
+
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
41423
41411
|
}
|
|
41424
41412
|
if (!resolved2) {
|
|
41425
41413
|
if (traceEnabled) {
|
|
41426
41414
|
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
41427
41415
|
}
|
|
41428
|
-
resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory,
|
|
41416
|
+
resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
41429
41417
|
}
|
|
41430
41418
|
if (!resolved2)
|
|
41431
41419
|
return void 0;
|
|
@@ -41444,7 +41432,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
41444
41432
|
candidate,
|
|
41445
41433
|
/*onlyRecordFailures*/
|
|
41446
41434
|
false,
|
|
41447
|
-
|
|
41435
|
+
state2,
|
|
41448
41436
|
/*considerPackageJson*/
|
|
41449
41437
|
true
|
|
41450
41438
|
);
|
|
@@ -42784,7 +42772,7 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
42784
42772
|
case 264 /* ModuleDeclaration */:
|
|
42785
42773
|
return getModuleInstanceState(node, visited);
|
|
42786
42774
|
case 79 /* Identifier */:
|
|
42787
|
-
if (node.
|
|
42775
|
+
if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
|
|
42788
42776
|
return 0 /* NonInstantiated */;
|
|
42789
42777
|
}
|
|
42790
42778
|
}
|
|
@@ -43221,6 +43209,7 @@ function createBinder() {
|
|
|
43221
43209
|
} else if (containerFlags & 64 /* IsInterface */) {
|
|
43222
43210
|
seenThisKeyword = false;
|
|
43223
43211
|
bindChildren(node);
|
|
43212
|
+
Debug.assertNotNode(node, isIdentifier);
|
|
43224
43213
|
node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */;
|
|
43225
43214
|
} else {
|
|
43226
43215
|
bindChildren(node);
|
|
@@ -44380,13 +44369,14 @@ function createBinder() {
|
|
|
44380
44369
|
}
|
|
44381
44370
|
function checkContextualIdentifier(node) {
|
|
44382
44371
|
if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
|
|
44383
|
-
|
|
44372
|
+
const originalKeywordKind = identifierToKeywordKind(node);
|
|
44373
|
+
if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
|
|
44384
44374
|
file.bindDiagnostics.push(createDiagnosticForNode2(
|
|
44385
44375
|
node,
|
|
44386
44376
|
getStrictModeIdentifierMessage(node),
|
|
44387
44377
|
declarationNameToString(node)
|
|
44388
44378
|
));
|
|
44389
|
-
} else if (
|
|
44379
|
+
} else if (originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
44390
44380
|
if (isExternalModule(file) && isInTopLevelContext(node)) {
|
|
44391
44381
|
file.bindDiagnostics.push(createDiagnosticForNode2(
|
|
44392
44382
|
node,
|
|
@@ -44400,7 +44390,7 @@ function createBinder() {
|
|
|
44400
44390
|
declarationNameToString(node)
|
|
44401
44391
|
));
|
|
44402
44392
|
}
|
|
44403
|
-
} else if (
|
|
44393
|
+
} else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
|
|
44404
44394
|
file.bindDiagnostics.push(createDiagnosticForNode2(
|
|
44405
44395
|
node,
|
|
44406
44396
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
|
|
@@ -44612,7 +44602,7 @@ function createBinder() {
|
|
|
44612
44602
|
function bindWorker(node) {
|
|
44613
44603
|
switch (node.kind) {
|
|
44614
44604
|
case 79 /* Identifier */:
|
|
44615
|
-
if (node.
|
|
44605
|
+
if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
|
|
44616
44606
|
let parentNode = node.parent;
|
|
44617
44607
|
while (parentNode && !isJSDocTypeAlias(parentNode)) {
|
|
44618
44608
|
parentNode = parentNode.parent;
|
|
@@ -49674,6 +49664,8 @@ function createTypeChecker(host) {
|
|
|
49674
49664
|
/*isError*/
|
|
49675
49665
|
false,
|
|
49676
49666
|
errorNode,
|
|
49667
|
+
currentSourceFile,
|
|
49668
|
+
mode,
|
|
49677
49669
|
resolvedModule,
|
|
49678
49670
|
moduleReference
|
|
49679
49671
|
);
|
|
@@ -49759,6 +49751,8 @@ function createTypeChecker(host) {
|
|
|
49759
49751
|
/*isError*/
|
|
49760
49752
|
noImplicitAny && !!moduleNotFoundError,
|
|
49761
49753
|
errorNode,
|
|
49754
|
+
currentSourceFile,
|
|
49755
|
+
mode,
|
|
49762
49756
|
resolvedModule,
|
|
49763
49757
|
moduleReference
|
|
49764
49758
|
);
|
|
@@ -49813,26 +49807,37 @@ function createTypeChecker(host) {
|
|
|
49813
49807
|
return importSourceWithoutExtension;
|
|
49814
49808
|
}
|
|
49815
49809
|
}
|
|
49816
|
-
function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) {
|
|
49817
|
-
|
|
49818
|
-
|
|
49819
|
-
|
|
49820
|
-
|
|
49821
|
-
|
|
49822
|
-
|
|
49823
|
-
|
|
49824
|
-
|
|
49825
|
-
|
|
49826
|
-
|
|
49827
|
-
packageId.name
|
|
49828
|
-
|
|
49829
|
-
|
|
49830
|
-
|
|
49831
|
-
|
|
49832
|
-
|
|
49833
|
-
|
|
49834
|
-
|
|
49835
|
-
|
|
49810
|
+
function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) {
|
|
49811
|
+
var _a2, _b;
|
|
49812
|
+
let errorInfo;
|
|
49813
|
+
if (!isExternalModuleNameRelative(moduleReference) && packageId) {
|
|
49814
|
+
const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result;
|
|
49815
|
+
errorInfo = node10Result ? chainDiagnosticMessages(
|
|
49816
|
+
/*details*/
|
|
49817
|
+
void 0,
|
|
49818
|
+
Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
|
|
49819
|
+
node10Result,
|
|
49820
|
+
node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name
|
|
49821
|
+
) : typesPackageExists(packageId.name) ? chainDiagnosticMessages(
|
|
49822
|
+
/*details*/
|
|
49823
|
+
void 0,
|
|
49824
|
+
Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
|
|
49825
|
+
packageId.name,
|
|
49826
|
+
mangleScopedPackageName(packageId.name)
|
|
49827
|
+
) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
|
|
49828
|
+
/*details*/
|
|
49829
|
+
void 0,
|
|
49830
|
+
Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
|
|
49831
|
+
packageId.name,
|
|
49832
|
+
moduleReference
|
|
49833
|
+
) : chainDiagnosticMessages(
|
|
49834
|
+
/*details*/
|
|
49835
|
+
void 0,
|
|
49836
|
+
Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
|
|
49837
|
+
moduleReference,
|
|
49838
|
+
mangleScopedPackageName(packageId.name)
|
|
49839
|
+
);
|
|
49840
|
+
}
|
|
49836
49841
|
errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
|
|
49837
49842
|
errorInfo,
|
|
49838
49843
|
Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
|
|
@@ -51489,13 +51494,17 @@ function createTypeChecker(host) {
|
|
|
51489
51494
|
let qualifier = root.qualifier;
|
|
51490
51495
|
if (qualifier) {
|
|
51491
51496
|
if (isIdentifier(qualifier)) {
|
|
51492
|
-
|
|
51497
|
+
if (typeArguments !== getIdentifierTypeArguments(qualifier)) {
|
|
51498
|
+
qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments);
|
|
51499
|
+
}
|
|
51493
51500
|
} else {
|
|
51494
|
-
|
|
51495
|
-
qualifier
|
|
51496
|
-
|
|
51497
|
-
|
|
51498
|
-
|
|
51501
|
+
if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) {
|
|
51502
|
+
qualifier = factory.updateQualifiedName(
|
|
51503
|
+
qualifier,
|
|
51504
|
+
qualifier.left,
|
|
51505
|
+
setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)
|
|
51506
|
+
);
|
|
51507
|
+
}
|
|
51499
51508
|
}
|
|
51500
51509
|
}
|
|
51501
51510
|
typeArguments = ref.typeArguments;
|
|
@@ -51515,13 +51524,17 @@ function createTypeChecker(host) {
|
|
|
51515
51524
|
let typeArguments = root.typeArguments;
|
|
51516
51525
|
let typeName = root.typeName;
|
|
51517
51526
|
if (isIdentifier(typeName)) {
|
|
51518
|
-
|
|
51527
|
+
if (typeArguments !== getIdentifierTypeArguments(typeName)) {
|
|
51528
|
+
typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments);
|
|
51529
|
+
}
|
|
51519
51530
|
} else {
|
|
51520
|
-
|
|
51521
|
-
typeName
|
|
51522
|
-
|
|
51523
|
-
|
|
51524
|
-
|
|
51531
|
+
if (typeArguments !== getIdentifierTypeArguments(typeName.right)) {
|
|
51532
|
+
typeName = factory.updateQualifiedName(
|
|
51533
|
+
typeName,
|
|
51534
|
+
typeName.left,
|
|
51535
|
+
setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)
|
|
51536
|
+
);
|
|
51537
|
+
}
|
|
51525
51538
|
}
|
|
51526
51539
|
typeArguments = ref.typeArguments;
|
|
51527
51540
|
const ids = getAccessStack(ref);
|
|
@@ -52235,7 +52248,11 @@ function createTypeChecker(host) {
|
|
|
52235
52248
|
if (!nonRootParts || isEntityName(nonRootParts)) {
|
|
52236
52249
|
if (nonRootParts) {
|
|
52237
52250
|
const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
|
|
52238
|
-
|
|
52251
|
+
setIdentifierTypeArguments(
|
|
52252
|
+
lastId,
|
|
52253
|
+
/*typeArguments*/
|
|
52254
|
+
void 0
|
|
52255
|
+
);
|
|
52239
52256
|
}
|
|
52240
52257
|
return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
|
|
52241
52258
|
} else {
|
|
@@ -52252,8 +52269,12 @@ function createTypeChecker(host) {
|
|
|
52252
52269
|
return factory.createTypeQueryNode(entityName);
|
|
52253
52270
|
} else {
|
|
52254
52271
|
const lastId = isIdentifier(entityName) ? entityName : entityName.right;
|
|
52255
|
-
const lastTypeArgs = lastId
|
|
52256
|
-
|
|
52272
|
+
const lastTypeArgs = getIdentifierTypeArguments(lastId);
|
|
52273
|
+
setIdentifierTypeArguments(
|
|
52274
|
+
lastId,
|
|
52275
|
+
/*typeArguments*/
|
|
52276
|
+
void 0
|
|
52277
|
+
);
|
|
52257
52278
|
return factory.createTypeReferenceNode(entityName, lastTypeArgs);
|
|
52258
52279
|
}
|
|
52259
52280
|
function createAccessFromSymbolChain(chain2, index, stopper) {
|
|
@@ -52297,7 +52318,9 @@ function createTypeChecker(host) {
|
|
|
52297
52318
|
return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2)));
|
|
52298
52319
|
}
|
|
52299
52320
|
}
|
|
52300
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2
|
|
52321
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
|
|
52322
|
+
if (typeParameterNodes)
|
|
52323
|
+
setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
|
|
52301
52324
|
identifier.symbol = symbol2;
|
|
52302
52325
|
if (index > stopper) {
|
|
52303
52326
|
const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper);
|
|
@@ -52355,7 +52378,9 @@ function createTypeChecker(host) {
|
|
|
52355
52378
|
text = `${rawtext}_${i}`;
|
|
52356
52379
|
}
|
|
52357
52380
|
if (text !== rawtext) {
|
|
52358
|
-
|
|
52381
|
+
const typeArguments = getIdentifierTypeArguments(result);
|
|
52382
|
+
result = factory.createIdentifier(text);
|
|
52383
|
+
setIdentifierTypeArguments(result, typeArguments);
|
|
52359
52384
|
}
|
|
52360
52385
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
52361
52386
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
@@ -52379,7 +52404,9 @@ function createTypeChecker(host) {
|
|
|
52379
52404
|
if (index === 0) {
|
|
52380
52405
|
context.flags ^= 16777216 /* InInitialEntityName */;
|
|
52381
52406
|
}
|
|
52382
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2
|
|
52407
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
|
|
52408
|
+
if (typeParameterNodes)
|
|
52409
|
+
setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
|
|
52383
52410
|
identifier.symbol = symbol2;
|
|
52384
52411
|
return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier;
|
|
52385
52412
|
}
|
|
@@ -52402,7 +52429,9 @@ function createTypeChecker(host) {
|
|
|
52402
52429
|
return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
|
|
52403
52430
|
}
|
|
52404
52431
|
if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
|
|
52405
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2
|
|
52432
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
|
|
52433
|
+
if (typeParameterNodes)
|
|
52434
|
+
setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
|
|
52406
52435
|
identifier.symbol = symbol2;
|
|
52407
52436
|
return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
|
|
52408
52437
|
} else {
|
|
@@ -52417,8 +52446,11 @@ function createTypeChecker(host) {
|
|
|
52417
52446
|
expression = factory.createNumericLiteral(+symbolName2);
|
|
52418
52447
|
}
|
|
52419
52448
|
if (!expression) {
|
|
52420
|
-
|
|
52421
|
-
|
|
52449
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
|
|
52450
|
+
if (typeParameterNodes)
|
|
52451
|
+
setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
|
|
52452
|
+
identifier.symbol = symbol2;
|
|
52453
|
+
expression = identifier;
|
|
52422
52454
|
}
|
|
52423
52455
|
return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression);
|
|
52424
52456
|
}
|
|
@@ -65933,19 +65965,22 @@ function createTypeChecker(host) {
|
|
|
65933
65965
|
break;
|
|
65934
65966
|
case 166 /* Parameter */:
|
|
65935
65967
|
const param = declaration;
|
|
65936
|
-
if (isIdentifier(param.name)
|
|
65937
|
-
param
|
|
65938
|
-
param.
|
|
65939
|
-
|
|
65940
|
-
|
|
65941
|
-
|
|
65942
|
-
|
|
65943
|
-
|
|
65944
|
-
|
|
65945
|
-
|
|
65946
|
-
|
|
65947
|
-
|
|
65948
|
-
|
|
65968
|
+
if (isIdentifier(param.name)) {
|
|
65969
|
+
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
65970
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
|
|
65971
|
+
param,
|
|
65972
|
+
param.name.escapedText,
|
|
65973
|
+
788968 /* Type */,
|
|
65974
|
+
void 0,
|
|
65975
|
+
param.name.escapedText,
|
|
65976
|
+
/*isUse*/
|
|
65977
|
+
true
|
|
65978
|
+
) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) {
|
|
65979
|
+
const newName = "arg" + param.parent.parameters.indexOf(param);
|
|
65980
|
+
const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
|
|
65981
|
+
errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
|
|
65982
|
+
return;
|
|
65983
|
+
}
|
|
65949
65984
|
}
|
|
65950
65985
|
diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
|
|
65951
65986
|
break;
|
|
@@ -66133,6 +66168,10 @@ function createTypeChecker(host) {
|
|
|
66133
66168
|
function isTypeParameterAtTopLevel(type, typeParameter) {
|
|
66134
66169
|
return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter));
|
|
66135
66170
|
}
|
|
66171
|
+
function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) {
|
|
66172
|
+
const typePredicate = getTypePredicateOfSignature(signature);
|
|
66173
|
+
return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter);
|
|
66174
|
+
}
|
|
66136
66175
|
function createEmptyObjectTypeFromStringLiteral(type) {
|
|
66137
66176
|
const members = createSymbolTable();
|
|
66138
66177
|
forEachType(type, (t) => {
|
|
@@ -67004,7 +67043,7 @@ function createTypeChecker(host) {
|
|
|
67004
67043
|
function getCovariantInference(inference, signature) {
|
|
67005
67044
|
const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
|
|
67006
67045
|
const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
|
|
67007
|
-
const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !
|
|
67046
|
+
const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
|
|
67008
67047
|
const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
|
|
67009
67048
|
const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
|
|
67010
67049
|
return getWidenedType(unwidenedType);
|
|
@@ -77733,8 +77772,11 @@ function createTypeChecker(host) {
|
|
|
77733
77772
|
}
|
|
77734
77773
|
function checkTypeReferenceNode(node) {
|
|
77735
77774
|
checkGrammarTypeArguments(node, node.typeArguments);
|
|
77736
|
-
if (node.kind === 180 /* TypeReference */ &&
|
|
77737
|
-
|
|
77775
|
+
if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
|
|
77776
|
+
const sourceFile = getSourceFileOfNode(node);
|
|
77777
|
+
if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) {
|
|
77778
|
+
grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
|
|
77779
|
+
}
|
|
77738
77780
|
}
|
|
77739
77781
|
forEach(node.typeArguments, checkSourceElement);
|
|
77740
77782
|
const type = getTypeFromTypeReference(node);
|
|
@@ -83343,8 +83385,9 @@ function createTypeChecker(host) {
|
|
|
83343
83385
|
}
|
|
83344
83386
|
}
|
|
83345
83387
|
function getReferencedImportDeclaration(nodeIn) {
|
|
83346
|
-
|
|
83347
|
-
|
|
83388
|
+
const specifier = getIdentifierGeneratedImportReference(nodeIn);
|
|
83389
|
+
if (specifier) {
|
|
83390
|
+
return specifier;
|
|
83348
83391
|
}
|
|
83349
83392
|
const node = getParseTreeNode(nodeIn, isIdentifier);
|
|
83350
83393
|
if (node) {
|
|
@@ -85322,7 +85365,7 @@ function createTypeChecker(host) {
|
|
|
85322
85365
|
}
|
|
85323
85366
|
function checkGrammarNameInLetOrConstDeclarations(name) {
|
|
85324
85367
|
if (name.kind === 79 /* Identifier */) {
|
|
85325
|
-
if (name.
|
|
85368
|
+
if (name.escapedText === "let") {
|
|
85326
85369
|
return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
|
|
85327
85370
|
}
|
|
85328
85371
|
} else {
|
|
@@ -86126,12 +86169,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
|
|
|
86126
86169
|
return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor);
|
|
86127
86170
|
}
|
|
86128
86171
|
var visitEachChildTable = {
|
|
86129
|
-
[79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
86130
|
-
return context.factory.updateIdentifier(
|
|
86131
|
-
node,
|
|
86132
|
-
nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
|
|
86133
|
-
);
|
|
86134
|
-
},
|
|
86135
86172
|
[163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
86136
86173
|
return context.factory.updateQualifiedName(
|
|
86137
86174
|
node,
|
|
@@ -91344,7 +91381,7 @@ function transformClassFields(context) {
|
|
|
91344
91381
|
if (isClassWithConstructorReference) {
|
|
91345
91382
|
enableSubstitutionForClassAliases();
|
|
91346
91383
|
const alias = factory2.cloneNode(temp);
|
|
91347
|
-
alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
91384
|
+
alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
91348
91385
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
91349
91386
|
}
|
|
91350
91387
|
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
@@ -95480,7 +95517,7 @@ function transformJsx(context) {
|
|
|
95480
95517
|
factory2.createIdentifier(name),
|
|
95481
95518
|
generatedName
|
|
95482
95519
|
);
|
|
95483
|
-
generatedName
|
|
95520
|
+
setIdentifierGeneratedImportReference(generatedName, specifier);
|
|
95484
95521
|
specifierSourceImports.set(name, specifier);
|
|
95485
95522
|
return generatedName;
|
|
95486
95523
|
}
|
|
@@ -96623,7 +96660,7 @@ function transformES2015(context) {
|
|
|
96623
96660
|
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments"));
|
|
96624
96661
|
}
|
|
96625
96662
|
}
|
|
96626
|
-
if (node.
|
|
96663
|
+
if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
|
|
96627
96664
|
return setOriginalNode(setTextRange(
|
|
96628
96665
|
factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
|
|
96629
96666
|
node
|
|
@@ -99504,7 +99541,7 @@ function transformES5(context) {
|
|
|
99504
99541
|
return node;
|
|
99505
99542
|
}
|
|
99506
99543
|
function trySubstituteReservedName(name) {
|
|
99507
|
-
const token =
|
|
99544
|
+
const token = identifierToKeywordKind(name);
|
|
99508
99545
|
if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) {
|
|
99509
99546
|
return setTextRange(factory2.createStringLiteralFromNode(name), name);
|
|
99510
99547
|
}
|
|
@@ -103172,7 +103209,7 @@ function transformModule(context) {
|
|
|
103172
103209
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
103173
103210
|
}
|
|
103174
103211
|
return node;
|
|
103175
|
-
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
103212
|
+
} else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
103176
103213
|
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
|
|
103177
103214
|
if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
|
|
103178
103215
|
return setTextRange(
|
|
@@ -109136,7 +109173,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
109136
109173
|
/*includeTrivia*/
|
|
109137
109174
|
false
|
|
109138
109175
|
), node.symbol);
|
|
109139
|
-
emitList(node, node
|
|
109176
|
+
emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */);
|
|
109140
109177
|
}
|
|
109141
109178
|
function emitPrivateIdentifier(node) {
|
|
109142
109179
|
write(getTextOfNode2(
|
|
@@ -111854,10 +111891,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111854
111891
|
}
|
|
111855
111892
|
}
|
|
111856
111893
|
function generateName(name) {
|
|
111857
|
-
|
|
111858
|
-
|
|
111894
|
+
const autoGenerate = name.emitNode.autoGenerate;
|
|
111895
|
+
if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
|
|
111896
|
+
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix);
|
|
111859
111897
|
} else {
|
|
111860
|
-
const autoGenerateId =
|
|
111898
|
+
const autoGenerateId = autoGenerate.id;
|
|
111861
111899
|
return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
|
|
111862
111900
|
}
|
|
111863
111901
|
}
|
|
@@ -112137,16 +112175,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112137
112175
|
}
|
|
112138
112176
|
}
|
|
112139
112177
|
function makeName(name) {
|
|
112140
|
-
const
|
|
112141
|
-
const
|
|
112142
|
-
|
|
112178
|
+
const autoGenerate = name.emitNode.autoGenerate;
|
|
112179
|
+
const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName);
|
|
112180
|
+
const suffix = formatGeneratedNamePart(autoGenerate.suffix);
|
|
112181
|
+
switch (autoGenerate.flags & 7 /* KindMask */) {
|
|
112143
112182
|
case 1 /* Auto */:
|
|
112144
|
-
return makeTempVariableName(TempFlags.Auto, !!(
|
|
112183
|
+
return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
|
|
112145
112184
|
case 2 /* Loop */:
|
|
112146
112185
|
Debug.assertNode(name, isIdentifier);
|
|
112147
112186
|
return makeTempVariableName(
|
|
112148
112187
|
TempFlags._i,
|
|
112149
|
-
!!(
|
|
112188
|
+
!!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
112150
112189
|
/*privateName*/
|
|
112151
112190
|
false,
|
|
112152
112191
|
prefix,
|
|
@@ -112155,16 +112194,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112155
112194
|
case 3 /* Unique */:
|
|
112156
112195
|
return makeUniqueName2(
|
|
112157
112196
|
idText(name),
|
|
112158
|
-
|
|
112159
|
-
!!(
|
|
112160
|
-
!!(
|
|
112197
|
+
autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
|
|
112198
|
+
!!(autoGenerate.flags & 16 /* Optimistic */),
|
|
112199
|
+
!!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
112161
112200
|
isPrivateIdentifier(name),
|
|
112162
112201
|
prefix,
|
|
112163
112202
|
suffix
|
|
112164
112203
|
);
|
|
112165
112204
|
}
|
|
112166
112205
|
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(
|
|
112167
|
-
|
|
112206
|
+
autoGenerate.flags & 7 /* KindMask */,
|
|
112168
112207
|
GeneratedIdentifierFlags,
|
|
112169
112208
|
/*isFlags*/
|
|
112170
112209
|
true
|
|
@@ -123399,6 +123438,7 @@ __export(ts_exports3, {
|
|
|
123399
123438
|
addEmitHelper: () => addEmitHelper,
|
|
123400
123439
|
addEmitHelpers: () => addEmitHelpers,
|
|
123401
123440
|
addNodeFactoryPatcher: () => addNodeFactoryPatcher,
|
|
123441
|
+
addObjectAllocatorPatcher: () => addObjectAllocatorPatcher,
|
|
123402
123442
|
addRange: () => addRange,
|
|
123403
123443
|
addRelatedInfo: () => addRelatedInfo,
|
|
123404
123444
|
addSyntheticLeadingComment: () => addSyntheticLeadingComment,
|
|
@@ -124167,6 +124207,9 @@ __export(ts_exports3, {
|
|
|
124167
124207
|
getGeneratedNameForNode: () => getGeneratedNameForNode,
|
|
124168
124208
|
getHeritageClause: () => getHeritageClause,
|
|
124169
124209
|
getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc,
|
|
124210
|
+
getIdentifierAutoGenerate: () => getIdentifierAutoGenerate,
|
|
124211
|
+
getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
|
|
124212
|
+
getIdentifierTypeArguments: () => getIdentifierTypeArguments,
|
|
124170
124213
|
getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
|
|
124171
124214
|
getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
|
|
124172
124215
|
getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
|
|
@@ -124500,6 +124543,7 @@ __export(ts_exports3, {
|
|
|
124500
124543
|
hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames,
|
|
124501
124544
|
idText: () => idText,
|
|
124502
124545
|
identifierIsThisKeyword: () => identifierIsThisKeyword,
|
|
124546
|
+
identifierToKeywordKind: () => identifierToKeywordKind,
|
|
124503
124547
|
identity: () => identity,
|
|
124504
124548
|
identitySourceMapConsumer: () => identitySourceMapConsumer,
|
|
124505
124549
|
ignoreSourceNewlines: () => ignoreSourceNewlines,
|
|
@@ -125389,6 +125433,7 @@ __export(ts_exports3, {
|
|
|
125389
125433
|
sameMap: () => sameMap,
|
|
125390
125434
|
sameMapping: () => sameMapping,
|
|
125391
125435
|
scanShebangTrivia: () => scanShebangTrivia,
|
|
125436
|
+
scanTokenAtPosition: () => scanTokenAtPosition,
|
|
125392
125437
|
scanner: () => scanner,
|
|
125393
125438
|
screenStartingMessageCodes: () => screenStartingMessageCodes,
|
|
125394
125439
|
semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations,
|
|
@@ -125401,6 +125446,9 @@ __export(ts_exports3, {
|
|
|
125401
125446
|
setEachParent: () => setEachParent,
|
|
125402
125447
|
setEmitFlags: () => setEmitFlags,
|
|
125403
125448
|
setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned,
|
|
125449
|
+
setIdentifierAutoGenerate: () => setIdentifierAutoGenerate,
|
|
125450
|
+
setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference,
|
|
125451
|
+
setIdentifierTypeArguments: () => setIdentifierTypeArguments,
|
|
125404
125452
|
setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages,
|
|
125405
125453
|
setModuleDefaultHelper: () => setModuleDefaultHelper,
|
|
125406
125454
|
setNodeFlags: () => setNodeFlags,
|
|
@@ -139078,8 +139126,8 @@ function convertFileToEsModule(sourceFile, checker, changes, target, quotePrefer
|
|
|
139078
139126
|
function collectExportRenames(sourceFile, checker, identifiers) {
|
|
139079
139127
|
const res = /* @__PURE__ */ new Map();
|
|
139080
139128
|
forEachExportReference(sourceFile, (node) => {
|
|
139081
|
-
const { text
|
|
139082
|
-
if (!res.has(text) && (
|
|
139129
|
+
const { text } = node.name;
|
|
139130
|
+
if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName(
|
|
139083
139131
|
text,
|
|
139084
139132
|
node,
|
|
139085
139133
|
111551 /* Value */,
|
|
@@ -147681,8 +147729,11 @@ function isModifierLike2(node) {
|
|
|
147681
147729
|
if (isModifier(node)) {
|
|
147682
147730
|
return node.kind;
|
|
147683
147731
|
}
|
|
147684
|
-
if (isIdentifier(node)
|
|
147685
|
-
|
|
147732
|
+
if (isIdentifier(node)) {
|
|
147733
|
+
const originalKeywordKind = identifierToKeywordKind(node);
|
|
147734
|
+
if (originalKeywordKind && isModifierKind(originalKeywordKind)) {
|
|
147735
|
+
return originalKeywordKind;
|
|
147736
|
+
}
|
|
147686
147737
|
}
|
|
147687
147738
|
return void 0;
|
|
147688
147739
|
}
|
|
@@ -149881,7 +149932,8 @@ function isFunctionLikeBodyKeyword(kind) {
|
|
|
149881
149932
|
return kind === 132 /* AsyncKeyword */ || kind === 133 /* AwaitKeyword */ || kind === 128 /* AsKeyword */ || kind === 150 /* SatisfiesKeyword */ || kind === 154 /* TypeKeyword */ || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
|
|
149882
149933
|
}
|
|
149883
149934
|
function keywordForNode(node) {
|
|
149884
|
-
|
|
149935
|
+
var _a2;
|
|
149936
|
+
return isIdentifier(node) ? (_a2 = identifierToKeywordKind(node)) != null ? _a2 : 0 /* Unknown */ : node.kind;
|
|
149885
149937
|
}
|
|
149886
149938
|
function getContextualKeywords(contextToken, position) {
|
|
149887
149939
|
const entries = [];
|
|
@@ -149927,6 +149979,7 @@ function getPropertiesForCompletion(type, checker) {
|
|
|
149927
149979
|
return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
|
|
149928
149980
|
}
|
|
149929
149981
|
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
|
|
149982
|
+
var _a2;
|
|
149930
149983
|
switch (location.kind) {
|
|
149931
149984
|
case 353 /* SyntaxList */:
|
|
149932
149985
|
return tryCast(location.parent, isObjectTypeDeclaration);
|
|
@@ -149937,8 +149990,8 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken
|
|
|
149937
149990
|
}
|
|
149938
149991
|
break;
|
|
149939
149992
|
case 79 /* Identifier */: {
|
|
149940
|
-
const originalKeywordKind = location
|
|
149941
|
-
if (originalKeywordKind
|
|
149993
|
+
const originalKeywordKind = identifierToKeywordKind(location);
|
|
149994
|
+
if (originalKeywordKind) {
|
|
149942
149995
|
return void 0;
|
|
149943
149996
|
}
|
|
149944
149997
|
if (isPropertyDeclaration(location.parent) && location.parent.initializer === location) {
|
|
@@ -149971,7 +150024,7 @@ function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken
|
|
|
149971
150024
|
return void 0;
|
|
149972
150025
|
}
|
|
149973
150026
|
const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword;
|
|
149974
|
-
return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword(
|
|
150027
|
+
return isValidKeyword(contextToken.kind) || contextToken.kind === 41 /* AsteriskToken */ || isIdentifier(contextToken) && isValidKeyword((_a2 = identifierToKeywordKind(contextToken)) != null ? _a2 : 0 /* Unknown */) ? contextToken.parent.parent : void 0;
|
|
149975
150028
|
}
|
|
149976
150029
|
}
|
|
149977
150030
|
function tryGetTypeLiteralNode(node) {
|
|
@@ -152908,7 +152961,7 @@ var Core;
|
|
|
152908
152961
|
}
|
|
152909
152962
|
}
|
|
152910
152963
|
if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) {
|
|
152911
|
-
const isDefaultExport = referenceLocation.
|
|
152964
|
+
const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default";
|
|
152912
152965
|
const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */;
|
|
152913
152966
|
const exportSymbol = Debug.checkDefined(exportSpecifier.symbol);
|
|
152914
152967
|
const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker);
|
|
@@ -159655,7 +159708,7 @@ function extractConstantInScope(node, scope, { substitutions }, rangeFacts, cont
|
|
|
159655
159708
|
111551 /* Value */,
|
|
159656
159709
|
/*excludeGlobals*/
|
|
159657
159710
|
false
|
|
159658
|
-
) && !isPrivateIdentifier(node.name) && !
|
|
159711
|
+
) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file);
|
|
159659
159712
|
const isJS = isInJSFile(scope);
|
|
159660
159713
|
let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */);
|
|
159661
159714
|
let initializer = transformConstantInitializer(skipParentheses(node), substitutions);
|
|
@@ -160525,7 +160578,7 @@ function getRenameInfoForNode(node, typeChecker, sourceFile, program, preference
|
|
|
160525
160578
|
if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) {
|
|
160526
160579
|
return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
|
|
160527
160580
|
}
|
|
160528
|
-
if (isIdentifier(node) && node.
|
|
160581
|
+
if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536 /* Module */) {
|
|
160529
160582
|
return void 0;
|
|
160530
160583
|
}
|
|
160531
160584
|
if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) {
|
|
@@ -162733,7 +162786,6 @@ function updateJSDocHost(parent2) {
|
|
|
162733
162786
|
}
|
|
162734
162787
|
const jsDocNode = parent2.parent.kind === 169 /* PropertyDeclaration */ ? parent2.parent : parent2.parent.parent;
|
|
162735
162788
|
jsDocNode.jsDoc = parent2.jsDoc;
|
|
162736
|
-
jsDocNode.jsDocCache = parent2.jsDocCache;
|
|
162737
162789
|
return jsDocNode;
|
|
162738
162790
|
}
|
|
162739
162791
|
function tryMergeJsdocTags(oldTag, newTag) {
|
|
@@ -166111,7 +166163,7 @@ function createDeprecation(name, options = {}) {
|
|
|
166111
166163
|
const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter;
|
|
166112
166164
|
const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter;
|
|
166113
166165
|
const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter;
|
|
166114
|
-
const error = options.error || errorAfter && version2.compareTo(errorAfter)
|
|
166166
|
+
const error = options.error || errorAfter && version2.compareTo(errorAfter) >= 0;
|
|
166115
166167
|
const warn = !warnAfter || version2.compareTo(warnAfter) >= 0;
|
|
166116
166168
|
return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop;
|
|
166117
166169
|
}
|
|
@@ -166488,8 +166540,6 @@ var createToken = deprecate(function createToken2(kind) {
|
|
|
166488
166540
|
var createIdentifier = deprecate(function createIdentifier2(text) {
|
|
166489
166541
|
return factory.createIdentifier(
|
|
166490
166542
|
text,
|
|
166491
|
-
/*typeArguments*/
|
|
166492
|
-
void 0,
|
|
166493
166543
|
/*originalKeywordKind*/
|
|
166494
166544
|
void 0
|
|
166495
166545
|
);
|
|
@@ -167442,6 +167492,37 @@ function patchNodeFactory4(factory2) {
|
|
|
167442
167492
|
addNodeFactoryPatcher(patchNodeFactory4);
|
|
167443
167493
|
patchNodeFactory4(factory);
|
|
167444
167494
|
|
|
167495
|
+
// src/deprecatedCompat/5.0/identifierProperties.ts
|
|
167496
|
+
addObjectAllocatorPatcher((objectAllocator2) => {
|
|
167497
|
+
const Identifier75 = objectAllocator2.getIdentifierConstructor();
|
|
167498
|
+
if (!hasProperty(Identifier75.prototype, "originalKeywordKind")) {
|
|
167499
|
+
Object.defineProperty(Identifier75.prototype, "originalKeywordKind", {
|
|
167500
|
+
get: deprecate(function() {
|
|
167501
|
+
return identifierToKeywordKind(this);
|
|
167502
|
+
}, {
|
|
167503
|
+
name: "originalKeywordKind",
|
|
167504
|
+
since: "5.0",
|
|
167505
|
+
warnAfter: "5.1",
|
|
167506
|
+
errorAfter: "5.2",
|
|
167507
|
+
message: "Use 'identifierToKeywordKind(identifier)' instead."
|
|
167508
|
+
})
|
|
167509
|
+
});
|
|
167510
|
+
}
|
|
167511
|
+
if (!hasProperty(Identifier75.prototype, "isInJSDocNamespace")) {
|
|
167512
|
+
Object.defineProperty(Identifier75.prototype, "isInJSDocNamespace", {
|
|
167513
|
+
get: deprecate(function() {
|
|
167514
|
+
return this.flags & 2048 /* IdentifierIsInJSDocNamespace */ ? true : void 0;
|
|
167515
|
+
}, {
|
|
167516
|
+
name: "isInJSDocNamespace",
|
|
167517
|
+
since: "5.0",
|
|
167518
|
+
warnAfter: "5.1",
|
|
167519
|
+
errorAfter: "5.2",
|
|
167520
|
+
message: "Use '.parent' or the surrounding context to determine this instead."
|
|
167521
|
+
})
|
|
167522
|
+
});
|
|
167523
|
+
}
|
|
167524
|
+
});
|
|
167525
|
+
|
|
167445
167526
|
// src/server/utilitiesPublic.ts
|
|
167446
167527
|
var LogLevel2 = /* @__PURE__ */ ((LogLevel3) => {
|
|
167447
167528
|
LogLevel3[LogLevel3["terse"] = 0] = "terse";
|
|
@@ -178994,6 +179075,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
178994
179075
|
addEmitHelper,
|
|
178995
179076
|
addEmitHelpers,
|
|
178996
179077
|
addNodeFactoryPatcher,
|
|
179078
|
+
addObjectAllocatorPatcher,
|
|
178997
179079
|
addRange,
|
|
178998
179080
|
addRelatedInfo,
|
|
178999
179081
|
addSyntheticLeadingComment,
|
|
@@ -179762,6 +179844,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
179762
179844
|
getGeneratedNameForNode,
|
|
179763
179845
|
getHeritageClause,
|
|
179764
179846
|
getHostSignatureFromJSDoc,
|
|
179847
|
+
getIdentifierAutoGenerate,
|
|
179848
|
+
getIdentifierGeneratedImportReference,
|
|
179849
|
+
getIdentifierTypeArguments,
|
|
179765
179850
|
getImmediatelyInvokedFunctionExpression,
|
|
179766
179851
|
getImpliedNodeFormatForFile,
|
|
179767
179852
|
getImpliedNodeFormatForFileWorker,
|
|
@@ -180095,6 +180180,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180095
180180
|
hostUsesCaseSensitiveFileNames,
|
|
180096
180181
|
idText,
|
|
180097
180182
|
identifierIsThisKeyword,
|
|
180183
|
+
identifierToKeywordKind,
|
|
180098
180184
|
identity,
|
|
180099
180185
|
identitySourceMapConsumer,
|
|
180100
180186
|
ignoreSourceNewlines,
|
|
@@ -180984,6 +181070,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180984
181070
|
sameMap,
|
|
180985
181071
|
sameMapping,
|
|
180986
181072
|
scanShebangTrivia,
|
|
181073
|
+
scanTokenAtPosition,
|
|
180987
181074
|
scanner,
|
|
180988
181075
|
screenStartingMessageCodes,
|
|
180989
181076
|
semanticDiagnosticsOptionDeclarations,
|
|
@@ -180996,6 +181083,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180996
181083
|
setEachParent,
|
|
180997
181084
|
setEmitFlags,
|
|
180998
181085
|
setGetSourceFileAsHashVersioned,
|
|
181086
|
+
setIdentifierAutoGenerate,
|
|
181087
|
+
setIdentifierGeneratedImportReference,
|
|
181088
|
+
setIdentifierTypeArguments,
|
|
180999
181089
|
setLocalizedDiagnosticMessages,
|
|
181000
181090
|
setModuleDefaultHelper,
|
|
181001
181091
|
setNodeFlags,
|