typescript 5.5.0-dev.20240530 → 5.5.0-dev.20240601
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 +529 -143
- package/lib/typescript.js +551 -190
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -260,6 +260,7 @@ __export(typescript_exports, {
|
|
|
260
260
|
canHaveModifiers: () => canHaveModifiers,
|
|
261
261
|
canHaveModuleSpecifier: () => canHaveModuleSpecifier,
|
|
262
262
|
canHaveSymbol: () => canHaveSymbol,
|
|
263
|
+
canIncludeBindAndCheckDiagnsotics: () => canIncludeBindAndCheckDiagnsotics,
|
|
263
264
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
264
265
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
265
266
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
@@ -2370,7 +2371,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2370
2371
|
|
|
2371
2372
|
// src/compiler/corePublic.ts
|
|
2372
2373
|
var versionMajorMinor = "5.5";
|
|
2373
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2374
|
+
var version = `${versionMajorMinor}.0-dev.20240601`;
|
|
2374
2375
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2375
2376
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2376
2377
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4252,6 +4253,15 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4252
4253
|
);
|
|
4253
4254
|
}
|
|
4254
4255
|
Debug2.formatNodeFlags = formatNodeFlags;
|
|
4256
|
+
function formatNodeCheckFlags(flags) {
|
|
4257
|
+
return formatEnum(
|
|
4258
|
+
flags,
|
|
4259
|
+
NodeCheckFlags,
|
|
4260
|
+
/*isFlags*/
|
|
4261
|
+
true
|
|
4262
|
+
);
|
|
4263
|
+
}
|
|
4264
|
+
Debug2.formatNodeCheckFlags = formatNodeCheckFlags;
|
|
4255
4265
|
function formatModifierFlags(flags) {
|
|
4256
4266
|
return formatEnum(
|
|
4257
4267
|
flags,
|
|
@@ -6544,32 +6554,33 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6544
6554
|
InternalSymbolName2["ImportAttributes"] = "__importAttributes";
|
|
6545
6555
|
return InternalSymbolName2;
|
|
6546
6556
|
})(InternalSymbolName || {});
|
|
6547
|
-
var NodeCheckFlags = /* @__PURE__ */ ((
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6557
|
+
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags3) => {
|
|
6558
|
+
NodeCheckFlags3[NodeCheckFlags3["None"] = 0] = "None";
|
|
6559
|
+
NodeCheckFlags3[NodeCheckFlags3["TypeChecked"] = 1] = "TypeChecked";
|
|
6560
|
+
NodeCheckFlags3[NodeCheckFlags3["LexicalThis"] = 2] = "LexicalThis";
|
|
6561
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureThis"] = 4] = "CaptureThis";
|
|
6562
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureNewTarget"] = 8] = "CaptureNewTarget";
|
|
6563
|
+
NodeCheckFlags3[NodeCheckFlags3["SuperInstance"] = 16] = "SuperInstance";
|
|
6564
|
+
NodeCheckFlags3[NodeCheckFlags3["SuperStatic"] = 32] = "SuperStatic";
|
|
6565
|
+
NodeCheckFlags3[NodeCheckFlags3["ContextChecked"] = 64] = "ContextChecked";
|
|
6566
|
+
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync";
|
|
6567
|
+
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
6568
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureArguments"] = 512] = "CaptureArguments";
|
|
6569
|
+
NodeCheckFlags3[NodeCheckFlags3["EnumValuesComputed"] = 1024] = "EnumValuesComputed";
|
|
6570
|
+
NodeCheckFlags3[NodeCheckFlags3["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass";
|
|
6571
|
+
NodeCheckFlags3[NodeCheckFlags3["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding";
|
|
6572
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
6573
|
+
NodeCheckFlags3[NodeCheckFlags3["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
6574
|
+
NodeCheckFlags3[NodeCheckFlags3["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
6575
|
+
NodeCheckFlags3[NodeCheckFlags3["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
|
|
6576
|
+
NodeCheckFlags3[NodeCheckFlags3["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
|
|
6577
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
|
|
6578
|
+
NodeCheckFlags3[NodeCheckFlags3["ConstructorReference"] = 536870912] = "ConstructorReference";
|
|
6579
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
6580
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
6581
|
+
NodeCheckFlags3[NodeCheckFlags3["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
6582
|
+
NodeCheckFlags3[NodeCheckFlags3["LazyFlags"] = 539358128] = "LazyFlags";
|
|
6583
|
+
return NodeCheckFlags3;
|
|
6573
6584
|
})(NodeCheckFlags || {});
|
|
6574
6585
|
var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
6575
6586
|
TypeFlags2[TypeFlags2["Any"] = 1] = "Any";
|
|
@@ -13391,7 +13402,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13391
13402
|
pos++;
|
|
13392
13403
|
let regExpFlags = 0 /* None */;
|
|
13393
13404
|
while (true) {
|
|
13394
|
-
const ch =
|
|
13405
|
+
const ch = charCodeChecked(pos);
|
|
13395
13406
|
if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
|
|
13396
13407
|
break;
|
|
13397
13408
|
}
|
|
@@ -14642,10 +14653,10 @@ var binaryUnicodeProperties = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit
|
|
|
14642
14653
|
var binaryUnicodePropertiesOfStrings = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]);
|
|
14643
14654
|
var valuesOfNonBinaryUnicodeProperties = {
|
|
14644
14655
|
General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]),
|
|
14645
|
-
Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "
|
|
14646
|
-
Script_Extensions:
|
|
14647
|
-
// Currently empty
|
|
14656
|
+
Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]),
|
|
14657
|
+
Script_Extensions: void 0
|
|
14648
14658
|
};
|
|
14659
|
+
valuesOfNonBinaryUnicodeProperties.Script_Extensions = valuesOfNonBinaryUnicodeProperties.Script;
|
|
14649
14660
|
|
|
14650
14661
|
// src/compiler/utilitiesPublic.ts
|
|
14651
14662
|
function isExternalModuleNameRelative(moduleName) {
|
|
@@ -17504,6 +17515,26 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
17504
17515
|
const pos2 = skipTrivia(sourceFile.text, node.tagName.pos);
|
|
17505
17516
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
17506
17517
|
}
|
|
17518
|
+
case 176 /* Constructor */: {
|
|
17519
|
+
const constructorDeclaration = node;
|
|
17520
|
+
const start = skipTrivia(sourceFile.text, constructorDeclaration.pos);
|
|
17521
|
+
const scanner2 = createScanner(
|
|
17522
|
+
sourceFile.languageVersion,
|
|
17523
|
+
/*skipTrivia*/
|
|
17524
|
+
true,
|
|
17525
|
+
sourceFile.languageVariant,
|
|
17526
|
+
sourceFile.text,
|
|
17527
|
+
/*onError*/
|
|
17528
|
+
void 0,
|
|
17529
|
+
start
|
|
17530
|
+
);
|
|
17531
|
+
let token = scanner2.scan();
|
|
17532
|
+
while (token !== 137 /* ConstructorKeyword */ && token !== 1 /* EndOfFileToken */) {
|
|
17533
|
+
token = scanner2.scan();
|
|
17534
|
+
}
|
|
17535
|
+
const end = scanner2.getTokenEnd();
|
|
17536
|
+
return createTextSpanFromBounds(start, end);
|
|
17537
|
+
}
|
|
17507
17538
|
}
|
|
17508
17539
|
if (errorNode === void 0) {
|
|
17509
17540
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -22501,7 +22532,15 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
|
22501
22532
|
return { pos, end };
|
|
22502
22533
|
}
|
|
22503
22534
|
function skipTypeChecking(sourceFile, options, host) {
|
|
22504
|
-
return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);
|
|
22535
|
+
return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnsotics(sourceFile, options);
|
|
22536
|
+
}
|
|
22537
|
+
function canIncludeBindAndCheckDiagnsotics(sourceFile, options) {
|
|
22538
|
+
if (!!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false) return false;
|
|
22539
|
+
if (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */ || sourceFile.scriptKind === 5 /* External */) return true;
|
|
22540
|
+
const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
22541
|
+
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
|
|
22542
|
+
const isPlainJs = isPlainJsFile(sourceFile, options.checkJs);
|
|
22543
|
+
return isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */;
|
|
22505
22544
|
}
|
|
22506
22545
|
function isJsonEqual(a, b) {
|
|
22507
22546
|
return a === b || typeof a === "object" && a !== null && typeof b === "object" && b !== null && equalOwnProperties(a, b, isJsonEqual);
|
|
@@ -40337,7 +40376,7 @@ var commandOptionsWithoutBuild = [
|
|
|
40337
40376
|
showInSimplifiedHelpView: false,
|
|
40338
40377
|
category: Diagnostics.Compiler_Diagnostics,
|
|
40339
40378
|
description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
|
|
40340
|
-
transpileOptionValue:
|
|
40379
|
+
transpileOptionValue: true,
|
|
40341
40380
|
defaultValueDescription: false,
|
|
40342
40381
|
affectsSemanticDiagnostics: true,
|
|
40343
40382
|
affectsBuildInfo: true,
|
|
@@ -50132,6 +50171,7 @@ function createTypeChecker(host) {
|
|
|
50132
50171
|
getImmediateAliasedSymbol,
|
|
50133
50172
|
getAliasedSymbol: resolveAlias,
|
|
50134
50173
|
getEmitResolver,
|
|
50174
|
+
requiresAddingImplicitUndefined,
|
|
50135
50175
|
getExportsOfModule: getExportsOfModuleAsArray,
|
|
50136
50176
|
getExportsAndPropertiesOfModule,
|
|
50137
50177
|
forEachExportAndPropertyOfModule,
|
|
@@ -52480,10 +52520,22 @@ function createTypeChecker(host) {
|
|
|
52480
52520
|
return !!aliasDeclarationLinks.typeOnlyDeclaration;
|
|
52481
52521
|
}
|
|
52482
52522
|
function getTypeOnlyAliasDeclaration(symbol, include) {
|
|
52523
|
+
var _a;
|
|
52483
52524
|
if (!(symbol.flags & 2097152 /* Alias */)) {
|
|
52484
52525
|
return void 0;
|
|
52485
52526
|
}
|
|
52486
52527
|
const links = getSymbolLinks(symbol);
|
|
52528
|
+
if (links.typeOnlyDeclaration === void 0) {
|
|
52529
|
+
links.typeOnlyDeclaration = false;
|
|
52530
|
+
const resolved = resolveSymbol(symbol);
|
|
52531
|
+
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
52532
|
+
(_a = symbol.declarations) == null ? void 0 : _a[0],
|
|
52533
|
+
getDeclarationOfAliasSymbol(symbol) && getImmediateAliasedSymbol(symbol),
|
|
52534
|
+
resolved,
|
|
52535
|
+
/*overwriteEmpty*/
|
|
52536
|
+
true
|
|
52537
|
+
);
|
|
52538
|
+
}
|
|
52487
52539
|
if (include === void 0) {
|
|
52488
52540
|
return links.typeOnlyDeclaration || void 0;
|
|
52489
52541
|
}
|
|
@@ -54001,7 +54053,7 @@ function createTypeChecker(host) {
|
|
|
54001
54053
|
return noMappedTypes && mappedType !== type ? void 0 : mappedType;
|
|
54002
54054
|
}
|
|
54003
54055
|
function setTextRange2(context, range, location) {
|
|
54004
|
-
if (!nodeIsSynthesized(range)
|
|
54056
|
+
if (!nodeIsSynthesized(range) || !(range.flags & 16 /* Synthesized */) || !context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(getOriginalNode(range))) {
|
|
54005
54057
|
range = factory.cloneNode(range);
|
|
54006
54058
|
}
|
|
54007
54059
|
if (range === location) return range;
|
|
@@ -54940,7 +54992,8 @@ function createTypeChecker(host) {
|
|
|
54940
54992
|
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
54941
54993
|
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
54942
54994
|
typeElements.push(
|
|
54943
|
-
|
|
54995
|
+
setCommentRange2(
|
|
54996
|
+
context,
|
|
54944
54997
|
signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
|
|
54945
54998
|
getterDeclaration
|
|
54946
54999
|
)
|
|
@@ -54948,7 +55001,8 @@ function createTypeChecker(host) {
|
|
|
54948
55001
|
const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
|
|
54949
55002
|
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
|
|
54950
55003
|
typeElements.push(
|
|
54951
|
-
|
|
55004
|
+
setCommentRange2(
|
|
55005
|
+
context,
|
|
54952
55006
|
signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
|
|
54953
55007
|
setterDeclaration
|
|
54954
55008
|
)
|
|
@@ -55006,11 +55060,17 @@ function createTypeChecker(host) {
|
|
|
55006
55060
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
55007
55061
|
}
|
|
55008
55062
|
} else if (propertySymbol.valueDeclaration) {
|
|
55009
|
-
|
|
55063
|
+
setCommentRange2(context, node, propertySymbol.valueDeclaration);
|
|
55010
55064
|
}
|
|
55011
55065
|
return node;
|
|
55012
55066
|
}
|
|
55013
55067
|
}
|
|
55068
|
+
function setCommentRange2(context, node, range) {
|
|
55069
|
+
if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(range)) {
|
|
55070
|
+
return setCommentRange(node, range);
|
|
55071
|
+
}
|
|
55072
|
+
return node;
|
|
55073
|
+
}
|
|
55014
55074
|
function mapToTypeNodes(types, context, isBareList) {
|
|
55015
55075
|
if (some(types)) {
|
|
55016
55076
|
if (checkTruncationLength(context)) {
|
|
@@ -55786,7 +55846,7 @@ function createTypeChecker(host) {
|
|
|
55786
55846
|
return false;
|
|
55787
55847
|
}
|
|
55788
55848
|
function typeParameterToName(type, context) {
|
|
55789
|
-
var _a, _b;
|
|
55849
|
+
var _a, _b, _c, _d;
|
|
55790
55850
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && context.typeParameterNames) {
|
|
55791
55851
|
const cached = context.typeParameterNames.get(getTypeId(type));
|
|
55792
55852
|
if (cached) {
|
|
@@ -55803,11 +55863,15 @@ function createTypeChecker(host) {
|
|
|
55803
55863
|
if (!(result.kind & 80 /* Identifier */)) {
|
|
55804
55864
|
return factory.createIdentifier("(Missing type parameter)");
|
|
55805
55865
|
}
|
|
55866
|
+
const decl = (_b = (_a = type.symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b[0];
|
|
55867
|
+
if (decl && isTypeParameterDeclaration(decl)) {
|
|
55868
|
+
result = setTextRange2(context, result, decl.name);
|
|
55869
|
+
}
|
|
55806
55870
|
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
55807
55871
|
const rawtext = result.escapedText;
|
|
55808
|
-
let i = ((
|
|
55872
|
+
let i = ((_c = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _c.get(rawtext)) || 0;
|
|
55809
55873
|
let text = rawtext;
|
|
55810
|
-
while (((
|
|
55874
|
+
while (((_d = context.typeParameterNamesByText) == null ? void 0 : _d.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
55811
55875
|
i++;
|
|
55812
55876
|
text = `${rawtext}_${i}`;
|
|
55813
55877
|
}
|
|
@@ -56226,21 +56290,136 @@ function createTypeChecker(host) {
|
|
|
56226
56290
|
cancellationToken.throwIfCancellationRequested();
|
|
56227
56291
|
}
|
|
56228
56292
|
let hadError = false;
|
|
56293
|
+
const { finalizeBoundary, startRecoveryScope } = createRecoveryBoundary();
|
|
56229
56294
|
const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode);
|
|
56230
|
-
if (
|
|
56295
|
+
if (!finalizeBoundary()) {
|
|
56231
56296
|
return void 0;
|
|
56232
56297
|
}
|
|
56233
56298
|
context.approximateLength += existing.end - existing.pos;
|
|
56234
56299
|
return transformed;
|
|
56235
56300
|
function visitExistingNodeTreeSymbols(node) {
|
|
56301
|
+
if (hadError) return node;
|
|
56302
|
+
const recover = startRecoveryScope();
|
|
56236
56303
|
const onExitNewScope = isNewScopeNode(node) ? onEnterNewScope(node) : void 0;
|
|
56237
56304
|
const result = visitExistingNodeTreeSymbolsWorker(node);
|
|
56238
56305
|
onExitNewScope == null ? void 0 : onExitNewScope();
|
|
56239
|
-
|
|
56306
|
+
if (hadError) {
|
|
56307
|
+
if (isTypeNode(node) && !isTypePredicateNode(node)) {
|
|
56308
|
+
recover();
|
|
56309
|
+
return serializeExistingTypeNode(context, node);
|
|
56310
|
+
}
|
|
56311
|
+
return node;
|
|
56312
|
+
}
|
|
56313
|
+
return result ? setTextRange2(context, result, node) : void 0;
|
|
56314
|
+
}
|
|
56315
|
+
function createRecoveryBoundary() {
|
|
56316
|
+
let unreportedErrors;
|
|
56317
|
+
const oldTracker = context.tracker;
|
|
56318
|
+
const oldTrackedSymbols = context.trackedSymbols;
|
|
56319
|
+
context.trackedSymbols = [];
|
|
56320
|
+
const oldEncounteredError = context.encounteredError;
|
|
56321
|
+
context.tracker = new SymbolTrackerImpl(context, {
|
|
56322
|
+
...oldTracker.inner,
|
|
56323
|
+
reportCyclicStructureError() {
|
|
56324
|
+
markError(() => oldTracker.reportCyclicStructureError());
|
|
56325
|
+
},
|
|
56326
|
+
reportInaccessibleThisError() {
|
|
56327
|
+
markError(() => oldTracker.reportInaccessibleThisError());
|
|
56328
|
+
},
|
|
56329
|
+
reportInaccessibleUniqueSymbolError() {
|
|
56330
|
+
markError(() => oldTracker.reportInaccessibleUniqueSymbolError());
|
|
56331
|
+
},
|
|
56332
|
+
reportLikelyUnsafeImportRequiredError(specifier) {
|
|
56333
|
+
markError(() => oldTracker.reportLikelyUnsafeImportRequiredError(specifier));
|
|
56334
|
+
},
|
|
56335
|
+
reportNonSerializableProperty(name) {
|
|
56336
|
+
markError(() => oldTracker.reportNonSerializableProperty(name));
|
|
56337
|
+
},
|
|
56338
|
+
trackSymbol(sym, decl, meaning) {
|
|
56339
|
+
const accessibility = isSymbolAccessible(
|
|
56340
|
+
sym,
|
|
56341
|
+
decl,
|
|
56342
|
+
meaning,
|
|
56343
|
+
/*shouldComputeAliasesToMakeVisible*/
|
|
56344
|
+
false
|
|
56345
|
+
);
|
|
56346
|
+
if (accessibility.accessibility !== 0 /* Accessible */) {
|
|
56347
|
+
(context.trackedSymbols ?? (context.trackedSymbols = [])).push([sym, decl, meaning]);
|
|
56348
|
+
return true;
|
|
56349
|
+
}
|
|
56350
|
+
return false;
|
|
56351
|
+
},
|
|
56352
|
+
moduleResolverHost: context.tracker.moduleResolverHost
|
|
56353
|
+
}, context.tracker.moduleResolverHost);
|
|
56354
|
+
return {
|
|
56355
|
+
startRecoveryScope: startRecoveryScope2,
|
|
56356
|
+
finalizeBoundary: finalizeBoundary2
|
|
56357
|
+
};
|
|
56358
|
+
function markError(unreportedError) {
|
|
56359
|
+
hadError = true;
|
|
56360
|
+
(unreportedErrors ?? (unreportedErrors = [])).push(unreportedError);
|
|
56361
|
+
}
|
|
56362
|
+
function startRecoveryScope2() {
|
|
56363
|
+
var _a;
|
|
56364
|
+
const initialTrackedSymbolsTop = ((_a = context.trackedSymbols) == null ? void 0 : _a.length) ?? 0;
|
|
56365
|
+
const unreportedErrorsTop = (unreportedErrors == null ? void 0 : unreportedErrors.length) ?? 0;
|
|
56366
|
+
return () => {
|
|
56367
|
+
hadError = false;
|
|
56368
|
+
if (context.trackedSymbols) {
|
|
56369
|
+
context.trackedSymbols.length = initialTrackedSymbolsTop;
|
|
56370
|
+
}
|
|
56371
|
+
if (unreportedErrors) {
|
|
56372
|
+
unreportedErrors.length = unreportedErrorsTop;
|
|
56373
|
+
}
|
|
56374
|
+
};
|
|
56375
|
+
}
|
|
56376
|
+
function finalizeBoundary2() {
|
|
56377
|
+
context.tracker = oldTracker;
|
|
56378
|
+
const newTrackedSymbols = context.trackedSymbols;
|
|
56379
|
+
context.trackedSymbols = oldTrackedSymbols;
|
|
56380
|
+
context.encounteredError = oldEncounteredError;
|
|
56381
|
+
unreportedErrors == null ? void 0 : unreportedErrors.forEach((fn) => fn());
|
|
56382
|
+
if (hadError) {
|
|
56383
|
+
return false;
|
|
56384
|
+
}
|
|
56385
|
+
newTrackedSymbols == null ? void 0 : newTrackedSymbols.forEach(
|
|
56386
|
+
([symbol, enclosingDeclaration, meaning]) => context.tracker.trackSymbol(
|
|
56387
|
+
symbol,
|
|
56388
|
+
enclosingDeclaration,
|
|
56389
|
+
meaning
|
|
56390
|
+
)
|
|
56391
|
+
);
|
|
56392
|
+
return true;
|
|
56393
|
+
}
|
|
56240
56394
|
}
|
|
56241
56395
|
function onEnterNewScope(node) {
|
|
56242
56396
|
return enterNewScope(context, node, getParametersInScope(node), getTypeParametersInScope(node));
|
|
56243
56397
|
}
|
|
56398
|
+
function tryVisitTypeReference(node) {
|
|
56399
|
+
if (canReuseTypeNode(context, node)) {
|
|
56400
|
+
const { introducesError, node: newName } = trackExistingEntityName(node.typeName, context);
|
|
56401
|
+
const typeArguments = visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode);
|
|
56402
|
+
if (!introducesError) {
|
|
56403
|
+
const updated = factory.updateTypeReferenceNode(
|
|
56404
|
+
node,
|
|
56405
|
+
newName,
|
|
56406
|
+
typeArguments
|
|
56407
|
+
);
|
|
56408
|
+
return setTextRange2(context, updated, node);
|
|
56409
|
+
} else {
|
|
56410
|
+
const serializedName = serializeTypeName(
|
|
56411
|
+
context,
|
|
56412
|
+
node.typeName,
|
|
56413
|
+
/*isTypeOf*/
|
|
56414
|
+
false,
|
|
56415
|
+
typeArguments
|
|
56416
|
+
);
|
|
56417
|
+
if (serializedName) {
|
|
56418
|
+
return setTextRange2(context, serializedName, node.typeName);
|
|
56419
|
+
}
|
|
56420
|
+
}
|
|
56421
|
+
}
|
|
56422
|
+
}
|
|
56244
56423
|
function visitExistingNodeTreeSymbolsWorker(node) {
|
|
56245
56424
|
if (isJSDocTypeExpression(node)) {
|
|
56246
56425
|
return visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode);
|
|
@@ -56337,7 +56516,8 @@ function createTypeChecker(host) {
|
|
|
56337
56516
|
if (canReuseTypeNode(context, node)) {
|
|
56338
56517
|
return node;
|
|
56339
56518
|
}
|
|
56340
|
-
|
|
56519
|
+
hadError = true;
|
|
56520
|
+
return node;
|
|
56341
56521
|
}
|
|
56342
56522
|
if (isTypeParameterDeclaration(node)) {
|
|
56343
56523
|
return factory.updateTypeParameterDeclaration(
|
|
@@ -56348,31 +56528,21 @@ function createTypeChecker(host) {
|
|
|
56348
56528
|
visitNode(node.default, visitExistingNodeTreeSymbols, isTypeNode)
|
|
56349
56529
|
);
|
|
56350
56530
|
}
|
|
56531
|
+
if (isIndexedAccessTypeNode(node) && isTypeReferenceNode(node.objectType)) {
|
|
56532
|
+
const objectType = tryVisitTypeReference(node.objectType);
|
|
56533
|
+
if (!objectType) {
|
|
56534
|
+
hadError = true;
|
|
56535
|
+
return node;
|
|
56536
|
+
}
|
|
56537
|
+
return factory.updateIndexedAccessTypeNode(node, objectType, visitNode(node.indexType, visitExistingNodeTreeSymbols, isTypeNode));
|
|
56538
|
+
}
|
|
56351
56539
|
if (isTypeReferenceNode(node)) {
|
|
56352
|
-
|
|
56353
|
-
|
|
56354
|
-
|
|
56355
|
-
if (!introducesError) {
|
|
56356
|
-
const updated = factory.updateTypeReferenceNode(
|
|
56357
|
-
node,
|
|
56358
|
-
newName,
|
|
56359
|
-
typeArguments
|
|
56360
|
-
);
|
|
56361
|
-
return setTextRange2(context, updated, node);
|
|
56362
|
-
} else {
|
|
56363
|
-
const serializedName = serializeTypeName(
|
|
56364
|
-
context,
|
|
56365
|
-
node.typeName,
|
|
56366
|
-
/*isTypeOf*/
|
|
56367
|
-
false,
|
|
56368
|
-
typeArguments
|
|
56369
|
-
);
|
|
56370
|
-
if (serializedName) {
|
|
56371
|
-
return setTextRange2(context, serializedName, node.typeName);
|
|
56372
|
-
}
|
|
56373
|
-
}
|
|
56540
|
+
const result = tryVisitTypeReference(node);
|
|
56541
|
+
if (result) {
|
|
56542
|
+
return result;
|
|
56374
56543
|
}
|
|
56375
|
-
|
|
56544
|
+
hadError = true;
|
|
56545
|
+
return node;
|
|
56376
56546
|
}
|
|
56377
56547
|
if (isLiteralImportTypeNode(node)) {
|
|
56378
56548
|
const nodeSymbol = getNodeLinks(node).resolvedSymbol;
|
|
@@ -56396,12 +56566,7 @@ function createTypeChecker(host) {
|
|
|
56396
56566
|
}
|
|
56397
56567
|
}
|
|
56398
56568
|
if (isFunctionLike(node) && !node.type || isPropertyDeclaration(node) && !node.type && !node.initializer || isPropertySignature(node) && !node.type && !node.initializer || isParameter(node) && !node.type && !node.initializer) {
|
|
56399
|
-
let visited =
|
|
56400
|
-
node,
|
|
56401
|
-
visitExistingNodeTreeSymbols,
|
|
56402
|
-
/*context*/
|
|
56403
|
-
void 0
|
|
56404
|
-
);
|
|
56569
|
+
let visited = visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
56405
56570
|
if (visited === node) {
|
|
56406
56571
|
visited = setTextRange2(context, factory.cloneNode(node), node);
|
|
56407
56572
|
}
|
|
@@ -56423,7 +56588,8 @@ function createTypeChecker(host) {
|
|
|
56423
56588
|
if (serializedName) {
|
|
56424
56589
|
return setTextRange2(context, serializedName, node.exprName);
|
|
56425
56590
|
}
|
|
56426
|
-
|
|
56591
|
+
hadError = true;
|
|
56592
|
+
return node;
|
|
56427
56593
|
}
|
|
56428
56594
|
return factory.updateTypeQueryNode(
|
|
56429
56595
|
node,
|
|
@@ -56461,12 +56627,7 @@ function createTypeChecker(host) {
|
|
|
56461
56627
|
return factory.updateTypePredicateNode(node, node.assertsModifier, parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
56462
56628
|
}
|
|
56463
56629
|
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
|
|
56464
|
-
const visited =
|
|
56465
|
-
node,
|
|
56466
|
-
visitExistingNodeTreeSymbols,
|
|
56467
|
-
/*context*/
|
|
56468
|
-
void 0
|
|
56469
|
-
);
|
|
56630
|
+
const visited = visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
56470
56631
|
const clone2 = setTextRange2(context, visited === node ? factory.cloneNode(node) : visited, node);
|
|
56471
56632
|
const flags = getEmitFlags(clone2);
|
|
56472
56633
|
setEmitFlags(clone2, flags | (context.flags & 1024 /* MultilineObjectLiterals */ && isTypeLiteralNode(node) ? 0 : 1 /* SingleLine */));
|
|
@@ -56492,17 +56653,46 @@ function createTypeChecker(host) {
|
|
|
56492
56653
|
falseType2
|
|
56493
56654
|
);
|
|
56494
56655
|
}
|
|
56495
|
-
if (isTypeOperatorNode(node)
|
|
56496
|
-
if (
|
|
56497
|
-
|
|
56656
|
+
if (isTypeOperatorNode(node)) {
|
|
56657
|
+
if (node.operator === 158 /* UniqueKeyword */ && node.type.kind === 155 /* SymbolKeyword */) {
|
|
56658
|
+
if (!canReuseTypeNode(context, node)) {
|
|
56659
|
+
hadError = true;
|
|
56660
|
+
return node;
|
|
56661
|
+
}
|
|
56662
|
+
} else if (node.operator === 143 /* KeyOfKeyword */) {
|
|
56663
|
+
if (isTypeReferenceNode(node.type)) {
|
|
56664
|
+
const type = tryVisitTypeReference(node.type);
|
|
56665
|
+
if (!type) {
|
|
56666
|
+
hadError = true;
|
|
56667
|
+
return node;
|
|
56668
|
+
}
|
|
56669
|
+
return factory.updateTypeOperatorNode(node, type);
|
|
56670
|
+
}
|
|
56498
56671
|
}
|
|
56499
56672
|
}
|
|
56500
|
-
return
|
|
56501
|
-
|
|
56502
|
-
|
|
56503
|
-
|
|
56504
|
-
|
|
56505
|
-
|
|
56673
|
+
return visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
56674
|
+
function visitEachChild2(node2, visitor) {
|
|
56675
|
+
const nonlocalNode = !context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(node2);
|
|
56676
|
+
return visitEachChild(
|
|
56677
|
+
node2,
|
|
56678
|
+
visitor,
|
|
56679
|
+
/*context*/
|
|
56680
|
+
void 0,
|
|
56681
|
+
nonlocalNode ? visitNodesWithoutCopyingPositions : void 0
|
|
56682
|
+
);
|
|
56683
|
+
}
|
|
56684
|
+
function visitNodesWithoutCopyingPositions(nodes, visitor, test, start, count) {
|
|
56685
|
+
let result = visitNodes2(nodes, visitor, test, start, count);
|
|
56686
|
+
if (result) {
|
|
56687
|
+
if (result.pos !== -1 || result.end !== -1) {
|
|
56688
|
+
if (result === nodes) {
|
|
56689
|
+
result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
|
|
56690
|
+
}
|
|
56691
|
+
setTextRangePosEnd(result, -1, -1);
|
|
56692
|
+
}
|
|
56693
|
+
}
|
|
56694
|
+
return result;
|
|
56695
|
+
}
|
|
56506
56696
|
function getEffectiveDotDotDotForParameter(p) {
|
|
56507
56697
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
56508
56698
|
}
|
|
@@ -56511,13 +56701,39 @@ function createTypeChecker(host) {
|
|
|
56511
56701
|
}
|
|
56512
56702
|
function rewriteModuleSpecifier(parent2, lit) {
|
|
56513
56703
|
if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
|
|
56514
|
-
|
|
56515
|
-
|
|
56516
|
-
|
|
56517
|
-
|
|
56518
|
-
|
|
56704
|
+
let name = lit.text;
|
|
56705
|
+
const nodeSymbol = getNodeLinks(node).resolvedSymbol;
|
|
56706
|
+
const meaning = parent2.isTypeOf ? 111551 /* Value */ : 788968 /* Type */;
|
|
56707
|
+
const parentSymbol = nodeSymbol && isSymbolAccessible(
|
|
56708
|
+
nodeSymbol,
|
|
56709
|
+
context.enclosingDeclaration,
|
|
56710
|
+
meaning,
|
|
56711
|
+
/*shouldComputeAliasesToMakeVisible*/
|
|
56712
|
+
false
|
|
56713
|
+
).accessibility === 0 /* Accessible */ && lookupSymbolChain(
|
|
56714
|
+
nodeSymbol,
|
|
56715
|
+
context,
|
|
56716
|
+
meaning,
|
|
56717
|
+
/*yieldModuleSymbol*/
|
|
56718
|
+
true
|
|
56719
|
+
)[0];
|
|
56720
|
+
if (parentSymbol && parentSymbol.flags & 1536 /* Module */) {
|
|
56721
|
+
name = getSpecifierForModuleSymbol(parentSymbol, context);
|
|
56722
|
+
} else {
|
|
56723
|
+
const targetFile = getExternalModuleFileFromDeclaration(parent2);
|
|
56724
|
+
if (targetFile) {
|
|
56725
|
+
name = getSpecifierForModuleSymbol(targetFile.symbol, context);
|
|
56519
56726
|
}
|
|
56520
56727
|
}
|
|
56728
|
+
if (name.includes("/node_modules/")) {
|
|
56729
|
+
context.encounteredError = true;
|
|
56730
|
+
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
56731
|
+
context.tracker.reportLikelyUnsafeImportRequiredError(name);
|
|
56732
|
+
}
|
|
56733
|
+
}
|
|
56734
|
+
if (name !== lit.text) {
|
|
56735
|
+
return setOriginalNode(factory.createStringLiteral(name), lit);
|
|
56736
|
+
}
|
|
56521
56737
|
}
|
|
56522
56738
|
return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral);
|
|
56523
56739
|
}
|
|
@@ -61542,7 +61758,16 @@ function createTypeChecker(host) {
|
|
|
61542
61758
|
}
|
|
61543
61759
|
}
|
|
61544
61760
|
function getApparentTypeOfIntersectionType(type, thisArgument) {
|
|
61545
|
-
|
|
61761
|
+
if (type === thisArgument) {
|
|
61762
|
+
return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(
|
|
61763
|
+
type,
|
|
61764
|
+
thisArgument,
|
|
61765
|
+
/*needApparentType*/
|
|
61766
|
+
true
|
|
61767
|
+
));
|
|
61768
|
+
}
|
|
61769
|
+
const key = `I${getTypeId(type)},${getTypeId(thisArgument)}`;
|
|
61770
|
+
return getCachedType(key) ?? setCachedType(key, getTypeWithThisArgument(
|
|
61546
61771
|
type,
|
|
61547
61772
|
thisArgument,
|
|
61548
61773
|
/*needApparentType*/
|
|
@@ -64485,7 +64710,6 @@ function createTypeChecker(host) {
|
|
|
64485
64710
|
return links.resolvedType;
|
|
64486
64711
|
}
|
|
64487
64712
|
function getTemplateLiteralType(texts, types) {
|
|
64488
|
-
var _a, _b;
|
|
64489
64713
|
const unionIndex = findIndex(types, (t) => !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)));
|
|
64490
64714
|
if (unionIndex >= 0) {
|
|
64491
64715
|
return checkCrossProductUnion(types) ? mapType(types[unionIndex], (t) => getTemplateLiteralType(texts, replaceElement(types, unionIndex, t))) : errorType;
|
|
@@ -64493,9 +64717,6 @@ function createTypeChecker(host) {
|
|
|
64493
64717
|
if (contains(types, wildcardType)) {
|
|
64494
64718
|
return wildcardType;
|
|
64495
64719
|
}
|
|
64496
|
-
if (texts.length === 2 && texts[0] === "" && texts[1] === "" && !(types[0].flags & 2944 /* Literal */) && !((_b = (_a = types[0].symbol) == null ? void 0 : _a.declarations) == null ? void 0 : _b.some((d) => d.parent.kind === 195 /* InferType */)) && isTypeAssignableTo(types[0], stringType)) {
|
|
64497
|
-
return types[0];
|
|
64498
|
-
}
|
|
64499
64720
|
const newTypes = [];
|
|
64500
64721
|
const newTexts = [];
|
|
64501
64722
|
let text = texts[0];
|
|
@@ -73920,6 +74141,9 @@ function createTypeChecker(host) {
|
|
|
73920
74141
|
return contextualType && !isGenericType(contextualType);
|
|
73921
74142
|
}
|
|
73922
74143
|
function getNarrowableTypeForReference(type, reference, checkMode) {
|
|
74144
|
+
if (isNoInferType(type)) {
|
|
74145
|
+
type = type.baseType;
|
|
74146
|
+
}
|
|
73923
74147
|
const substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) && someType(type, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
73924
74148
|
return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
|
|
73925
74149
|
}
|
|
@@ -73985,9 +74209,6 @@ function createTypeChecker(host) {
|
|
|
73985
74209
|
if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) {
|
|
73986
74210
|
return markJsxAliasReferenced(location);
|
|
73987
74211
|
}
|
|
73988
|
-
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
73989
|
-
return markAsyncFunctionAliasReferenced(location);
|
|
73990
|
-
}
|
|
73991
74212
|
if (isImportEqualsDeclaration(location)) {
|
|
73992
74213
|
if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) {
|
|
73993
74214
|
return markImportEqualsAliasReferenced(location);
|
|
@@ -73997,6 +74218,9 @@ function createTypeChecker(host) {
|
|
|
73997
74218
|
if (isExportSpecifier(location)) {
|
|
73998
74219
|
return markExportSpecifierAliasReferenced(location);
|
|
73999
74220
|
}
|
|
74221
|
+
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
74222
|
+
markAsyncFunctionAliasReferenced(location);
|
|
74223
|
+
}
|
|
74000
74224
|
if (!compilerOptions.emitDecoratorMetadata) {
|
|
74001
74225
|
return;
|
|
74002
74226
|
}
|
|
@@ -74334,18 +74558,12 @@ function createTypeChecker(host) {
|
|
|
74334
74558
|
}
|
|
74335
74559
|
return type;
|
|
74336
74560
|
}
|
|
74337
|
-
function
|
|
74338
|
-
if (isThisInTypeQuery(node))
|
|
74339
|
-
return checkThisExpression(node);
|
|
74340
|
-
}
|
|
74341
|
-
const symbol = getResolvedSymbol(node);
|
|
74342
|
-
if (symbol === unknownSymbol) {
|
|
74343
|
-
return errorType;
|
|
74344
|
-
}
|
|
74561
|
+
function checkIdentifierCalculateNodeCheckFlags(node, symbol) {
|
|
74562
|
+
if (isThisInTypeQuery(node)) return;
|
|
74345
74563
|
if (symbol === argumentsSymbol) {
|
|
74346
74564
|
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
74347
74565
|
error2(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
|
|
74348
|
-
return
|
|
74566
|
+
return;
|
|
74349
74567
|
}
|
|
74350
74568
|
let container = getContainingFunction(node);
|
|
74351
74569
|
if (container) {
|
|
@@ -74364,17 +74582,14 @@ function createTypeChecker(host) {
|
|
|
74364
74582
|
}
|
|
74365
74583
|
}
|
|
74366
74584
|
}
|
|
74367
|
-
return
|
|
74368
|
-
}
|
|
74369
|
-
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
74370
|
-
markLinkedReferences(node, 1 /* Identifier */);
|
|
74585
|
+
return;
|
|
74371
74586
|
}
|
|
74372
74587
|
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
74373
74588
|
const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node);
|
|
74374
74589
|
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
74375
74590
|
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
74376
74591
|
}
|
|
74377
|
-
|
|
74592
|
+
const declaration = localOrExportSymbol.valueDeclaration;
|
|
74378
74593
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
74379
74594
|
if (isClassLike(declaration) && declaration.name !== node) {
|
|
74380
74595
|
let container = getThisContainer(
|
|
@@ -74401,6 +74616,27 @@ function createTypeChecker(host) {
|
|
|
74401
74616
|
}
|
|
74402
74617
|
}
|
|
74403
74618
|
checkNestedBlockScopedBinding(node, symbol);
|
|
74619
|
+
}
|
|
74620
|
+
function checkIdentifier(node, checkMode) {
|
|
74621
|
+
if (isThisInTypeQuery(node)) {
|
|
74622
|
+
return checkThisExpression(node);
|
|
74623
|
+
}
|
|
74624
|
+
const symbol = getResolvedSymbol(node);
|
|
74625
|
+
if (symbol === unknownSymbol) {
|
|
74626
|
+
return errorType;
|
|
74627
|
+
}
|
|
74628
|
+
checkIdentifierCalculateNodeCheckFlags(node, symbol);
|
|
74629
|
+
if (symbol === argumentsSymbol) {
|
|
74630
|
+
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
74631
|
+
return errorType;
|
|
74632
|
+
}
|
|
74633
|
+
return getTypeOfSymbol(symbol);
|
|
74634
|
+
}
|
|
74635
|
+
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
74636
|
+
markLinkedReferences(node, 1 /* Identifier */);
|
|
74637
|
+
}
|
|
74638
|
+
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
74639
|
+
let declaration = localOrExportSymbol.valueDeclaration;
|
|
74404
74640
|
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
|
|
74405
74641
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
74406
74642
|
if (assignmentKind) {
|
|
@@ -89411,7 +89647,6 @@ function createTypeChecker(host) {
|
|
|
89411
89647
|
if (links.isDeclarationWithCollidingName === void 0) {
|
|
89412
89648
|
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
|
|
89413
89649
|
if (isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) {
|
|
89414
|
-
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
89415
89650
|
if (resolveName(
|
|
89416
89651
|
container.parent,
|
|
89417
89652
|
symbol.escapedName,
|
|
@@ -89422,8 +89657,8 @@ function createTypeChecker(host) {
|
|
|
89422
89657
|
false
|
|
89423
89658
|
)) {
|
|
89424
89659
|
links.isDeclarationWithCollidingName = true;
|
|
89425
|
-
} else if (
|
|
89426
|
-
const isDeclaredInLoop =
|
|
89660
|
+
} else if (hasNodeCheckFlag(symbol.valueDeclaration, 16384 /* CapturedBlockScopedBinding */)) {
|
|
89661
|
+
const isDeclaredInLoop = hasNodeCheckFlag(symbol.valueDeclaration, 32768 /* BlockScopedBindingInLoop */);
|
|
89427
89662
|
const inLoopInitializer = isIterationStatement(
|
|
89428
89663
|
container,
|
|
89429
89664
|
/*lookInLabeledStatements*/
|
|
@@ -89505,6 +89740,9 @@ function createTypeChecker(host) {
|
|
|
89505
89740
|
if (!symbol) {
|
|
89506
89741
|
return false;
|
|
89507
89742
|
}
|
|
89743
|
+
const container = getSourceFileOfNode(symbol.valueDeclaration);
|
|
89744
|
+
const fileSymbol = container && getSymbolOfDeclaration(container);
|
|
89745
|
+
void resolveExternalModuleSymbol(fileSymbol);
|
|
89508
89746
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
89509
89747
|
if (target === unknownSymbol) {
|
|
89510
89748
|
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -89603,6 +89841,108 @@ function createTypeChecker(host) {
|
|
|
89603
89841
|
if (nodeId < 0 || nodeId >= nodeLinks.length) return 0;
|
|
89604
89842
|
return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0;
|
|
89605
89843
|
}
|
|
89844
|
+
function hasNodeCheckFlag(node, flag) {
|
|
89845
|
+
calculateNodeCheckFlagWorker(node, flag);
|
|
89846
|
+
return !!(getNodeCheckFlags(node) & flag);
|
|
89847
|
+
}
|
|
89848
|
+
function calculateNodeCheckFlagWorker(node, flag) {
|
|
89849
|
+
if (!compilerOptions.noCheck && canIncludeBindAndCheckDiagnsotics(getSourceFileOfNode(node), compilerOptions)) {
|
|
89850
|
+
return;
|
|
89851
|
+
}
|
|
89852
|
+
const links = getNodeLinks(node);
|
|
89853
|
+
if (links.calculatedFlags & flag) {
|
|
89854
|
+
return;
|
|
89855
|
+
}
|
|
89856
|
+
switch (flag) {
|
|
89857
|
+
case 16 /* SuperInstance */:
|
|
89858
|
+
case 32 /* SuperStatic */:
|
|
89859
|
+
return checkSingleSuperExpression(node);
|
|
89860
|
+
case 128 /* MethodWithSuperPropertyAccessInAsync */:
|
|
89861
|
+
case 256 /* MethodWithSuperPropertyAssignmentInAsync */:
|
|
89862
|
+
case 2097152 /* ContainsSuperPropertyInStaticInitializer */:
|
|
89863
|
+
return checkChildSuperExpressions(node);
|
|
89864
|
+
case 512 /* CaptureArguments */:
|
|
89865
|
+
case 8192 /* ContainsCapturedBlockScopeBinding */:
|
|
89866
|
+
case 65536 /* NeedsLoopOutParameter */:
|
|
89867
|
+
case 262144 /* ContainsConstructorReference */:
|
|
89868
|
+
return checkChildIdentifiers(node);
|
|
89869
|
+
case 536870912 /* ConstructorReference */:
|
|
89870
|
+
return checkSingleIdentifier(node);
|
|
89871
|
+
case 4096 /* LoopWithCapturedBlockScopedBinding */:
|
|
89872
|
+
case 32768 /* BlockScopedBindingInLoop */:
|
|
89873
|
+
case 16384 /* CapturedBlockScopedBinding */:
|
|
89874
|
+
return checkContainingBlockScopeBindingUses(node);
|
|
89875
|
+
default:
|
|
89876
|
+
return Debug.assertNever(flag, `Unhandled node check flag calculation: ${Debug.formatNodeCheckFlags(flag)}`);
|
|
89877
|
+
}
|
|
89878
|
+
function forEachNodeRecursively(root, cb) {
|
|
89879
|
+
const rootResult = cb(root, root.parent);
|
|
89880
|
+
if (rootResult === "skip") return void 0;
|
|
89881
|
+
if (rootResult) return rootResult;
|
|
89882
|
+
return forEachChildRecursively(root, cb);
|
|
89883
|
+
}
|
|
89884
|
+
function checkSuperExpressions(node2) {
|
|
89885
|
+
const links2 = getNodeLinks(node2);
|
|
89886
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
89887
|
+
links2.calculatedFlags |= 128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */ | 2097152 /* ContainsSuperPropertyInStaticInitializer */;
|
|
89888
|
+
checkSingleSuperExpression(node2);
|
|
89889
|
+
return void 0;
|
|
89890
|
+
}
|
|
89891
|
+
function checkChildSuperExpressions(node2) {
|
|
89892
|
+
forEachNodeRecursively(node2, checkSuperExpressions);
|
|
89893
|
+
}
|
|
89894
|
+
function checkSingleSuperExpression(node2) {
|
|
89895
|
+
const nodeLinks2 = getNodeLinks(node2);
|
|
89896
|
+
nodeLinks2.calculatedFlags |= 16 /* SuperInstance */ | 32 /* SuperStatic */;
|
|
89897
|
+
if (node2.kind === 108 /* SuperKeyword */) {
|
|
89898
|
+
checkSuperExpression(node2);
|
|
89899
|
+
}
|
|
89900
|
+
}
|
|
89901
|
+
function checkIdentifiers(node2) {
|
|
89902
|
+
const links2 = getNodeLinks(node2);
|
|
89903
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
89904
|
+
links2.calculatedFlags |= 512 /* CaptureArguments */ | 8192 /* ContainsCapturedBlockScopeBinding */ | 65536 /* NeedsLoopOutParameter */ | 262144 /* ContainsConstructorReference */;
|
|
89905
|
+
checkSingleIdentifier(node2);
|
|
89906
|
+
return void 0;
|
|
89907
|
+
}
|
|
89908
|
+
function checkChildIdentifiers(node2) {
|
|
89909
|
+
forEachNodeRecursively(node2, checkIdentifiers);
|
|
89910
|
+
}
|
|
89911
|
+
function checkSingleIdentifier(node2) {
|
|
89912
|
+
const nodeLinks2 = getNodeLinks(node2);
|
|
89913
|
+
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */ | 16384 /* CapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */;
|
|
89914
|
+
if (isIdentifier(node2) && isExpressionNode(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
89915
|
+
const s = getSymbolAtLocation(
|
|
89916
|
+
node2,
|
|
89917
|
+
/*ignoreErrors*/
|
|
89918
|
+
true
|
|
89919
|
+
);
|
|
89920
|
+
if (s && s !== unknownSymbol) {
|
|
89921
|
+
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
89922
|
+
}
|
|
89923
|
+
}
|
|
89924
|
+
}
|
|
89925
|
+
function checkBlockScopeBindings(node2) {
|
|
89926
|
+
const links2 = getNodeLinks(node2);
|
|
89927
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
89928
|
+
links2.calculatedFlags |= 4096 /* LoopWithCapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
89929
|
+
checkSingleBlockScopeBinding(node2);
|
|
89930
|
+
return void 0;
|
|
89931
|
+
}
|
|
89932
|
+
function checkContainingBlockScopeBindingUses(node2) {
|
|
89933
|
+
const scope = getEnclosingBlockScopeContainer(isDeclarationName(node2) ? node2.parent : node2);
|
|
89934
|
+
forEachNodeRecursively(scope, checkBlockScopeBindings);
|
|
89935
|
+
}
|
|
89936
|
+
function checkSingleBlockScopeBinding(node2) {
|
|
89937
|
+
checkSingleIdentifier(node2);
|
|
89938
|
+
if (isComputedPropertyName(node2)) {
|
|
89939
|
+
checkComputedPropertyName(node2);
|
|
89940
|
+
}
|
|
89941
|
+
if (isPrivateIdentifier(node2) && isClassElement(node2.parent)) {
|
|
89942
|
+
setNodeLinksForPrivateIdentifierScope(node2.parent);
|
|
89943
|
+
}
|
|
89944
|
+
}
|
|
89945
|
+
}
|
|
89606
89946
|
function getEnumMemberValue(node) {
|
|
89607
89947
|
computeEnumMemberValues(node.parent);
|
|
89608
89948
|
return getNodeLinks(node).enumMemberValue ?? evaluatorResult(
|
|
@@ -89623,7 +89963,15 @@ function createTypeChecker(host) {
|
|
|
89623
89963
|
if (node.kind === 306 /* EnumMember */) {
|
|
89624
89964
|
return getEnumMemberValue(node).value;
|
|
89625
89965
|
}
|
|
89626
|
-
|
|
89966
|
+
if (!getNodeLinks(node).resolvedSymbol) {
|
|
89967
|
+
void checkExpressionCached(node);
|
|
89968
|
+
}
|
|
89969
|
+
const symbol = getNodeLinks(node).resolvedSymbol || (isEntityNameExpression(node) ? resolveEntityName(
|
|
89970
|
+
node,
|
|
89971
|
+
111551 /* Value */,
|
|
89972
|
+
/*ignoreErrors*/
|
|
89973
|
+
true
|
|
89974
|
+
) : void 0);
|
|
89627
89975
|
if (symbol && symbol.flags & 8 /* EnumMember */) {
|
|
89628
89976
|
const member = symbol.valueDeclaration;
|
|
89629
89977
|
if (isEnumConst(member.parent)) {
|
|
@@ -89974,9 +90322,10 @@ function createTypeChecker(host) {
|
|
|
89974
90322
|
const node = getParseTreeNode(nodeIn);
|
|
89975
90323
|
return node && canCollectSymbolAliasAccessabilityData ? isReferencedAliasDeclaration(node, checkChildren) : true;
|
|
89976
90324
|
},
|
|
89977
|
-
|
|
90325
|
+
hasNodeCheckFlag: (nodeIn, flag) => {
|
|
89978
90326
|
const node = getParseTreeNode(nodeIn);
|
|
89979
|
-
|
|
90327
|
+
if (!node) return false;
|
|
90328
|
+
return hasNodeCheckFlag(node, flag);
|
|
89980
90329
|
},
|
|
89981
90330
|
isTopLevelValueImportEqualsWithEntityName,
|
|
89982
90331
|
isDeclarationVisible,
|
|
@@ -89999,6 +90348,10 @@ function createTypeChecker(host) {
|
|
|
89999
90348
|
return node ? getEnumMemberValue(node) : void 0;
|
|
90000
90349
|
},
|
|
90001
90350
|
collectLinkedAliases,
|
|
90351
|
+
markLinkedReferences: (nodeIn) => {
|
|
90352
|
+
const node = getParseTreeNode(nodeIn);
|
|
90353
|
+
return node && markLinkedReferences(node, 0 /* Unspecified */);
|
|
90354
|
+
},
|
|
90002
90355
|
getReferencedValueDeclaration,
|
|
90003
90356
|
getReferencedValueDeclarations,
|
|
90004
90357
|
getTypeReferenceSerializationKind,
|
|
@@ -91136,7 +91489,6 @@ function createTypeChecker(host) {
|
|
|
91136
91489
|
return true;
|
|
91137
91490
|
}
|
|
91138
91491
|
}
|
|
91139
|
-
return false;
|
|
91140
91492
|
}
|
|
91141
91493
|
}
|
|
91142
91494
|
if (isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 65536 /* AwaitContext */) && isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") {
|
|
@@ -97987,7 +98339,7 @@ function transformClassFields(context) {
|
|
|
97987
98339
|
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
97988
98340
|
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
97989
98341
|
containsInstancePrivateElements = true;
|
|
97990
|
-
if (resolver.
|
|
98342
|
+
if (resolver.hasNodeCheckFlag(member, 262144 /* ContainsConstructorReference */)) {
|
|
97991
98343
|
facts |= 2 /* NeedsClassConstructorReference */;
|
|
97992
98344
|
}
|
|
97993
98345
|
} else if (isPropertyDeclaration(member)) {
|
|
@@ -98094,7 +98446,7 @@ function transformClassFields(context) {
|
|
|
98094
98446
|
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
98095
98447
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
98096
98448
|
}
|
|
98097
|
-
const isClassWithConstructorReference = resolver.
|
|
98449
|
+
const isClassWithConstructorReference = resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */);
|
|
98098
98450
|
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
98099
98451
|
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
98100
98452
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
@@ -98156,15 +98508,14 @@ function transformClassFields(context) {
|
|
|
98156
98508
|
var _a, _b, _c;
|
|
98157
98509
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
98158
98510
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
98159
|
-
const
|
|
98160
|
-
const
|
|
98511
|
+
const isClassWithConstructorReference = resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */);
|
|
98512
|
+
const requiresBlockScopedVar = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */);
|
|
98161
98513
|
let temp;
|
|
98162
98514
|
function createClassTempVar() {
|
|
98163
98515
|
var _a2;
|
|
98164
98516
|
if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
|
|
98165
98517
|
return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
|
|
98166
98518
|
}
|
|
98167
|
-
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
98168
98519
|
const temp2 = factory2.createTempVariable(
|
|
98169
98520
|
requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
|
|
98170
98521
|
/*reservedInNestedScopes*/
|
|
@@ -98732,7 +99083,7 @@ function transformClassFields(context) {
|
|
|
98732
99083
|
const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
98733
99084
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
98734
99085
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
98735
|
-
if (resolver.
|
|
99086
|
+
if (resolver.hasNodeCheckFlag(name, 32768 /* BlockScopedBindingInLoop */)) {
|
|
98736
99087
|
addBlockScopedVariable(generatedName);
|
|
98737
99088
|
} else {
|
|
98738
99089
|
hoistVariableDeclaration(generatedName);
|
|
@@ -98886,7 +99237,7 @@ function transformClassFields(context) {
|
|
|
98886
99237
|
prefix,
|
|
98887
99238
|
suffix
|
|
98888
99239
|
);
|
|
98889
|
-
if (resolver.
|
|
99240
|
+
if (resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */)) {
|
|
98890
99241
|
addBlockScopedVariable(identifier);
|
|
98891
99242
|
} else {
|
|
98892
99243
|
hoistVariableDeclaration(identifier);
|
|
@@ -99125,7 +99476,7 @@ function transformClassFields(context) {
|
|
|
99125
99476
|
}
|
|
99126
99477
|
function trySubstituteClassAlias(node) {
|
|
99127
99478
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
99128
|
-
if (resolver.
|
|
99479
|
+
if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) {
|
|
99129
99480
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
99130
99481
|
if (declaration) {
|
|
99131
99482
|
const classAlias = classAliases[declaration.id];
|
|
@@ -99992,7 +100343,7 @@ function transformLegacyDecorators(context) {
|
|
|
99992
100343
|
}
|
|
99993
100344
|
}
|
|
99994
100345
|
function getClassAliasIfNeeded(node) {
|
|
99995
|
-
if (resolver.
|
|
100346
|
+
if (resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */)) {
|
|
99996
100347
|
enableSubstitutionForClassAliases();
|
|
99997
100348
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
99998
100349
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -100025,7 +100376,7 @@ function transformLegacyDecorators(context) {
|
|
|
100025
100376
|
}
|
|
100026
100377
|
function trySubstituteClassAlias(node) {
|
|
100027
100378
|
if (classAliases) {
|
|
100028
|
-
if (resolver.
|
|
100379
|
+
if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) {
|
|
100029
100380
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
100030
100381
|
if (declaration) {
|
|
100031
100382
|
const classAlias = classAliases[declaration.id];
|
|
@@ -102334,7 +102685,7 @@ function transformES2017(context) {
|
|
|
102334
102685
|
hasSuperElementAccess = false;
|
|
102335
102686
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
102336
102687
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
102337
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
102688
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
102338
102689
|
if (emitSuperHelpers) {
|
|
102339
102690
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
102340
102691
|
if (capturedSuperProperties.size) {
|
|
@@ -102345,9 +102696,9 @@ function transformES2017(context) {
|
|
|
102345
102696
|
updated = factory2.updateBlock(updated, statements);
|
|
102346
102697
|
}
|
|
102347
102698
|
if (hasSuperElementAccess) {
|
|
102348
|
-
if (resolver.
|
|
102699
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
102349
102700
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
102350
|
-
} else if (resolver.
|
|
102701
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
102351
102702
|
addEmitHelper(updated, asyncSuperHelper);
|
|
102352
102703
|
}
|
|
102353
102704
|
}
|
|
@@ -102414,7 +102765,7 @@ function transformES2017(context) {
|
|
|
102414
102765
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
102415
102766
|
const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
|
|
102416
102767
|
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
102417
|
-
const hasLexicalArguments =
|
|
102768
|
+
const hasLexicalArguments = resolver.hasNodeCheckFlag(node, 512 /* CaptureArguments */);
|
|
102418
102769
|
const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
|
|
102419
102770
|
if (captureLexicalArguments) {
|
|
102420
102771
|
lexicalArgumentsBinding = factory2.createUniqueName("arguments");
|
|
@@ -102469,7 +102820,7 @@ function transformES2017(context) {
|
|
|
102469
102820
|
)
|
|
102470
102821
|
)
|
|
102471
102822
|
);
|
|
102472
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
102823
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */));
|
|
102473
102824
|
if (emitSuperHelpers) {
|
|
102474
102825
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
102475
102826
|
if (capturedSuperProperties.size) {
|
|
@@ -102488,9 +102839,9 @@ function transformES2017(context) {
|
|
|
102488
102839
|
);
|
|
102489
102840
|
setTextRange(block, node.body);
|
|
102490
102841
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
102491
|
-
if (resolver.
|
|
102842
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
102492
102843
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
102493
|
-
} else if (resolver.
|
|
102844
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
102494
102845
|
addEmitHelper(block, asyncSuperHelper);
|
|
102495
102846
|
}
|
|
102496
102847
|
}
|
|
@@ -102549,7 +102900,7 @@ function transformES2017(context) {
|
|
|
102549
102900
|
}
|
|
102550
102901
|
function onEmitNode(hint, node, emitCallback) {
|
|
102551
102902
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
102552
|
-
const superContainerFlags = resolver.
|
|
102903
|
+
const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0);
|
|
102553
102904
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
102554
102905
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
102555
102906
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -102653,7 +103004,7 @@ function transformES2017(context) {
|
|
|
102653
103004
|
}
|
|
102654
103005
|
}
|
|
102655
103006
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
102656
|
-
const hasBinding =
|
|
103007
|
+
const hasBinding = resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
102657
103008
|
const accessors = [];
|
|
102658
103009
|
names.forEach((_, key) => {
|
|
102659
103010
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -103748,7 +104099,7 @@ function transformES2018(context) {
|
|
|
103748
104099
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
103749
104100
|
)
|
|
103750
104101
|
);
|
|
103751
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
104102
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */));
|
|
103752
104103
|
if (emitSuperHelpers) {
|
|
103753
104104
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
103754
104105
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -103758,9 +104109,9 @@ function transformES2018(context) {
|
|
|
103758
104109
|
outerStatements.push(returnStatement);
|
|
103759
104110
|
const block = factory2.updateBlock(node.body, outerStatements);
|
|
103760
104111
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
103761
|
-
if (resolver.
|
|
104112
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
103762
104113
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
103763
|
-
} else if (resolver.
|
|
104114
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
103764
104115
|
addEmitHelper(block, asyncSuperHelper);
|
|
103765
104116
|
}
|
|
103766
104117
|
}
|
|
@@ -103893,7 +104244,7 @@ function transformES2018(context) {
|
|
|
103893
104244
|
}
|
|
103894
104245
|
function onEmitNode(hint, node, emitCallback) {
|
|
103895
104246
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
103896
|
-
const superContainerFlags = resolver.
|
|
104247
|
+
const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0);
|
|
103897
104248
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
103898
104249
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
103899
104250
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -104524,10 +104875,10 @@ function transformESNext(context) {
|
|
|
104524
104875
|
function visitForOfStatement(node) {
|
|
104525
104876
|
if (isUsingVariableDeclarationList(node.initializer)) {
|
|
104526
104877
|
const forInitializer = node.initializer;
|
|
104527
|
-
|
|
104528
|
-
|
|
104529
|
-
|
|
104530
|
-
|
|
104878
|
+
const forDecl = firstOrUndefined(forInitializer.declarations) || factory2.createVariableDeclaration(factory2.createTempVariable(
|
|
104879
|
+
/*recordTempVariable*/
|
|
104880
|
+
void 0
|
|
104881
|
+
));
|
|
104531
104882
|
const isAwaitUsing = getUsingKindOfVariableDeclarationList(forInitializer) === 2 /* Async */;
|
|
104532
104883
|
const temp = factory2.getGeneratedNameForNode(forDecl.name);
|
|
104533
104884
|
const usingVar = factory2.updateVariableDeclaration(
|
|
@@ -107598,9 +107949,8 @@ function transformES2015(context) {
|
|
|
107598
107949
|
return createRange(pos, end);
|
|
107599
107950
|
}
|
|
107600
107951
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
107601
|
-
const
|
|
107602
|
-
const
|
|
107603
|
-
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
107952
|
+
const isCapturedInFunction = resolver.hasNodeCheckFlag(node, 16384 /* CapturedBlockScopedBinding */);
|
|
107953
|
+
const isDeclaredInLoop = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */);
|
|
107604
107954
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
107605
107955
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
107606
107956
|
return emitExplicitInitializer;
|
|
@@ -108051,7 +108401,7 @@ function transformES2015(context) {
|
|
|
108051
108401
|
return factory2.inlineExpressions(expressions);
|
|
108052
108402
|
}
|
|
108053
108403
|
function shouldConvertPartOfIterationStatement(node) {
|
|
108054
|
-
return
|
|
108404
|
+
return resolver.hasNodeCheckFlag(node, 8192 /* ContainsCapturedBlockScopeBinding */);
|
|
108055
108405
|
}
|
|
108056
108406
|
function shouldConvertInitializerOfForStatement(node) {
|
|
108057
108407
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -108066,7 +108416,7 @@ function transformES2015(context) {
|
|
|
108066
108416
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
108067
108417
|
}
|
|
108068
108418
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
108069
|
-
return
|
|
108419
|
+
return resolver.hasNodeCheckFlag(node, 4096 /* LoopWithCapturedBlockScopedBinding */);
|
|
108070
108420
|
}
|
|
108071
108421
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
108072
108422
|
if (!state.hoistedLocalVariables) {
|
|
@@ -108615,11 +108965,11 @@ function transformES2015(context) {
|
|
|
108615
108965
|
void 0,
|
|
108616
108966
|
name
|
|
108617
108967
|
));
|
|
108618
|
-
const
|
|
108619
|
-
if (
|
|
108968
|
+
const needsOutParam = resolver.hasNodeCheckFlag(decl, 65536 /* NeedsLoopOutParameter */);
|
|
108969
|
+
if (needsOutParam || hasCapturedBindingsInForHead) {
|
|
108620
108970
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
108621
108971
|
let flags = 0 /* None */;
|
|
108622
|
-
if (
|
|
108972
|
+
if (needsOutParam) {
|
|
108623
108973
|
flags |= 1 /* Body */;
|
|
108624
108974
|
}
|
|
108625
108975
|
if (isForStatement(container)) {
|
|
@@ -117653,6 +118003,11 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
117653
118003
|
emitSkipped = true;
|
|
117654
118004
|
return;
|
|
117655
118005
|
}
|
|
118006
|
+
(isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : filter(sourceFileOrBundle.sourceFiles, isSourceFileNotJson)).forEach(
|
|
118007
|
+
(sourceFile) => {
|
|
118008
|
+
if (compilerOptions.noCheck || !canIncludeBindAndCheckDiagnsotics(sourceFile, compilerOptions)) markLinkedReferences(sourceFile);
|
|
118009
|
+
}
|
|
118010
|
+
);
|
|
117656
118011
|
const transform2 = transformNodes(
|
|
117657
118012
|
resolver,
|
|
117658
118013
|
host,
|
|
@@ -117702,9 +118057,11 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
117702
118057
|
const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;
|
|
117703
118058
|
const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson);
|
|
117704
118059
|
const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit;
|
|
117705
|
-
|
|
117706
|
-
|
|
117707
|
-
|
|
118060
|
+
filesForEmit.forEach((sourceFile) => {
|
|
118061
|
+
if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck || emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) || !canIncludeBindAndCheckDiagnsotics(sourceFile, compilerOptions)) {
|
|
118062
|
+
collectLinkedAliases(sourceFile);
|
|
118063
|
+
}
|
|
118064
|
+
});
|
|
117708
118065
|
const declarationTransform = transformNodes(
|
|
117709
118066
|
resolver,
|
|
117710
118067
|
host,
|
|
@@ -117787,6 +118144,13 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
117787
118144
|
}
|
|
117788
118145
|
forEachChild(node, collectLinkedAliases);
|
|
117789
118146
|
}
|
|
118147
|
+
function markLinkedReferences(file) {
|
|
118148
|
+
forEachChildRecursively(file, (n) => {
|
|
118149
|
+
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
118150
|
+
if (isImportDeclaration(n)) return "skip";
|
|
118151
|
+
resolver.markLinkedReferences(n);
|
|
118152
|
+
});
|
|
118153
|
+
}
|
|
117790
118154
|
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) {
|
|
117791
118155
|
const sourceFileOrBundle = transform2.transformed[0];
|
|
117792
118156
|
const bundle = sourceFileOrBundle.kind === 308 /* Bundle */ ? sourceFileOrBundle : void 0;
|
|
@@ -117918,10 +118282,11 @@ var notImplementedResolver = {
|
|
|
117918
118282
|
isValueAliasDeclaration: notImplemented,
|
|
117919
118283
|
isReferencedAliasDeclaration: notImplemented,
|
|
117920
118284
|
isTopLevelValueImportEqualsWithEntityName: notImplemented,
|
|
117921
|
-
|
|
118285
|
+
hasNodeCheckFlag: notImplemented,
|
|
117922
118286
|
isDeclarationVisible: notImplemented,
|
|
117923
118287
|
isLateBound: (_node) => false,
|
|
117924
118288
|
collectLinkedAliases: notImplemented,
|
|
118289
|
+
markLinkedReferences: notImplemented,
|
|
117925
118290
|
isImplementationOfOverload: notImplemented,
|
|
117926
118291
|
requiresAddingImplicitUndefined: notImplemented,
|
|
117927
118292
|
isExpandoFunctionDeclaration: notImplemented,
|
|
@@ -124794,15 +125159,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124794
125159
|
const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
124795
125160
|
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
|
|
124796
125161
|
const isPlainJs = isPlainJsFile(sourceFile, options.checkJs);
|
|
124797
|
-
|
|
124798
|
-
|
|
124799
|
-
let bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray;
|
|
124800
|
-
let checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker2.getDiagnostics(sourceFile, cancellationToken) : emptyArray;
|
|
125162
|
+
let bindDiagnostics = sourceFile.bindDiagnostics;
|
|
125163
|
+
let checkDiagnostics = typeChecker2.getDiagnostics(sourceFile, cancellationToken);
|
|
124801
125164
|
if (isPlainJs) {
|
|
124802
125165
|
bindDiagnostics = filter(bindDiagnostics, (d) => plainJSErrors.has(d.code));
|
|
124803
125166
|
checkDiagnostics = filter(checkDiagnostics, (d) => plainJSErrors.has(d.code));
|
|
124804
125167
|
}
|
|
124805
|
-
return getMergedBindAndCheckDiagnostics(sourceFile,
|
|
125168
|
+
return getMergedBindAndCheckDiagnostics(sourceFile, !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : void 0);
|
|
124806
125169
|
});
|
|
124807
125170
|
}
|
|
124808
125171
|
function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, ...allDiagnostics) {
|
|
@@ -126057,9 +126420,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126057
126420
|
if (options.noEmit) {
|
|
126058
126421
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
|
|
126059
126422
|
}
|
|
126060
|
-
if (!options.emitDeclarationOnly) {
|
|
126061
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly");
|
|
126062
|
-
}
|
|
126063
126423
|
}
|
|
126064
126424
|
if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
|
|
126065
126425
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
|
|
@@ -141185,7 +141545,6 @@ function transpileWorker(input, transpileOptions, declaration) {
|
|
|
141185
141545
|
options.declaration = true;
|
|
141186
141546
|
options.emitDeclarationOnly = true;
|
|
141187
141547
|
options.isolatedDeclarations = true;
|
|
141188
|
-
options.noCheck = true;
|
|
141189
141548
|
} else {
|
|
141190
141549
|
options.declaration = false;
|
|
141191
141550
|
}
|
|
@@ -143863,7 +144222,7 @@ function getExistingLocals(sourceFile, statements, checker) {
|
|
|
143863
144222
|
for (const statement of statements) {
|
|
143864
144223
|
forEachReference(statement, checker, (s) => {
|
|
143865
144224
|
const symbol = skipAlias(s, checker);
|
|
143866
|
-
if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration) === sourceFile) {
|
|
144225
|
+
if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration).path === sourceFile.path) {
|
|
143867
144226
|
existingLocals.add(symbol);
|
|
143868
144227
|
}
|
|
143869
144228
|
});
|
|
@@ -158283,7 +158642,7 @@ registerCodeFix({
|
|
|
158283
158642
|
addCodeAction(addAnnotationFix, fixes, context, 2 /* Widened */, (f) => f.addTypeAnnotation(context.span));
|
|
158284
158643
|
addCodeAction(addInlineTypeAssertion, fixes, context, 0 /* Full */, (f) => f.addInlineAssertion(context.span));
|
|
158285
158644
|
addCodeAction(addInlineTypeAssertion, fixes, context, 1 /* Relative */, (f) => f.addInlineAssertion(context.span));
|
|
158286
|
-
addCodeAction(
|
|
158645
|
+
addCodeAction(addInlineTypeAssertion, fixes, context, 2 /* Widened */, (f) => f.addInlineAssertion(context.span));
|
|
158287
158646
|
addCodeAction(extractExpression, fixes, context, 0 /* Full */, (f) => f.extractAsVariable(context.span));
|
|
158288
158647
|
return fixes;
|
|
158289
158648
|
},
|
|
@@ -158314,7 +158673,6 @@ function withContext(context, typePrintMode, cb) {
|
|
|
158314
158673
|
const sourceFile = context.sourceFile;
|
|
158315
158674
|
const program = context.program;
|
|
158316
158675
|
const typeChecker = program.getTypeChecker();
|
|
158317
|
-
const emitResolver = typeChecker.getEmitResolver();
|
|
158318
158676
|
const scriptTarget = getEmitScriptTarget(program.getCompilerOptions());
|
|
158319
158677
|
const importAdder = createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
158320
158678
|
const fixedNodes = /* @__PURE__ */ new Set();
|
|
@@ -158877,7 +159235,7 @@ function withContext(context, typePrintMode, cb) {
|
|
|
158877
159235
|
}
|
|
158878
159236
|
type = widenedType;
|
|
158879
159237
|
}
|
|
158880
|
-
if (isParameter(node) &&
|
|
159238
|
+
if (isParameter(node) && typeChecker.requiresAddingImplicitUndefined(node)) {
|
|
158881
159239
|
type = typeChecker.getUnionType([typeChecker.getUndefinedType(), type], 0 /* None */);
|
|
158882
159240
|
}
|
|
158883
159241
|
const flags = (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */;
|
|
@@ -159073,23 +159431,23 @@ function withContext(context, typePrintMode, cb) {
|
|
|
159073
159431
|
setEmitFlags(node, 0 /* None */);
|
|
159074
159432
|
return result2;
|
|
159075
159433
|
}
|
|
159076
|
-
|
|
159077
|
-
|
|
159078
|
-
|
|
159079
|
-
|
|
159080
|
-
});
|
|
159081
|
-
}
|
|
159082
|
-
function findBestFittingNode(node, span) {
|
|
159083
|
-
while (node && node.end < span.start + span.length) {
|
|
159084
|
-
node = node.parent;
|
|
159085
|
-
}
|
|
159086
|
-
while (node.parent.pos === node.pos && node.parent.end === node.end) {
|
|
159087
|
-
node = node.parent;
|
|
159434
|
+
function findAncestorWithMissingType(node) {
|
|
159435
|
+
return findAncestor(node, (n) => {
|
|
159436
|
+
return canHaveTypeAnnotation.has(n.kind) && (!isObjectBindingPattern(n) && !isArrayBindingPattern(n) || isVariableDeclaration(n.parent));
|
|
159437
|
+
});
|
|
159088
159438
|
}
|
|
159089
|
-
|
|
159090
|
-
|
|
159439
|
+
function findBestFittingNode(node, span) {
|
|
159440
|
+
while (node && node.end < span.start + span.length) {
|
|
159441
|
+
node = node.parent;
|
|
159442
|
+
}
|
|
159443
|
+
while (node.parent.pos === node.pos && node.parent.end === node.end) {
|
|
159444
|
+
node = node.parent;
|
|
159445
|
+
}
|
|
159446
|
+
if (isIdentifier(node) && hasInitializer(node.parent) && node.parent.initializer) {
|
|
159447
|
+
return node.parent.initializer;
|
|
159448
|
+
}
|
|
159449
|
+
return node;
|
|
159091
159450
|
}
|
|
159092
|
-
return node;
|
|
159093
159451
|
}
|
|
159094
159452
|
|
|
159095
159453
|
// src/services/codefixes/fixAwaitInSyncFunction.ts
|
|
@@ -160367,7 +160725,8 @@ function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, con
|
|
|
160367
160725
|
switch (kind) {
|
|
160368
160726
|
case 171 /* PropertySignature */:
|
|
160369
160727
|
case 172 /* PropertyDeclaration */:
|
|
160370
|
-
|
|
160728
|
+
let flags = 1 /* NoTruncation */;
|
|
160729
|
+
flags |= quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0;
|
|
160371
160730
|
let typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context));
|
|
160372
160731
|
if (importAdder) {
|
|
160373
160732
|
const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
|
|
@@ -178094,6 +178453,7 @@ __export(ts_exports2, {
|
|
|
178094
178453
|
canHaveModifiers: () => canHaveModifiers,
|
|
178095
178454
|
canHaveModuleSpecifier: () => canHaveModuleSpecifier,
|
|
178096
178455
|
canHaveSymbol: () => canHaveSymbol,
|
|
178456
|
+
canIncludeBindAndCheckDiagnsotics: () => canIncludeBindAndCheckDiagnsotics,
|
|
178097
178457
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
178098
178458
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
178099
178459
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
@@ -192525,6 +192885,7 @@ if (typeof console !== "undefined") {
|
|
|
192525
192885
|
canHaveModifiers,
|
|
192526
192886
|
canHaveModuleSpecifier,
|
|
192527
192887
|
canHaveSymbol,
|
|
192888
|
+
canIncludeBindAndCheckDiagnsotics,
|
|
192528
192889
|
canJsonReportNoInputFiles,
|
|
192529
192890
|
canProduceDiagnostics,
|
|
192530
192891
|
canUsePropertyAccess,
|