@typescript-deploys/pr-build 5.0.0-pr-51492-2 → 5.0.0-pr-51725-7
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/lib.es2015.core.d.ts +2 -2
- package/lib/lib.es2022.sharedmemory.d.ts +15 -1
- package/lib/lib.es5.d.ts +1 -1
- package/lib/tsc.js +812 -818
- package/lib/tsserver.js +1589 -1243
- package/lib/tsserverlibrary.d.ts +30 -31
- package/lib/tsserverlibrary.js +1601 -1245
- package/lib/typescript.d.ts +30 -31
- package/lib/typescript.js +1590 -1242
- package/lib/typingsInstaller.js +217 -282
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20221202`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -1294,15 +1294,9 @@ function isNodeLikeSystem() {
|
|
|
1294
1294
|
// src/compiler/debug.ts
|
|
1295
1295
|
var Debug;
|
|
1296
1296
|
((Debug2) => {
|
|
1297
|
-
let typeScriptVersion2;
|
|
1298
1297
|
let currentAssertionLevel = 0 /* None */;
|
|
1299
1298
|
Debug2.currentLogLevel = 2 /* Warning */;
|
|
1300
1299
|
Debug2.isDebugging = false;
|
|
1301
|
-
Debug2.enableDeprecationWarnings = true;
|
|
1302
|
-
function getTypeScriptVersion() {
|
|
1303
|
-
return typeScriptVersion2 != null ? typeScriptVersion2 : typeScriptVersion2 = new Version(version);
|
|
1304
|
-
}
|
|
1305
|
-
Debug2.getTypeScriptVersion = getTypeScriptVersion;
|
|
1306
1300
|
function shouldLog(level) {
|
|
1307
1301
|
return Debug2.currentLogLevel <= level;
|
|
1308
1302
|
}
|
|
@@ -1818,52 +1812,6 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1818
1812
|
isDebugInfoEnabled = true;
|
|
1819
1813
|
}
|
|
1820
1814
|
Debug2.enableDebugInfo = enableDebugInfo;
|
|
1821
|
-
function formatDeprecationMessage(name, error, errorAfter, since, message) {
|
|
1822
|
-
let deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
|
|
1823
|
-
deprecationMessage += `'${name}' `;
|
|
1824
|
-
deprecationMessage += since ? `has been deprecated since v${since}` : "is deprecated";
|
|
1825
|
-
deprecationMessage += error ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : ".";
|
|
1826
|
-
deprecationMessage += message ? ` ${formatStringFromArgs(message, [name], 0)}` : "";
|
|
1827
|
-
return deprecationMessage;
|
|
1828
|
-
}
|
|
1829
|
-
function createErrorDeprecation(name, errorAfter, since, message) {
|
|
1830
|
-
const deprecationMessage = formatDeprecationMessage(name, true, errorAfter, since, message);
|
|
1831
|
-
return () => {
|
|
1832
|
-
throw new TypeError(deprecationMessage);
|
|
1833
|
-
};
|
|
1834
|
-
}
|
|
1835
|
-
function createWarningDeprecation(name, errorAfter, since, message) {
|
|
1836
|
-
let hasWrittenDeprecation = false;
|
|
1837
|
-
return () => {
|
|
1838
|
-
if (Debug2.enableDeprecationWarnings && !hasWrittenDeprecation) {
|
|
1839
|
-
log.warn(formatDeprecationMessage(name, false, errorAfter, since, message));
|
|
1840
|
-
hasWrittenDeprecation = true;
|
|
1841
|
-
}
|
|
1842
|
-
};
|
|
1843
|
-
}
|
|
1844
|
-
function createDeprecation(name, options = {}) {
|
|
1845
|
-
var _a2, _b;
|
|
1846
|
-
const version2 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : (_a2 = options.typeScriptVersion) != null ? _a2 : getTypeScriptVersion();
|
|
1847
|
-
const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter;
|
|
1848
|
-
const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter;
|
|
1849
|
-
const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter;
|
|
1850
|
-
const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0;
|
|
1851
|
-
const warn = !warnAfter || version2.compareTo(warnAfter) >= 0;
|
|
1852
|
-
return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop;
|
|
1853
|
-
}
|
|
1854
|
-
Debug2.createDeprecation = createDeprecation;
|
|
1855
|
-
function wrapFunction(deprecation, func) {
|
|
1856
|
-
return function() {
|
|
1857
|
-
deprecation();
|
|
1858
|
-
return func.apply(this, arguments);
|
|
1859
|
-
};
|
|
1860
|
-
}
|
|
1861
|
-
function deprecate(func, options) {
|
|
1862
|
-
var _a2;
|
|
1863
|
-
const deprecation = createDeprecation((_a2 = options == null ? void 0 : options.name) != null ? _a2 : getFunctionName(func), options);
|
|
1864
|
-
return wrapFunction(deprecation, func);
|
|
1865
|
-
}
|
|
1866
|
-
Debug2.deprecate = deprecate;
|
|
1867
1815
|
function formatVariance(varianceFlags) {
|
|
1868
1816
|
const variance = varianceFlags & 7 /* VarianceMask */;
|
|
1869
1817
|
let result = variance === 0 /* Invariant */ ? "in out" : variance === 3 /* Bivariant */ ? "[bivariant]" : variance === 2 /* Contravariant */ ? "in" : variance === 1 /* Covariant */ ? "out" : variance === 4 /* Independent */ ? "[independent]" : "";
|
|
@@ -3712,6 +3660,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3712
3660
|
return TypeFlags2;
|
|
3713
3661
|
})(TypeFlags || {});
|
|
3714
3662
|
var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
3663
|
+
ObjectFlags3[ObjectFlags3["None"] = 0] = "None";
|
|
3715
3664
|
ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class";
|
|
3716
3665
|
ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface";
|
|
3717
3666
|
ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference";
|
|
@@ -3875,38 +3824,39 @@ var SnippetKind = /* @__PURE__ */ ((SnippetKind3) => {
|
|
|
3875
3824
|
var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => {
|
|
3876
3825
|
EmitFlags3[EmitFlags3["None"] = 0] = "None";
|
|
3877
3826
|
EmitFlags3[EmitFlags3["SingleLine"] = 1] = "SingleLine";
|
|
3878
|
-
EmitFlags3[EmitFlags3["
|
|
3879
|
-
EmitFlags3[EmitFlags3["
|
|
3880
|
-
EmitFlags3[EmitFlags3["
|
|
3881
|
-
EmitFlags3[EmitFlags3["
|
|
3882
|
-
EmitFlags3[EmitFlags3["
|
|
3883
|
-
EmitFlags3[EmitFlags3["
|
|
3884
|
-
EmitFlags3[EmitFlags3["
|
|
3885
|
-
EmitFlags3[EmitFlags3["
|
|
3886
|
-
EmitFlags3[EmitFlags3["
|
|
3887
|
-
EmitFlags3[EmitFlags3["
|
|
3888
|
-
EmitFlags3[EmitFlags3["
|
|
3889
|
-
EmitFlags3[EmitFlags3["
|
|
3890
|
-
EmitFlags3[EmitFlags3["
|
|
3891
|
-
EmitFlags3[EmitFlags3["
|
|
3892
|
-
EmitFlags3[EmitFlags3["
|
|
3893
|
-
EmitFlags3[EmitFlags3["
|
|
3894
|
-
EmitFlags3[EmitFlags3["
|
|
3895
|
-
EmitFlags3[EmitFlags3["
|
|
3896
|
-
EmitFlags3[EmitFlags3["
|
|
3897
|
-
EmitFlags3[EmitFlags3["
|
|
3898
|
-
EmitFlags3[EmitFlags3["
|
|
3899
|
-
EmitFlags3[EmitFlags3["
|
|
3900
|
-
EmitFlags3[EmitFlags3["
|
|
3901
|
-
EmitFlags3[EmitFlags3["
|
|
3902
|
-
EmitFlags3[EmitFlags3["
|
|
3903
|
-
EmitFlags3[EmitFlags3["
|
|
3904
|
-
EmitFlags3[EmitFlags3["
|
|
3905
|
-
EmitFlags3[EmitFlags3["
|
|
3906
|
-
EmitFlags3[EmitFlags3["
|
|
3907
|
-
EmitFlags3[EmitFlags3["
|
|
3908
|
-
EmitFlags3[EmitFlags3["
|
|
3909
|
-
EmitFlags3[EmitFlags3["
|
|
3827
|
+
EmitFlags3[EmitFlags3["MultiLine"] = 2] = "MultiLine";
|
|
3828
|
+
EmitFlags3[EmitFlags3["AdviseOnEmitNode"] = 4] = "AdviseOnEmitNode";
|
|
3829
|
+
EmitFlags3[EmitFlags3["NoSubstitution"] = 8] = "NoSubstitution";
|
|
3830
|
+
EmitFlags3[EmitFlags3["CapturesThis"] = 16] = "CapturesThis";
|
|
3831
|
+
EmitFlags3[EmitFlags3["NoLeadingSourceMap"] = 32] = "NoLeadingSourceMap";
|
|
3832
|
+
EmitFlags3[EmitFlags3["NoTrailingSourceMap"] = 64] = "NoTrailingSourceMap";
|
|
3833
|
+
EmitFlags3[EmitFlags3["NoSourceMap"] = 96] = "NoSourceMap";
|
|
3834
|
+
EmitFlags3[EmitFlags3["NoNestedSourceMaps"] = 128] = "NoNestedSourceMaps";
|
|
3835
|
+
EmitFlags3[EmitFlags3["NoTokenLeadingSourceMaps"] = 256] = "NoTokenLeadingSourceMaps";
|
|
3836
|
+
EmitFlags3[EmitFlags3["NoTokenTrailingSourceMaps"] = 512] = "NoTokenTrailingSourceMaps";
|
|
3837
|
+
EmitFlags3[EmitFlags3["NoTokenSourceMaps"] = 768] = "NoTokenSourceMaps";
|
|
3838
|
+
EmitFlags3[EmitFlags3["NoLeadingComments"] = 1024] = "NoLeadingComments";
|
|
3839
|
+
EmitFlags3[EmitFlags3["NoTrailingComments"] = 2048] = "NoTrailingComments";
|
|
3840
|
+
EmitFlags3[EmitFlags3["NoComments"] = 3072] = "NoComments";
|
|
3841
|
+
EmitFlags3[EmitFlags3["NoNestedComments"] = 4096] = "NoNestedComments";
|
|
3842
|
+
EmitFlags3[EmitFlags3["HelperName"] = 8192] = "HelperName";
|
|
3843
|
+
EmitFlags3[EmitFlags3["ExportName"] = 16384] = "ExportName";
|
|
3844
|
+
EmitFlags3[EmitFlags3["LocalName"] = 32768] = "LocalName";
|
|
3845
|
+
EmitFlags3[EmitFlags3["InternalName"] = 65536] = "InternalName";
|
|
3846
|
+
EmitFlags3[EmitFlags3["Indented"] = 131072] = "Indented";
|
|
3847
|
+
EmitFlags3[EmitFlags3["NoIndentation"] = 262144] = "NoIndentation";
|
|
3848
|
+
EmitFlags3[EmitFlags3["AsyncFunctionBody"] = 524288] = "AsyncFunctionBody";
|
|
3849
|
+
EmitFlags3[EmitFlags3["ReuseTempVariableScope"] = 1048576] = "ReuseTempVariableScope";
|
|
3850
|
+
EmitFlags3[EmitFlags3["CustomPrologue"] = 2097152] = "CustomPrologue";
|
|
3851
|
+
EmitFlags3[EmitFlags3["NoHoisting"] = 4194304] = "NoHoisting";
|
|
3852
|
+
EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 8388608] = "HasEndOfDeclarationMarker";
|
|
3853
|
+
EmitFlags3[EmitFlags3["Iterator"] = 16777216] = "Iterator";
|
|
3854
|
+
EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 33554432] = "NoAsciiEscaping";
|
|
3855
|
+
EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 67108864] = "TypeScriptClassWrapper";
|
|
3856
|
+
EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 134217728] = "NeverApplyImportHelper";
|
|
3857
|
+
EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 268435456] = "IgnoreSourceNewlines";
|
|
3858
|
+
EmitFlags3[EmitFlags3["Immutable"] = 536870912] = "Immutable";
|
|
3859
|
+
EmitFlags3[EmitFlags3["IndirectCall"] = 1073741824] = "IndirectCall";
|
|
3910
3860
|
return EmitFlags3;
|
|
3911
3861
|
})(EmitFlags || {});
|
|
3912
3862
|
var commentPragmas = {
|
|
@@ -6776,10 +6726,10 @@ var Diagnostics = {
|
|
|
6776
6726
|
Module_name_0_matched_pattern_1: diag(6092, 3 /* Message */, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."),
|
|
6777
6727
|
Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, 3 /* Message */, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."),
|
|
6778
6728
|
Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."),
|
|
6779
|
-
|
|
6729
|
+
Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."),
|
|
6780
6730
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
6781
6731
|
File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."),
|
|
6782
|
-
|
|
6732
|
+
Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."),
|
|
6783
6733
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
6784
6734
|
package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."),
|
|
6785
6735
|
package_json_has_0_field_1_that_references_2: diag(6101, 3 /* Message */, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."),
|
|
@@ -10893,7 +10843,7 @@ function insertStatementAfterPrologue(to, statement, isPrologueDirective2) {
|
|
|
10893
10843
|
return to;
|
|
10894
10844
|
}
|
|
10895
10845
|
function isAnyPrologueDirective(node) {
|
|
10896
|
-
return isPrologueDirective(node) || !!(getEmitFlags(node) &
|
|
10846
|
+
return isPrologueDirective(node) || !!(getEmitFlags(node) & 2097152 /* CustomPrologue */);
|
|
10897
10847
|
}
|
|
10898
10848
|
function insertStatementsAfterStandardPrologue(to, from) {
|
|
10899
10849
|
return insertStatementsAfterPrologue(to, from, isPrologueDirective);
|
|
@@ -11077,7 +11027,7 @@ function getLiteralText(node, sourceFile, flags) {
|
|
|
11077
11027
|
}
|
|
11078
11028
|
switch (node.kind) {
|
|
11079
11029
|
case 10 /* StringLiteral */: {
|
|
11080
|
-
const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) &
|
|
11030
|
+
const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString;
|
|
11081
11031
|
if (node.singleQuote) {
|
|
11082
11032
|
return "'" + escapeText(node.text, 39 /* singleQuote */) + "'";
|
|
11083
11033
|
} else {
|
|
@@ -11088,7 +11038,7 @@ function getLiteralText(node, sourceFile, flags) {
|
|
|
11088
11038
|
case 15 /* TemplateHead */:
|
|
11089
11039
|
case 16 /* TemplateMiddle */:
|
|
11090
11040
|
case 17 /* TemplateTail */: {
|
|
11091
|
-
const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) &
|
|
11041
|
+
const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString;
|
|
11092
11042
|
const rawText = (_a2 = node.rawText) != null ? _a2 : escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */));
|
|
11093
11043
|
switch (node.kind) {
|
|
11094
11044
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -11488,7 +11438,7 @@ function isPrologueDirective(node) {
|
|
|
11488
11438
|
return node.kind === 241 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */;
|
|
11489
11439
|
}
|
|
11490
11440
|
function isCustomPrologue(node) {
|
|
11491
|
-
return !!(getEmitFlags(node) &
|
|
11441
|
+
return !!(getEmitFlags(node) & 2097152 /* CustomPrologue */);
|
|
11492
11442
|
}
|
|
11493
11443
|
function isHoistedFunction(node) {
|
|
11494
11444
|
return isCustomPrologue(node) && isFunctionDeclaration(node);
|
|
@@ -15134,6 +15084,7 @@ var supportedJSExtensionsFlat = flatten(supportedJSExtensions);
|
|
|
15134
15084
|
var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".js" /* Js */, ".jsx" /* Jsx */], [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */], [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]];
|
|
15135
15085
|
var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
|
|
15136
15086
|
var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
|
|
15087
|
+
var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
|
|
15137
15088
|
function getSupportedExtensions(options, extraFileExtensions) {
|
|
15138
15089
|
const needJsExtensions = options && getAllowJSCompilerOption(options);
|
|
15139
15090
|
if (!extraFileExtensions || extraFileExtensions.length === 0) {
|
|
@@ -15356,6 +15307,26 @@ function parsePseudoBigInt(stringValue) {
|
|
|
15356
15307
|
function pseudoBigIntToString({ negative, base10Value }) {
|
|
15357
15308
|
return (negative && base10Value !== "0" ? "-" : "") + base10Value;
|
|
15358
15309
|
}
|
|
15310
|
+
function parseValidBigInt(text) {
|
|
15311
|
+
const negative = text.startsWith("-");
|
|
15312
|
+
const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
|
|
15313
|
+
return { negative, base10Value };
|
|
15314
|
+
}
|
|
15315
|
+
function isValidBigIntString(s, roundTripOnly) {
|
|
15316
|
+
if (s === "")
|
|
15317
|
+
return false;
|
|
15318
|
+
const scanner = createScanner(99 /* ESNext */, false);
|
|
15319
|
+
let success = true;
|
|
15320
|
+
scanner.setOnError(() => success = false);
|
|
15321
|
+
scanner.setText(s + "n");
|
|
15322
|
+
let result = scanner.scan();
|
|
15323
|
+
const negative = result === 40 /* MinusToken */;
|
|
15324
|
+
if (negative) {
|
|
15325
|
+
result = scanner.scan();
|
|
15326
|
+
}
|
|
15327
|
+
const flags = scanner.getTokenFlags();
|
|
15328
|
+
return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
|
|
15329
|
+
}
|
|
15359
15330
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
15360
15331
|
return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
15361
15332
|
}
|
|
@@ -15675,6 +15646,13 @@ function isOptionalJSDocPropertyLikeTag(node) {
|
|
|
15675
15646
|
const { isBracketed, typeExpression } = node;
|
|
15676
15647
|
return isBracketed || !!typeExpression && typeExpression.type.kind === 319 /* JSDocOptionalType */;
|
|
15677
15648
|
}
|
|
15649
|
+
function canUsePropertyAccess(name, languageVersion) {
|
|
15650
|
+
if (name.length === 0) {
|
|
15651
|
+
return false;
|
|
15652
|
+
}
|
|
15653
|
+
const firstChar = name.charCodeAt(0);
|
|
15654
|
+
return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
|
|
15655
|
+
}
|
|
15678
15656
|
|
|
15679
15657
|
// src/compiler/factory/baseNodeFactory.ts
|
|
15680
15658
|
function createBaseNodeFactory() {
|
|
@@ -16319,9 +16297,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16319
16297
|
updateArrayLiteralExpression,
|
|
16320
16298
|
createObjectLiteralExpression,
|
|
16321
16299
|
updateObjectLiteralExpression,
|
|
16322
|
-
createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name),
|
|
16300
|
+
createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 262144 /* NoIndentation */) : createPropertyAccessExpression,
|
|
16323
16301
|
updatePropertyAccessExpression,
|
|
16324
|
-
createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name),
|
|
16302
|
+
createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 262144 /* NoIndentation */) : createPropertyAccessChain,
|
|
16325
16303
|
updatePropertyAccessChain,
|
|
16326
16304
|
createElementAccessExpression,
|
|
16327
16305
|
updateElementAccessExpression,
|
|
@@ -19832,7 +19810,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19832
19810
|
} else if (isSuperKeyword(callee)) {
|
|
19833
19811
|
thisArg = createThis();
|
|
19834
19812
|
target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee;
|
|
19835
|
-
} else if (getEmitFlags(callee) &
|
|
19813
|
+
} else if (getEmitFlags(callee) & 8192 /* HelperName */) {
|
|
19836
19814
|
thisArg = createVoidZero();
|
|
19837
19815
|
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee, false);
|
|
19838
19816
|
} else if (isPropertyAccessExpression(callee)) {
|
|
@@ -19910,9 +19888,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19910
19888
|
const name = setParent(setTextRange(cloneNode(nodeName), nodeName), nodeName.parent);
|
|
19911
19889
|
emitFlags |= getEmitFlags(nodeName);
|
|
19912
19890
|
if (!allowSourceMaps)
|
|
19913
|
-
emitFlags |=
|
|
19891
|
+
emitFlags |= 96 /* NoSourceMap */;
|
|
19914
19892
|
if (!allowComments)
|
|
19915
|
-
emitFlags |=
|
|
19893
|
+
emitFlags |= 3072 /* NoComments */;
|
|
19916
19894
|
if (emitFlags)
|
|
19917
19895
|
setEmitFlags(name, emitFlags);
|
|
19918
19896
|
return name;
|
|
@@ -19920,13 +19898,13 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19920
19898
|
return getGeneratedNameForNode(node);
|
|
19921
19899
|
}
|
|
19922
19900
|
function getInternalName(node, allowComments, allowSourceMaps) {
|
|
19923
|
-
return getName(node, allowComments, allowSourceMaps,
|
|
19901
|
+
return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */ | 65536 /* InternalName */);
|
|
19924
19902
|
}
|
|
19925
19903
|
function getLocalName(node, allowComments, allowSourceMaps) {
|
|
19926
|
-
return getName(node, allowComments, allowSourceMaps,
|
|
19904
|
+
return getName(node, allowComments, allowSourceMaps, 32768 /* LocalName */);
|
|
19927
19905
|
}
|
|
19928
19906
|
function getExportName(node, allowComments, allowSourceMaps) {
|
|
19929
|
-
return getName(node, allowComments, allowSourceMaps,
|
|
19907
|
+
return getName(node, allowComments, allowSourceMaps, 16384 /* ExportName */);
|
|
19930
19908
|
}
|
|
19931
19909
|
function getDeclarationName(node, allowComments, allowSourceMaps) {
|
|
19932
19910
|
return getName(node, allowComments, allowSourceMaps);
|
|
@@ -19936,9 +19914,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19936
19914
|
setTextRange(qualifiedName, name);
|
|
19937
19915
|
let emitFlags = 0;
|
|
19938
19916
|
if (!allowSourceMaps)
|
|
19939
|
-
emitFlags |=
|
|
19917
|
+
emitFlags |= 96 /* NoSourceMap */;
|
|
19940
19918
|
if (!allowComments)
|
|
19941
|
-
emitFlags |=
|
|
19919
|
+
emitFlags |= 3072 /* NoComments */;
|
|
19942
19920
|
if (emitFlags)
|
|
19943
19921
|
setEmitFlags(qualifiedName, emitFlags);
|
|
19944
19922
|
return qualifiedName;
|
|
@@ -19984,7 +19962,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19984
19962
|
const numStatements = source.length;
|
|
19985
19963
|
while (statementOffset !== void 0 && statementOffset < numStatements) {
|
|
19986
19964
|
const statement = source[statementOffset];
|
|
19987
|
-
if (getEmitFlags(statement) &
|
|
19965
|
+
if (getEmitFlags(statement) & 2097152 /* CustomPrologue */ && filter2(statement)) {
|
|
19988
19966
|
append(target, visitor ? visitNode(statement, visitor, isStatement) : statement);
|
|
19989
19967
|
} else {
|
|
19990
19968
|
break;
|
|
@@ -20524,7 +20502,7 @@ function mergeEmitNode(sourceEmitNode, destEmitNode) {
|
|
|
20524
20502
|
if (trailingComments)
|
|
20525
20503
|
destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments);
|
|
20526
20504
|
if (flags)
|
|
20527
|
-
destEmitNode.flags = flags & ~
|
|
20505
|
+
destEmitNode.flags = flags & ~536870912 /* Immutable */;
|
|
20528
20506
|
if (commentRange)
|
|
20529
20507
|
destEmitNode.commentRange = commentRange;
|
|
20530
20508
|
if (sourceMapRange)
|
|
@@ -20566,7 +20544,7 @@ function getOrCreateEmitNode(node) {
|
|
|
20566
20544
|
}
|
|
20567
20545
|
node.emitNode = {};
|
|
20568
20546
|
} else {
|
|
20569
|
-
Debug.assert(!(node.emitNode.flags &
|
|
20547
|
+
Debug.assert(!(node.emitNode.flags & 536870912 /* Immutable */), "Invalid attempt to mutate an immutable node.");
|
|
20570
20548
|
}
|
|
20571
20549
|
return node.emitNode;
|
|
20572
20550
|
}
|
|
@@ -20581,7 +20559,7 @@ function disposeEmitNodes(sourceFile) {
|
|
|
20581
20559
|
}
|
|
20582
20560
|
function removeAllComments(node) {
|
|
20583
20561
|
const emitNode = getOrCreateEmitNode(node);
|
|
20584
|
-
emitNode.flags |=
|
|
20562
|
+
emitNode.flags |= 3072 /* NoComments */;
|
|
20585
20563
|
emitNode.leadingComments = void 0;
|
|
20586
20564
|
emitNode.trailingComments = void 0;
|
|
20587
20565
|
return node;
|
|
@@ -20720,8 +20698,8 @@ function getTypeNode(node) {
|
|
|
20720
20698
|
// src/compiler/factory/emitHelpers.ts
|
|
20721
20699
|
function createEmitHelperFactory(context) {
|
|
20722
20700
|
const factory2 = context.factory;
|
|
20723
|
-
const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(),
|
|
20724
|
-
const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(),
|
|
20701
|
+
const immutableTrue = memoize(() => setEmitFlags(factory2.createTrue(), 536870912 /* Immutable */));
|
|
20702
|
+
const immutableFalse = memoize(() => setEmitFlags(factory2.createFalse(), 536870912 /* Immutable */));
|
|
20725
20703
|
return {
|
|
20726
20704
|
getUnscopedHelperName,
|
|
20727
20705
|
createDecorateHelper,
|
|
@@ -20750,7 +20728,7 @@ function createEmitHelperFactory(context) {
|
|
|
20750
20728
|
createClassPrivateFieldInHelper
|
|
20751
20729
|
};
|
|
20752
20730
|
function getUnscopedHelperName(name) {
|
|
20753
|
-
return setEmitFlags(factory2.createIdentifier(name),
|
|
20731
|
+
return setEmitFlags(factory2.createIdentifier(name), 8192 /* HelperName */ | 4 /* AdviseOnEmitNode */);
|
|
20754
20732
|
}
|
|
20755
20733
|
function createDecorateHelper(decoratorExpressions, target, memberName, descriptor) {
|
|
20756
20734
|
context.requestEmitHelper(decorateHelper);
|
|
@@ -20816,7 +20794,7 @@ function createEmitHelperFactory(context) {
|
|
|
20816
20794
|
function createAsyncGeneratorHelper(generatorFunc, hasLexicalThis) {
|
|
20817
20795
|
context.requestEmitHelper(awaitHelper);
|
|
20818
20796
|
context.requestEmitHelper(asyncGeneratorHelper);
|
|
20819
|
-
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |=
|
|
20797
|
+
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 /* AsyncFunctionBody */ | 1048576 /* ReuseTempVariableScope */;
|
|
20820
20798
|
return factory2.createCallExpression(
|
|
20821
20799
|
getUnscopedHelperName("__asyncGenerator"),
|
|
20822
20800
|
void 0,
|
|
@@ -20892,7 +20870,7 @@ function createEmitHelperFactory(context) {
|
|
|
20892
20870
|
void 0,
|
|
20893
20871
|
body
|
|
20894
20872
|
);
|
|
20895
|
-
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |=
|
|
20873
|
+
(generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 /* AsyncFunctionBody */ | 1048576 /* ReuseTempVariableScope */;
|
|
20896
20874
|
return factory2.createCallExpression(
|
|
20897
20875
|
getUnscopedHelperName("__awaiter"),
|
|
20898
20876
|
void 0,
|
|
@@ -21121,7 +21099,7 @@ var asyncDelegator = {
|
|
|
21121
21099
|
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
21122
21100
|
var i, p;
|
|
21123
21101
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
21124
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
21102
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
21125
21103
|
};`
|
|
21126
21104
|
};
|
|
21127
21105
|
var asyncValues = {
|
|
@@ -21435,7 +21413,7 @@ var advancedAsyncSuperHelper = {
|
|
|
21435
21413
|
})(name => super[name], (name, value) => super[name] = value);`
|
|
21436
21414
|
};
|
|
21437
21415
|
function isCallToHelper(firstSegment, helperName) {
|
|
21438
|
-
return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) &
|
|
21416
|
+
return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192 /* HelperName */) !== 0 && firstSegment.expression.escapedText === helperName;
|
|
21439
21417
|
}
|
|
21440
21418
|
|
|
21441
21419
|
// src/compiler/factory/nodeTests.ts
|
|
@@ -22016,7 +21994,7 @@ function createMemberAccessForPropertyName(factory2, target, memberName, locatio
|
|
|
22016
21994
|
isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName),
|
|
22017
21995
|
memberName
|
|
22018
21996
|
);
|
|
22019
|
-
getOrCreateEmitNode(expression).flags |=
|
|
21997
|
+
getOrCreateEmitNode(expression).flags |= 128 /* NoNestedSourceMaps */;
|
|
22020
21998
|
return expression;
|
|
22021
21999
|
}
|
|
22022
22000
|
}
|
|
@@ -22270,13 +22248,13 @@ function expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expres
|
|
|
22270
22248
|
return expression;
|
|
22271
22249
|
}
|
|
22272
22250
|
function isInternalName(node) {
|
|
22273
|
-
return (getEmitFlags(node) &
|
|
22251
|
+
return (getEmitFlags(node) & 65536 /* InternalName */) !== 0;
|
|
22274
22252
|
}
|
|
22275
22253
|
function isLocalName(node) {
|
|
22276
|
-
return (getEmitFlags(node) &
|
|
22254
|
+
return (getEmitFlags(node) & 32768 /* LocalName */) !== 0;
|
|
22277
22255
|
}
|
|
22278
22256
|
function isExportName(node) {
|
|
22279
|
-
return (getEmitFlags(node) &
|
|
22257
|
+
return (getEmitFlags(node) & 16384 /* ExportName */) !== 0;
|
|
22280
22258
|
}
|
|
22281
22259
|
function isUseStrictPrologue(node) {
|
|
22282
22260
|
return isStringLiteral(node.expression) && node.expression.text === "use strict";
|
|
@@ -22387,7 +22365,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
22387
22365
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
22388
22366
|
void 0
|
|
22389
22367
|
);
|
|
22390
|
-
addEmitFlags(externalHelpersImportDeclaration,
|
|
22368
|
+
addEmitFlags(externalHelpersImportDeclaration, 134217728 /* NeverApplyImportHelper */);
|
|
22391
22369
|
return externalHelpersImportDeclaration;
|
|
22392
22370
|
}
|
|
22393
22371
|
}
|
|
@@ -32722,15 +32700,18 @@ function removeIgnoredPackageId(r) {
|
|
|
32722
32700
|
return { path: r.path, ext: r.extension };
|
|
32723
32701
|
}
|
|
32724
32702
|
}
|
|
32725
|
-
|
|
32726
|
-
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32703
|
+
function formatExtensions(extensions) {
|
|
32704
|
+
const result = [];
|
|
32705
|
+
if (extensions & 1 /* TypeScript */)
|
|
32706
|
+
result.push("TypeScript");
|
|
32707
|
+
if (extensions & 2 /* JavaScript */)
|
|
32708
|
+
result.push("JavaScript");
|
|
32709
|
+
if (extensions & 4 /* Declaration */)
|
|
32710
|
+
result.push("Declaration");
|
|
32711
|
+
if (extensions & 8 /* Json */)
|
|
32712
|
+
result.push("JSON");
|
|
32713
|
+
return result.join(", ");
|
|
32714
|
+
}
|
|
32734
32715
|
function resolvedTypeScriptOnly(resolved) {
|
|
32735
32716
|
if (!resolved) {
|
|
32736
32717
|
return void 0;
|
|
@@ -32934,7 +32915,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32934
32915
|
features,
|
|
32935
32916
|
conditions,
|
|
32936
32917
|
requestContainingDirectory: containingDirectory,
|
|
32937
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
32918
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
32919
|
+
isConfigLookup: false
|
|
32938
32920
|
};
|
|
32939
32921
|
let resolved = primaryLookup();
|
|
32940
32922
|
let primary = true;
|
|
@@ -32984,7 +32966,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32984
32966
|
}
|
|
32985
32967
|
return resolvedTypeScriptOnly(
|
|
32986
32968
|
loadNodeModuleFromDirectory(
|
|
32987
|
-
4 /*
|
|
32969
|
+
4 /* Declaration */,
|
|
32988
32970
|
candidate,
|
|
32989
32971
|
!directoryExists,
|
|
32990
32972
|
moduleResolutionState
|
|
@@ -33005,11 +32987,11 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
33005
32987
|
}
|
|
33006
32988
|
let result2;
|
|
33007
32989
|
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
33008
|
-
const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /*
|
|
32990
|
+
const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /* Declaration */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, void 0, void 0);
|
|
33009
32991
|
result2 = searchResult && searchResult.value;
|
|
33010
32992
|
} else {
|
|
33011
32993
|
const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName);
|
|
33012
|
-
result2 = nodeLoadModuleByRelativeName(4 /*
|
|
32994
|
+
result2 = nodeLoadModuleByRelativeName(4 /* Declaration */, candidate, false, moduleResolutionState, true);
|
|
33013
32995
|
}
|
|
33014
32996
|
return resolvedTypeScriptOnly(result2);
|
|
33015
32997
|
} else {
|
|
@@ -33049,41 +33031,86 @@ function getAutomaticTypeDirectiveNames(options, host) {
|
|
|
33049
33031
|
}
|
|
33050
33032
|
return result;
|
|
33051
33033
|
}
|
|
33052
|
-
function
|
|
33053
|
-
|
|
33034
|
+
function compilerOptionValueToString(value) {
|
|
33035
|
+
var _a2;
|
|
33036
|
+
if (value === null || typeof value !== "object") {
|
|
33037
|
+
return "" + value;
|
|
33038
|
+
}
|
|
33039
|
+
if (isArray(value)) {
|
|
33040
|
+
return `[${(_a2 = value.map((e) => compilerOptionValueToString(e))) == null ? void 0 : _a2.join(",")}]`;
|
|
33041
|
+
}
|
|
33042
|
+
let str = "{";
|
|
33043
|
+
for (const key in value) {
|
|
33044
|
+
if (hasProperty(value, key)) {
|
|
33045
|
+
str += `${key}: ${compilerOptionValueToString(value[key])}`;
|
|
33046
|
+
}
|
|
33047
|
+
}
|
|
33048
|
+
return str + "}";
|
|
33049
|
+
}
|
|
33050
|
+
function getKeyForCompilerOptions(options, affectingOptionDeclarations) {
|
|
33051
|
+
return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + (options.pathsBasePath ? `|${options.pathsBasePath}` : void 0);
|
|
33052
|
+
}
|
|
33053
|
+
function createCacheWithRedirects(ownOptions) {
|
|
33054
33054
|
const redirectsMap = /* @__PURE__ */ new Map();
|
|
33055
|
+
const optionsToRedirectsKey = /* @__PURE__ */ new Map();
|
|
33056
|
+
const redirectsKeyToMap = /* @__PURE__ */ new Map();
|
|
33057
|
+
let ownMap = /* @__PURE__ */ new Map();
|
|
33058
|
+
if (ownOptions)
|
|
33059
|
+
redirectsMap.set(ownOptions, ownMap);
|
|
33055
33060
|
return {
|
|
33056
|
-
getOwnMap,
|
|
33057
|
-
redirectsMap,
|
|
33058
33061
|
getOrCreateMapOfCacheRedirects,
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
setOwnMap
|
|
33062
|
+
update,
|
|
33063
|
+
clear: clear2
|
|
33062
33064
|
};
|
|
33063
|
-
function getOwnMap() {
|
|
33064
|
-
return ownMap;
|
|
33065
|
-
}
|
|
33066
|
-
function setOwnOptions(newOptions) {
|
|
33067
|
-
options = newOptions;
|
|
33068
|
-
}
|
|
33069
|
-
function setOwnMap(newOwnMap) {
|
|
33070
|
-
ownMap = newOwnMap;
|
|
33071
|
-
}
|
|
33072
33065
|
function getOrCreateMapOfCacheRedirects(redirectedReference) {
|
|
33073
|
-
|
|
33074
|
-
|
|
33066
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
|
|
33067
|
+
}
|
|
33068
|
+
function update(newOptions) {
|
|
33069
|
+
if (ownOptions !== newOptions) {
|
|
33070
|
+
if (ownOptions)
|
|
33071
|
+
ownMap = getOrCreateMap(newOptions);
|
|
33072
|
+
else
|
|
33073
|
+
redirectsMap.set(newOptions, ownMap);
|
|
33074
|
+
ownOptions = newOptions;
|
|
33075
33075
|
}
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33076
|
+
}
|
|
33077
|
+
function getOrCreateMap(redirectOptions) {
|
|
33078
|
+
let result = redirectsMap.get(redirectOptions);
|
|
33079
|
+
if (result)
|
|
33080
|
+
return result;
|
|
33081
|
+
const key = getRedirectsCacheKey(redirectOptions);
|
|
33082
|
+
result = redirectsKeyToMap.get(key);
|
|
33083
|
+
if (!result) {
|
|
33084
|
+
if (ownOptions) {
|
|
33085
|
+
const ownKey = getRedirectsCacheKey(ownOptions);
|
|
33086
|
+
if (ownKey === key)
|
|
33087
|
+
result = ownMap;
|
|
33088
|
+
else if (!redirectsKeyToMap.has(ownKey))
|
|
33089
|
+
redirectsKeyToMap.set(ownKey, ownMap);
|
|
33090
|
+
}
|
|
33091
|
+
redirectsKeyToMap.set(key, result != null ? result : result = /* @__PURE__ */ new Map());
|
|
33081
33092
|
}
|
|
33082
|
-
|
|
33093
|
+
redirectsMap.set(redirectOptions, result);
|
|
33094
|
+
return result;
|
|
33083
33095
|
}
|
|
33084
33096
|
function clear2() {
|
|
33097
|
+
const ownKey = ownOptions && optionsToRedirectsKey.get(ownOptions);
|
|
33085
33098
|
ownMap.clear();
|
|
33086
33099
|
redirectsMap.clear();
|
|
33100
|
+
optionsToRedirectsKey.clear();
|
|
33101
|
+
redirectsKeyToMap.clear();
|
|
33102
|
+
if (ownOptions) {
|
|
33103
|
+
if (ownKey)
|
|
33104
|
+
optionsToRedirectsKey.set(ownOptions, ownKey);
|
|
33105
|
+
redirectsMap.set(ownOptions, ownMap);
|
|
33106
|
+
}
|
|
33107
|
+
}
|
|
33108
|
+
function getRedirectsCacheKey(options) {
|
|
33109
|
+
let result = optionsToRedirectsKey.get(options);
|
|
33110
|
+
if (!result) {
|
|
33111
|
+
optionsToRedirectsKey.set(options, result = getKeyForCompilerOptions(options, moduleResolutionOptionDeclarations));
|
|
33112
|
+
}
|
|
33113
|
+
return result;
|
|
33087
33114
|
}
|
|
33088
33115
|
}
|
|
33089
33116
|
function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
|
|
@@ -33115,27 +33142,6 @@ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create)
|
|
|
33115
33142
|
}
|
|
33116
33143
|
return result;
|
|
33117
33144
|
}
|
|
33118
|
-
function updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap) {
|
|
33119
|
-
if (!options.configFile)
|
|
33120
|
-
return;
|
|
33121
|
-
if (directoryToModuleNameMap.redirectsMap.size === 0) {
|
|
33122
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size === 0);
|
|
33123
|
-
Debug.assert(directoryToModuleNameMap.getOwnMap().size === 0);
|
|
33124
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.getOwnMap().size === 0);
|
|
33125
|
-
directoryToModuleNameMap.redirectsMap.set(options.configFile.path, directoryToModuleNameMap.getOwnMap());
|
|
33126
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.redirectsMap.set(options.configFile.path, moduleNameToDirectoryMap.getOwnMap());
|
|
33127
|
-
} else {
|
|
33128
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size > 0);
|
|
33129
|
-
const ref = {
|
|
33130
|
-
sourceFile: options.configFile,
|
|
33131
|
-
commandLine: { options }
|
|
33132
|
-
};
|
|
33133
|
-
directoryToModuleNameMap.setOwnMap(directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
|
|
33134
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.setOwnMap(moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
|
|
33135
|
-
}
|
|
33136
|
-
directoryToModuleNameMap.setOwnOptions(options);
|
|
33137
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.setOwnOptions(options);
|
|
33138
|
-
}
|
|
33139
33145
|
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap) {
|
|
33140
33146
|
return {
|
|
33141
33147
|
getOrCreateCacheForDirectory,
|
|
@@ -33146,13 +33152,16 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
|
|
|
33146
33152
|
directoryToModuleNameMap.clear();
|
|
33147
33153
|
}
|
|
33148
33154
|
function update(options) {
|
|
33149
|
-
|
|
33155
|
+
directoryToModuleNameMap.update(options);
|
|
33150
33156
|
}
|
|
33151
33157
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
33152
33158
|
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33153
33159
|
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
|
|
33154
33160
|
}
|
|
33155
33161
|
}
|
|
33162
|
+
function createModeAwareCacheKey(specifier, mode) {
|
|
33163
|
+
return mode === void 0 ? specifier : `${mode}|${specifier}`;
|
|
33164
|
+
}
|
|
33156
33165
|
function createModeAwareCache() {
|
|
33157
33166
|
const underlying = /* @__PURE__ */ new Map();
|
|
33158
33167
|
const memoizedReverseKeys = /* @__PURE__ */ new Map();
|
|
@@ -33183,7 +33192,7 @@ function createModeAwareCache() {
|
|
|
33183
33192
|
};
|
|
33184
33193
|
return cache;
|
|
33185
33194
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
33186
|
-
const result =
|
|
33195
|
+
const result = createModeAwareCacheKey(specifier, mode);
|
|
33187
33196
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
33188
33197
|
return result;
|
|
33189
33198
|
}
|
|
@@ -33203,9 +33212,10 @@ function zipToModeAwareCache(file, keys, values) {
|
|
|
33203
33212
|
}
|
|
33204
33213
|
return map2;
|
|
33205
33214
|
}
|
|
33206
|
-
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options
|
|
33207
|
-
const
|
|
33208
|
-
|
|
33215
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
33216
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
33217
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
|
|
33218
|
+
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
33209
33219
|
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
33210
33220
|
return {
|
|
33211
33221
|
...packageJsonInfoCache,
|
|
@@ -33225,11 +33235,12 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33225
33235
|
moduleNameToDirectoryMap.clear();
|
|
33226
33236
|
}
|
|
33227
33237
|
function update(options2) {
|
|
33228
|
-
|
|
33238
|
+
directoryToModuleNameMap.update(options2);
|
|
33239
|
+
moduleNameToDirectoryMap.update(options2);
|
|
33229
33240
|
}
|
|
33230
33241
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
33231
33242
|
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33232
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference,
|
|
33243
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
|
|
33233
33244
|
}
|
|
33234
33245
|
function createPerModuleNameCache() {
|
|
33235
33246
|
const directoryPathMap = /* @__PURE__ */ new Map();
|
|
@@ -33277,8 +33288,9 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33277
33288
|
}
|
|
33278
33289
|
}
|
|
33279
33290
|
}
|
|
33280
|
-
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache
|
|
33281
|
-
const
|
|
33291
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
33292
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
33293
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
|
|
33282
33294
|
packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
|
|
33283
33295
|
return {
|
|
33284
33296
|
...packageJsonInfoCache,
|
|
@@ -33525,38 +33537,42 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
33525
33537
|
resolutionMode
|
|
33526
33538
|
);
|
|
33527
33539
|
}
|
|
33528
|
-
var jsOnlyExtensions = [1 /* JavaScript */];
|
|
33529
|
-
var tsExtensions = [0 /* TypeScript */, 1 /* JavaScript */];
|
|
33530
|
-
var tsPlusJsonExtensions = [...tsExtensions, 2 /* Json */];
|
|
33531
|
-
var tsconfigExtensions = [3 /* TSConfig */];
|
|
33532
33540
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
33533
33541
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
33534
33542
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
33535
|
-
let extensions = compilerOptions.noDtsResolution ?
|
|
33543
|
+
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
33536
33544
|
if (compilerOptions.resolveJsonModule) {
|
|
33537
|
-
extensions
|
|
33545
|
+
extensions |= 8 /* Json */;
|
|
33538
33546
|
}
|
|
33539
|
-
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
|
|
33547
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
|
|
33540
33548
|
}
|
|
33541
33549
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
33542
|
-
return nodeModuleNameResolverWorker(
|
|
33550
|
+
return nodeModuleNameResolverWorker(
|
|
33551
|
+
0 /* None */,
|
|
33552
|
+
moduleName,
|
|
33553
|
+
initialDir,
|
|
33554
|
+
{ moduleResolution: 2 /* NodeJs */, allowJs: true },
|
|
33555
|
+
host,
|
|
33556
|
+
void 0,
|
|
33557
|
+
2 /* JavaScript */,
|
|
33558
|
+
false,
|
|
33559
|
+
void 0
|
|
33560
|
+
);
|
|
33543
33561
|
}
|
|
33544
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference,
|
|
33562
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
33545
33563
|
let extensions;
|
|
33546
|
-
if (
|
|
33547
|
-
extensions =
|
|
33564
|
+
if (isConfigLookup) {
|
|
33565
|
+
extensions = 8 /* Json */;
|
|
33548
33566
|
} else if (compilerOptions.noDtsResolution) {
|
|
33549
|
-
extensions =
|
|
33550
|
-
if (compilerOptions.allowJs)
|
|
33551
|
-
extensions.push(1 /* JavaScript */);
|
|
33567
|
+
extensions = 3 /* ImplementationFiles */;
|
|
33552
33568
|
if (compilerOptions.resolveJsonModule)
|
|
33553
|
-
extensions
|
|
33569
|
+
extensions |= 8 /* Json */;
|
|
33554
33570
|
} else {
|
|
33555
|
-
extensions = compilerOptions.resolveJsonModule ?
|
|
33571
|
+
extensions = compilerOptions.resolveJsonModule ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
33556
33572
|
}
|
|
33557
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
|
|
33573
|
+
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
33558
33574
|
}
|
|
33559
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
33575
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
33560
33576
|
var _a2, _b;
|
|
33561
33577
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
33562
33578
|
const failedLookupLocations = [];
|
|
@@ -33576,12 +33592,20 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
33576
33592
|
features,
|
|
33577
33593
|
conditions,
|
|
33578
33594
|
requestContainingDirectory: containingDirectory,
|
|
33579
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
33595
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
33596
|
+
isConfigLookup
|
|
33580
33597
|
};
|
|
33581
33598
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
33582
33599
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
33583
33600
|
}
|
|
33584
|
-
|
|
33601
|
+
let result;
|
|
33602
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* NodeJs */) {
|
|
33603
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
33604
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
33605
|
+
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
33606
|
+
} else {
|
|
33607
|
+
result = tryResolve(extensions);
|
|
33608
|
+
}
|
|
33585
33609
|
return createResolvedModuleWithFailedLookupLocations(
|
|
33586
33610
|
(_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
|
|
33587
33611
|
(_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
|
|
@@ -33606,7 +33630,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
33606
33630
|
}
|
|
33607
33631
|
if (!resolved2) {
|
|
33608
33632
|
if (traceEnabled) {
|
|
33609
|
-
trace(host, Diagnostics.
|
|
33633
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
33610
33634
|
}
|
|
33611
33635
|
resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
33612
33636
|
}
|
|
@@ -33647,7 +33671,7 @@ function realPath(path, host, traceEnabled) {
|
|
|
33647
33671
|
}
|
|
33648
33672
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
33649
33673
|
if (state.traceEnabled) {
|
|
33650
|
-
trace(state.host, Diagnostics.
|
|
33674
|
+
trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions));
|
|
33651
33675
|
}
|
|
33652
33676
|
if (!hasTrailingDirectorySeparator(candidate)) {
|
|
33653
33677
|
if (!onlyRecordFailures) {
|
|
@@ -33705,10 +33729,9 @@ function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures
|
|
|
33705
33729
|
return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
|
|
33706
33730
|
}
|
|
33707
33731
|
function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
33708
|
-
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
return extensionLess === void 0 && extensions === 2 /* Json */ ? void 0 : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state);
|
|
33732
|
+
const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
33733
|
+
if (resolvedByReplacingExtension) {
|
|
33734
|
+
return resolvedByReplacingExtension;
|
|
33712
33735
|
}
|
|
33713
33736
|
if (!(state.features & 32 /* EsmMode */)) {
|
|
33714
33737
|
const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state);
|
|
@@ -33716,10 +33739,9 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
33716
33739
|
return resolvedByAddingExtension;
|
|
33717
33740
|
}
|
|
33718
33741
|
}
|
|
33719
|
-
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
33720
33742
|
}
|
|
33721
33743
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
33722
|
-
if (hasJSFileExtension(candidate) || fileExtensionIs(candidate, ".json" /* Json */)
|
|
33744
|
+
if (hasJSFileExtension(candidate) || extensions & 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
|
|
33723
33745
|
const extensionless = removeFileExtension(candidate);
|
|
33724
33746
|
const extension = candidate.substring(extensionless.length);
|
|
33725
33747
|
if (state.traceEnabled) {
|
|
@@ -33729,7 +33751,7 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
|
|
|
33729
33751
|
}
|
|
33730
33752
|
}
|
|
33731
33753
|
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
33732
|
-
if (
|
|
33754
|
+
if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
|
|
33733
33755
|
const result = tryFile(candidate, onlyRecordFailures, state);
|
|
33734
33756
|
return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate) } : void 0;
|
|
33735
33757
|
}
|
|
@@ -33742,59 +33764,32 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
33742
33764
|
onlyRecordFailures = !directoryProbablyExists(directory, state.host);
|
|
33743
33765
|
}
|
|
33744
33766
|
}
|
|
33745
|
-
switch (
|
|
33746
|
-
case
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
|
|
33752
|
-
|
|
33753
|
-
|
|
33754
|
-
|
|
33755
|
-
|
|
33756
|
-
|
|
33757
|
-
|
|
33758
|
-
|
|
33759
|
-
|
|
33760
|
-
return
|
|
33761
|
-
}
|
|
33762
|
-
case 0 /* TypeScript */:
|
|
33763
|
-
case 5 /* TsOnly */:
|
|
33764
|
-
const useDts = extensions === 0 /* TypeScript */;
|
|
33765
|
-
switch (originalExtension) {
|
|
33766
|
-
case ".mjs" /* Mjs */:
|
|
33767
|
-
case ".mts" /* Mts */:
|
|
33768
|
-
case ".d.mts" /* Dmts */:
|
|
33769
|
-
return tryExtension(".mts" /* Mts */) || (useDts ? tryExtension(".d.mts" /* Dmts */) : void 0);
|
|
33770
|
-
case ".cjs" /* Cjs */:
|
|
33771
|
-
case ".cts" /* Cts */:
|
|
33772
|
-
case ".d.cts" /* Dcts */:
|
|
33773
|
-
return tryExtension(".cts" /* Cts */) || (useDts ? tryExtension(".d.cts" /* Dcts */) : void 0);
|
|
33774
|
-
case ".json" /* Json */:
|
|
33775
|
-
candidate += ".json" /* Json */;
|
|
33776
|
-
return useDts ? tryExtension(".d.ts" /* Dts */) : void 0;
|
|
33777
|
-
default:
|
|
33778
|
-
return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || (useDts ? tryExtension(".d.ts" /* Dts */) : void 0);
|
|
33779
|
-
}
|
|
33780
|
-
case 1 /* JavaScript */:
|
|
33781
|
-
switch (originalExtension) {
|
|
33782
|
-
case ".mjs" /* Mjs */:
|
|
33783
|
-
case ".mts" /* Mts */:
|
|
33784
|
-
case ".d.mts" /* Dmts */:
|
|
33785
|
-
return tryExtension(".mjs" /* Mjs */);
|
|
33786
|
-
case ".cjs" /* Cjs */:
|
|
33787
|
-
case ".cts" /* Cts */:
|
|
33788
|
-
case ".d.cts" /* Dcts */:
|
|
33789
|
-
return tryExtension(".cjs" /* Cjs */);
|
|
33790
|
-
case ".json" /* Json */:
|
|
33791
|
-
return tryExtension(".json" /* Json */);
|
|
33792
|
-
default:
|
|
33793
|
-
return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */);
|
|
33767
|
+
switch (originalExtension) {
|
|
33768
|
+
case ".mjs" /* Mjs */:
|
|
33769
|
+
case ".mts" /* Mts */:
|
|
33770
|
+
case ".d.mts" /* Dmts */:
|
|
33771
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0;
|
|
33772
|
+
case ".cjs" /* Cjs */:
|
|
33773
|
+
case ".cts" /* Cts */:
|
|
33774
|
+
case ".d.cts" /* Dcts */:
|
|
33775
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0;
|
|
33776
|
+
case ".json" /* Json */:
|
|
33777
|
+
const originalCandidate = candidate;
|
|
33778
|
+
if (extensions & 4 /* Declaration */) {
|
|
33779
|
+
candidate += ".json" /* Json */;
|
|
33780
|
+
const result = tryExtension(".d.ts" /* Dts */);
|
|
33781
|
+
if (result)
|
|
33782
|
+
return result;
|
|
33794
33783
|
}
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
33784
|
+
if (extensions & 8 /* Json */) {
|
|
33785
|
+
candidate = originalCandidate;
|
|
33786
|
+
const result = tryExtension(".json" /* Json */);
|
|
33787
|
+
if (result)
|
|
33788
|
+
return result;
|
|
33789
|
+
}
|
|
33790
|
+
return void 0;
|
|
33791
|
+
default:
|
|
33792
|
+
return extensions & 1 /* TypeScript */ && (tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */) || extensions & 2 /* JavaScript */ && (tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */)) || state.isConfigLookup && tryExtension(".json" /* Json */) || void 0;
|
|
33798
33793
|
}
|
|
33799
33794
|
function tryExtension(ext) {
|
|
33800
33795
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
@@ -33829,7 +33824,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
|
|
|
33829
33824
|
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
|
|
33830
33825
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
33831
33826
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
33832
|
-
const versionPaths = packageInfo && packageInfo
|
|
33827
|
+
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
33833
33828
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
33834
33829
|
}
|
|
33835
33830
|
function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) {
|
|
@@ -33843,7 +33838,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
|
|
|
33843
33838
|
features: 0 /* None */,
|
|
33844
33839
|
conditions: emptyArray,
|
|
33845
33840
|
requestContainingDirectory: void 0,
|
|
33846
|
-
reportDiagnostic: noop
|
|
33841
|
+
reportDiagnostic: noop,
|
|
33842
|
+
isConfigLookup: false
|
|
33847
33843
|
};
|
|
33848
33844
|
}
|
|
33849
33845
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -33858,6 +33854,12 @@ function getPackageScopeForPath(fileName, state) {
|
|
|
33858
33854
|
}
|
|
33859
33855
|
return void 0;
|
|
33860
33856
|
}
|
|
33857
|
+
function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
33858
|
+
if (packageJsonInfo.contents.versionPaths === void 0) {
|
|
33859
|
+
packageJsonInfo.contents.versionPaths = readPackageJsonTypesVersionPaths(packageJsonInfo.contents.packageJsonContent, state) || false;
|
|
33860
|
+
}
|
|
33861
|
+
return packageJsonInfo.contents.versionPaths || void 0;
|
|
33862
|
+
}
|
|
33861
33863
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
33862
33864
|
var _a2, _b, _c;
|
|
33863
33865
|
const { host, traceEnabled } = state;
|
|
@@ -33886,8 +33888,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
33886
33888
|
if (traceEnabled) {
|
|
33887
33889
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
33888
33890
|
}
|
|
33889
|
-
const
|
|
33890
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths, resolvedEntrypoints: void 0 } };
|
|
33891
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
33891
33892
|
(_b = state.packageJsonInfoCache) == null ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
|
|
33892
33893
|
state.affectingLocations.push(packageJsonPath);
|
|
33893
33894
|
return result;
|
|
@@ -33902,23 +33903,10 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
33902
33903
|
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
|
|
33903
33904
|
let packageFile;
|
|
33904
33905
|
if (jsonContent) {
|
|
33905
|
-
|
|
33906
|
-
|
|
33907
|
-
|
|
33908
|
-
|
|
33909
|
-
packageFile = readPackageJsonMainField(jsonContent, candidate, state);
|
|
33910
|
-
break;
|
|
33911
|
-
case 0 /* TypeScript */:
|
|
33912
|
-
packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state);
|
|
33913
|
-
break;
|
|
33914
|
-
case 4 /* DtsOnly */:
|
|
33915
|
-
packageFile = readPackageJsonTypesFields(jsonContent, candidate, state);
|
|
33916
|
-
break;
|
|
33917
|
-
case 3 /* TSConfig */:
|
|
33918
|
-
packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
|
|
33919
|
-
break;
|
|
33920
|
-
default:
|
|
33921
|
-
return Debug.assertNever(extensions);
|
|
33906
|
+
if (state.isConfigLookup) {
|
|
33907
|
+
packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
|
|
33908
|
+
} else {
|
|
33909
|
+
packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
|
|
33922
33910
|
}
|
|
33923
33911
|
}
|
|
33924
33912
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
@@ -33932,18 +33920,18 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
33932
33920
|
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
|
|
33933
33921
|
}
|
|
33934
33922
|
}
|
|
33935
|
-
const
|
|
33923
|
+
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
33936
33924
|
const features = state2.features;
|
|
33937
33925
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
33938
33926
|
state2.features &= ~32 /* EsmMode */;
|
|
33939
33927
|
}
|
|
33940
|
-
const result = nodeLoadModuleByRelativeName(
|
|
33928
|
+
const result = nodeLoadModuleByRelativeName(expandedExtensions, candidate2, onlyRecordFailures2, state2, false);
|
|
33941
33929
|
state2.features = features;
|
|
33942
33930
|
return result;
|
|
33943
33931
|
};
|
|
33944
33932
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
33945
33933
|
const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host);
|
|
33946
|
-
const indexPath = combinePaths(candidate,
|
|
33934
|
+
const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index");
|
|
33947
33935
|
if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) {
|
|
33948
33936
|
const moduleName = getRelativePathFromDirectory(candidate, packageFile || indexPath, false);
|
|
33949
33937
|
if (state.traceEnabled) {
|
|
@@ -33966,19 +33954,7 @@ function resolvedIfExtensionMatches(extensions, path) {
|
|
|
33966
33954
|
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext } : void 0;
|
|
33967
33955
|
}
|
|
33968
33956
|
function extensionIsOk(extensions, extension) {
|
|
33969
|
-
|
|
33970
|
-
case 1 /* JavaScript */:
|
|
33971
|
-
return extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */;
|
|
33972
|
-
case 3 /* TSConfig */:
|
|
33973
|
-
case 2 /* Json */:
|
|
33974
|
-
return extension === ".json" /* Json */;
|
|
33975
|
-
case 0 /* TypeScript */:
|
|
33976
|
-
return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */ || extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */;
|
|
33977
|
-
case 5 /* TsOnly */:
|
|
33978
|
-
return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */;
|
|
33979
|
-
case 4 /* DtsOnly */:
|
|
33980
|
-
return extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */;
|
|
33981
|
-
}
|
|
33957
|
+
return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
|
|
33982
33958
|
}
|
|
33983
33959
|
function parsePackageName(moduleName) {
|
|
33984
33960
|
let idx = moduleName.indexOf(directorySeparator);
|
|
@@ -34140,7 +34116,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34140
34116
|
const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
|
|
34141
34117
|
traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
|
|
34142
34118
|
traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
|
|
34143
|
-
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache,
|
|
34119
|
+
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, false, redirectedReference);
|
|
34144
34120
|
return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : void 0);
|
|
34145
34121
|
}
|
|
34146
34122
|
if (state.traceEnabled) {
|
|
@@ -34231,7 +34207,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34231
34207
|
}
|
|
34232
34208
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
34233
34209
|
var _a2, _b, _c, _d;
|
|
34234
|
-
if (
|
|
34210
|
+
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
34235
34211
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
|
34236
34212
|
const commonSourceDirGuesses = [];
|
|
34237
34213
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -34268,10 +34244,9 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34268
34244
|
if (fileExtensionIs(possibleInputBase, ext)) {
|
|
34269
34245
|
const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase);
|
|
34270
34246
|
for (const possibleExt of inputExts) {
|
|
34271
|
-
|
|
34272
|
-
if (extensions === 0 /* TypeScript */ && hasJSFileExtension(possibleInputWithInputExtension) || extensions === 1 /* JavaScript */ && hasTSFileExtension(possibleInputWithInputExtension)) {
|
|
34247
|
+
if (!extensionIsOk(extensions, possibleExt))
|
|
34273
34248
|
continue;
|
|
34274
|
-
|
|
34249
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
34275
34250
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
34276
34251
|
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
|
|
34277
34252
|
}
|
|
@@ -34312,19 +34287,31 @@ function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, direc
|
|
|
34312
34287
|
return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference);
|
|
34313
34288
|
}
|
|
34314
34289
|
function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) {
|
|
34315
|
-
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /*
|
|
34290
|
+
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
34316
34291
|
}
|
|
34317
34292
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34318
34293
|
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */, redirectedReference);
|
|
34319
|
-
|
|
34320
|
-
|
|
34321
|
-
|
|
34322
|
-
|
|
34323
|
-
|
|
34294
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
34295
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
34296
|
+
if (priorityExtensions) {
|
|
34297
|
+
const result = lookup(priorityExtensions);
|
|
34298
|
+
if (result)
|
|
34299
|
+
return result;
|
|
34300
|
+
}
|
|
34301
|
+
if (secondaryExtensions && !typesScopeOnly) {
|
|
34302
|
+
return lookup(secondaryExtensions);
|
|
34303
|
+
}
|
|
34304
|
+
function lookup(extensions2) {
|
|
34305
|
+
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
34306
|
+
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
34307
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
|
|
34308
|
+
if (resolutionFromCache) {
|
|
34309
|
+
return resolutionFromCache;
|
|
34310
|
+
}
|
|
34311
|
+
return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
|
|
34324
34312
|
}
|
|
34325
|
-
|
|
34326
|
-
|
|
34327
|
-
});
|
|
34313
|
+
});
|
|
34314
|
+
}
|
|
34328
34315
|
}
|
|
34329
34316
|
function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34330
34317
|
const nodeModulesFolder = combinePaths(directory, "node_modules");
|
|
@@ -34332,11 +34319,13 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
|
|
|
34332
34319
|
if (!nodeModulesFolderExists && state.traceEnabled) {
|
|
34333
34320
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);
|
|
34334
34321
|
}
|
|
34335
|
-
|
|
34336
|
-
|
|
34337
|
-
|
|
34322
|
+
if (!typesScopeOnly) {
|
|
34323
|
+
const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
|
|
34324
|
+
if (packageResult) {
|
|
34325
|
+
return packageResult;
|
|
34326
|
+
}
|
|
34338
34327
|
}
|
|
34339
|
-
if (extensions
|
|
34328
|
+
if (extensions & 4 /* Declaration */) {
|
|
34340
34329
|
const nodeModulesAtTypes2 = combinePaths(nodeModulesFolder, "@types");
|
|
34341
34330
|
let nodeModulesAtTypesExists = nodeModulesFolderExists;
|
|
34342
34331
|
if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes2, state.host)) {
|
|
@@ -34345,7 +34334,7 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
|
|
|
34345
34334
|
}
|
|
34346
34335
|
nodeModulesAtTypesExists = false;
|
|
34347
34336
|
}
|
|
34348
|
-
return loadModuleFromSpecificNodeModulesDirectory(4 /*
|
|
34337
|
+
return loadModuleFromSpecificNodeModulesDirectory(4 /* Declaration */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference);
|
|
34349
34338
|
}
|
|
34350
34339
|
}
|
|
34351
34340
|
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
@@ -34364,7 +34353,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
34364
34353
|
!nodeModulesDirectoryExists,
|
|
34365
34354
|
state,
|
|
34366
34355
|
packageInfo.contents.packageJsonContent,
|
|
34367
|
-
packageInfo
|
|
34356
|
+
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
34368
34357
|
);
|
|
34369
34358
|
return withPackageId(packageInfo, fromDirectory);
|
|
34370
34359
|
}
|
|
@@ -34376,7 +34365,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
34376
34365
|
onlyRecordFailures,
|
|
34377
34366
|
state2,
|
|
34378
34367
|
packageInfo && packageInfo.contents.packageJsonContent,
|
|
34379
|
-
packageInfo && packageInfo
|
|
34368
|
+
packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
|
|
34380
34369
|
);
|
|
34381
34370
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
34382
34371
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
@@ -34391,12 +34380,13 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
34391
34380
|
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) {
|
|
34392
34381
|
return (_a2 = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _a2.value;
|
|
34393
34382
|
}
|
|
34394
|
-
|
|
34383
|
+
const versionPaths = rest !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0;
|
|
34384
|
+
if (versionPaths) {
|
|
34395
34385
|
if (state.traceEnabled) {
|
|
34396
|
-
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,
|
|
34386
|
+
trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest);
|
|
34397
34387
|
}
|
|
34398
34388
|
const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
|
|
34399
|
-
const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory,
|
|
34389
|
+
const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, versionPaths.paths, void 0, loader, !packageDirectoryExists, state);
|
|
34400
34390
|
if (fromPaths) {
|
|
34401
34391
|
return fromPaths.value;
|
|
34402
34392
|
}
|
|
@@ -34486,9 +34476,10 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34486
34476
|
features: 0 /* None */,
|
|
34487
34477
|
conditions: [],
|
|
34488
34478
|
requestContainingDirectory: containingDirectory,
|
|
34489
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
34479
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
34480
|
+
isConfigLookup: false
|
|
34490
34481
|
};
|
|
34491
|
-
const resolved = tryResolve(
|
|
34482
|
+
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
34492
34483
|
return createResolvedModuleWithFailedLookupLocations(
|
|
34493
34484
|
resolved && resolved.value,
|
|
34494
34485
|
false,
|
|
@@ -34515,7 +34506,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34515
34506
|
if (resolved2) {
|
|
34516
34507
|
return resolved2;
|
|
34517
34508
|
}
|
|
34518
|
-
if (extensions
|
|
34509
|
+
if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
|
|
34519
34510
|
return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
|
|
34520
34511
|
}
|
|
34521
34512
|
} else {
|
|
@@ -34542,9 +34533,10 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
34542
34533
|
features: 0 /* None */,
|
|
34543
34534
|
conditions: [],
|
|
34544
34535
|
requestContainingDirectory: void 0,
|
|
34545
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
34536
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
34537
|
+
isConfigLookup: false
|
|
34546
34538
|
};
|
|
34547
|
-
const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /*
|
|
34539
|
+
const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /* Declaration */, moduleName, globalCache, state, false, void 0, void 0);
|
|
34548
34540
|
return createResolvedModuleWithFailedLookupLocations(
|
|
34549
34541
|
resolved,
|
|
34550
34542
|
true,
|
|
@@ -37494,6 +37486,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
37494
37486
|
const importedFileIsInNodeModules = some(modulePaths, (p) => p.isInNodeModules);
|
|
37495
37487
|
let nodeModulesSpecifiers;
|
|
37496
37488
|
let pathsSpecifiers;
|
|
37489
|
+
let redirectPathsSpecifiers;
|
|
37497
37490
|
let relativeSpecifiers;
|
|
37498
37491
|
for (const modulePath of modulePaths) {
|
|
37499
37492
|
const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, void 0, options.overrideImportMode);
|
|
@@ -37502,34 +37495,53 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
37502
37495
|
return nodeModulesSpecifiers;
|
|
37503
37496
|
}
|
|
37504
37497
|
if (!specifier) {
|
|
37505
|
-
const local = getLocalModuleSpecifier(
|
|
37506
|
-
|
|
37498
|
+
const local = getLocalModuleSpecifier(
|
|
37499
|
+
modulePath.path,
|
|
37500
|
+
info,
|
|
37501
|
+
compilerOptions,
|
|
37502
|
+
host,
|
|
37503
|
+
options.overrideImportMode || importingSourceFile.impliedNodeFormat,
|
|
37504
|
+
preferences,
|
|
37505
|
+
modulePath.isRedirect
|
|
37506
|
+
);
|
|
37507
|
+
if (!local) {
|
|
37508
|
+
continue;
|
|
37509
|
+
}
|
|
37510
|
+
if (modulePath.isRedirect) {
|
|
37511
|
+
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
37512
|
+
} else if (pathIsBareSpecifier(local)) {
|
|
37507
37513
|
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
37508
|
-
} else if (!
|
|
37514
|
+
} else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
37509
37515
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
37510
37516
|
}
|
|
37511
37517
|
}
|
|
37512
37518
|
}
|
|
37513
|
-
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
|
|
37519
|
+
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
|
|
37514
37520
|
}
|
|
37515
37521
|
function getInfo(importingSourceFileName, host) {
|
|
37516
37522
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
|
|
37517
37523
|
const sourceDirectory = getDirectoryPath(importingSourceFileName);
|
|
37518
37524
|
return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
|
|
37519
37525
|
}
|
|
37520
|
-
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }) {
|
|
37526
|
+
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }, pathsOnly) {
|
|
37521
37527
|
const { baseUrl, paths, rootDirs } = compilerOptions;
|
|
37528
|
+
if (pathsOnly && !paths) {
|
|
37529
|
+
return void 0;
|
|
37530
|
+
}
|
|
37522
37531
|
const { sourceDirectory, getCanonicalFileName } = info;
|
|
37523
37532
|
const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
|
|
37524
37533
|
if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
|
|
37525
|
-
return relativePath;
|
|
37534
|
+
return pathsOnly ? void 0 : relativePath;
|
|
37526
37535
|
}
|
|
37527
37536
|
const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
|
|
37528
37537
|
const relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName);
|
|
37529
37538
|
if (!relativeToBaseUrl) {
|
|
37530
|
-
return relativePath;
|
|
37539
|
+
return pathsOnly ? void 0 : relativePath;
|
|
37531
37540
|
}
|
|
37532
37541
|
const fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
|
|
37542
|
+
if (pathsOnly) {
|
|
37543
|
+
return fromPaths;
|
|
37544
|
+
}
|
|
37533
37545
|
const maybeNonRelative = fromPaths === void 0 && baseUrl !== void 0 ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
|
|
37534
37546
|
if (!maybeNonRelative) {
|
|
37535
37547
|
return relativePath;
|
|
@@ -38113,6 +38125,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
38113
38125
|
return CheckMode3;
|
|
38114
38126
|
})(CheckMode || {});
|
|
38115
38127
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
38128
|
+
SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None";
|
|
38116
38129
|
SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback";
|
|
38117
38130
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
38118
38131
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
@@ -38130,7 +38143,7 @@ var intrinsicTypeKinds = new Map(getEntries({
|
|
|
38130
38143
|
function SymbolLinks() {
|
|
38131
38144
|
}
|
|
38132
38145
|
function NodeLinks() {
|
|
38133
|
-
this.flags = 0
|
|
38146
|
+
this.flags = 0 /* None */;
|
|
38134
38147
|
}
|
|
38135
38148
|
function getNodeId(node) {
|
|
38136
38149
|
if (!node.id) {
|
|
@@ -38975,7 +38988,7 @@ function createTypeChecker(host) {
|
|
|
38975
38988
|
function createSymbol(flags, name, checkFlags) {
|
|
38976
38989
|
symbolCount++;
|
|
38977
38990
|
const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
|
|
38978
|
-
symbol.checkFlags = checkFlags || 0
|
|
38991
|
+
symbol.checkFlags = checkFlags || 0 /* None */;
|
|
38979
38992
|
return symbol;
|
|
38980
38993
|
}
|
|
38981
38994
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -41286,7 +41299,7 @@ function createTypeChecker(host) {
|
|
|
41286
41299
|
function createOriginType(flags) {
|
|
41287
41300
|
return new Type7(checker, flags);
|
|
41288
41301
|
}
|
|
41289
|
-
function createIntrinsicType(kind, intrinsicName, objectFlags = 0) {
|
|
41302
|
+
function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
|
|
41290
41303
|
const type = createType(kind);
|
|
41291
41304
|
type.intrinsicName = intrinsicName;
|
|
41292
41305
|
type.objectFlags = objectFlags;
|
|
@@ -41781,25 +41794,22 @@ function createTypeChecker(host) {
|
|
|
41781
41794
|
const context = {
|
|
41782
41795
|
enclosingDeclaration,
|
|
41783
41796
|
flags: flags || 0 /* None */,
|
|
41784
|
-
tracker: tracker && tracker.trackSymbol ? tracker : {
|
|
41785
|
-
|
|
41786
|
-
|
|
41787
|
-
|
|
41788
|
-
|
|
41789
|
-
|
|
41790
|
-
getPackageJsonInfoCache: ()
|
|
41791
|
-
|
|
41792
|
-
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
41797
|
-
|
|
41798
|
-
|
|
41799
|
-
|
|
41800
|
-
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
41801
|
-
} : void 0
|
|
41802
|
-
},
|
|
41797
|
+
tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: () => false, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
|
|
41798
|
+
getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "",
|
|
41799
|
+
getCurrentDirectory: () => host.getCurrentDirectory(),
|
|
41800
|
+
getSymlinkCache: maybeBind(host, host.getSymlinkCache),
|
|
41801
|
+
getPackageJsonInfoCache: () => {
|
|
41802
|
+
var _a3;
|
|
41803
|
+
return (_a3 = host.getPackageJsonInfoCache) == null ? void 0 : _a3.call(host);
|
|
41804
|
+
},
|
|
41805
|
+
useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames),
|
|
41806
|
+
redirectTargetsMap: host.redirectTargetsMap,
|
|
41807
|
+
getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName),
|
|
41808
|
+
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
|
41809
|
+
fileExists: (fileName) => host.fileExists(fileName),
|
|
41810
|
+
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
|
41811
|
+
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
41812
|
+
} : void 0 },
|
|
41803
41813
|
encounteredError: false,
|
|
41804
41814
|
reportedDiagnostic: false,
|
|
41805
41815
|
visitedTypes: void 0,
|
|
@@ -41927,7 +41937,7 @@ function createTypeChecker(host) {
|
|
|
41927
41937
|
}
|
|
41928
41938
|
if (type.flags & 128 /* StringLiteral */) {
|
|
41929
41939
|
context.approximateLength += type.value.length + 2;
|
|
41930
|
-
return factory.createLiteralTypeNode(setEmitFlags(factory.createStringLiteral(type.value, !!(context.flags & 268435456 /* UseSingleQuotesForStringLiteralType */)),
|
|
41940
|
+
return factory.createLiteralTypeNode(setEmitFlags(factory.createStringLiteral(type.value, !!(context.flags & 268435456 /* UseSingleQuotesForStringLiteralType */)), 33554432 /* NoAsciiEscaping */));
|
|
41931
41941
|
}
|
|
41932
41942
|
if (type.flags & 256 /* NumberLiteral */) {
|
|
41933
41943
|
const value = type.value;
|
|
@@ -42672,7 +42682,7 @@ function createTypeChecker(host) {
|
|
|
42672
42682
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
42673
42683
|
if (typePredicate) {
|
|
42674
42684
|
const assertsModifier = typePredicate.kind === 2 /* AssertsThis */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? factory.createToken(129 /* AssertsKeyword */) : void 0;
|
|
42675
|
-
const parameterName = typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? setEmitFlags(factory.createIdentifier(typePredicate.parameterName),
|
|
42685
|
+
const parameterName = typePredicate.kind === 1 /* Identifier */ || typePredicate.kind === 3 /* AssertsIdentifier */ ? setEmitFlags(factory.createIdentifier(typePredicate.parameterName), 33554432 /* NoAsciiEscaping */) : factory.createThisTypeNode();
|
|
42676
42686
|
const typeNode = typePredicate.type && typeToTypeNodeHelper(typePredicate.type, context);
|
|
42677
42687
|
returnTypeNode = factory.createTypePredicateNode(assertsModifier, parameterName, typeNode);
|
|
42678
42688
|
} else {
|
|
@@ -42738,7 +42748,7 @@ function createTypeChecker(host) {
|
|
|
42738
42748
|
const modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map(getModifiers(parameterDeclaration), factory.cloneNode) : void 0;
|
|
42739
42749
|
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768 /* RestParameter */;
|
|
42740
42750
|
const dotDotDotToken = isRest ? factory.createToken(25 /* DotDotDotToken */) : void 0;
|
|
42741
|
-
const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name),
|
|
42751
|
+
const name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 /* Identifier */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name), 33554432 /* NoAsciiEscaping */) : parameterDeclaration.name.kind === 163 /* QualifiedName */ ? setEmitFlags(factory.cloneNode(parameterDeclaration.name.right), 33554432 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol);
|
|
42742
42752
|
const isOptional = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384 /* OptionalParameter */;
|
|
42743
42753
|
const questionToken = isOptional ? factory.createToken(57 /* QuestionToken */) : void 0;
|
|
42744
42754
|
const parameterNode = factory.createParameterDeclaration(
|
|
@@ -42770,7 +42780,7 @@ function createTypeChecker(host) {
|
|
|
42770
42780
|
if (!nodeIsSynthesized(visited)) {
|
|
42771
42781
|
visited = factory.cloneNode(visited);
|
|
42772
42782
|
}
|
|
42773
|
-
return setEmitFlags(visited, 1 /* SingleLine */ |
|
|
42783
|
+
return setEmitFlags(visited, 1 /* SingleLine */ | 33554432 /* NoAsciiEscaping */);
|
|
42774
42784
|
}
|
|
42775
42785
|
}
|
|
42776
42786
|
}
|
|
@@ -42917,7 +42927,7 @@ function createTypeChecker(host) {
|
|
|
42917
42927
|
}
|
|
42918
42928
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
42919
42929
|
const resolutionMode = overrideImportMode || (contextFile == null ? void 0 : contextFile.impliedNodeFormat);
|
|
42920
|
-
const cacheKey =
|
|
42930
|
+
const cacheKey = createModeAwareCacheKey(contextFile.path, resolutionMode);
|
|
42921
42931
|
const links = getSymbolLinks(symbol);
|
|
42922
42932
|
let specifier = links.specifierCache && links.specifierCache.get(cacheKey);
|
|
42923
42933
|
if (!specifier) {
|
|
@@ -42940,9 +42950,6 @@ function createTypeChecker(host) {
|
|
|
42940
42950
|
links.specifierCache.set(cacheKey, specifier);
|
|
42941
42951
|
}
|
|
42942
42952
|
return specifier;
|
|
42943
|
-
function getSpecifierCacheKey(path, mode) {
|
|
42944
|
-
return mode === void 0 ? path : `${mode}|${path}`;
|
|
42945
|
-
}
|
|
42946
42953
|
}
|
|
42947
42954
|
function symbolToEntityNameNode(symbol) {
|
|
42948
42955
|
const identifier = factory.createIdentifier(unescapeLeadingUnderscores(symbol.escapedName));
|
|
@@ -43067,7 +43074,7 @@ function createTypeChecker(host) {
|
|
|
43067
43074
|
return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2)));
|
|
43068
43075
|
}
|
|
43069
43076
|
}
|
|
43070
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes),
|
|
43077
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
|
|
43071
43078
|
identifier.symbol = symbol2;
|
|
43072
43079
|
if (index > stopper) {
|
|
43073
43080
|
const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper);
|
|
@@ -43134,7 +43141,7 @@ function createTypeChecker(host) {
|
|
|
43134
43141
|
if (index === 0) {
|
|
43135
43142
|
context.flags ^= 16777216 /* InInitialEntityName */;
|
|
43136
43143
|
}
|
|
43137
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes),
|
|
43144
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
|
|
43138
43145
|
identifier.symbol = symbol2;
|
|
43139
43146
|
return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier;
|
|
43140
43147
|
}
|
|
@@ -43156,9 +43163,8 @@ function createTypeChecker(host) {
|
|
|
43156
43163
|
if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
43157
43164
|
return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
|
|
43158
43165
|
}
|
|
43159
|
-
|
|
43160
|
-
|
|
43161
|
-
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 16777216 /* NoAsciiEscaping */);
|
|
43166
|
+
if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
|
|
43167
|
+
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
|
|
43162
43168
|
identifier.symbol = symbol2;
|
|
43163
43169
|
return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
|
|
43164
43170
|
} else {
|
|
@@ -43173,7 +43179,7 @@ function createTypeChecker(host) {
|
|
|
43173
43179
|
expression = factory.createNumericLiteral(+symbolName2);
|
|
43174
43180
|
}
|
|
43175
43181
|
if (!expression) {
|
|
43176
|
-
expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes),
|
|
43182
|
+
expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
|
|
43177
43183
|
expression.symbol = symbol2;
|
|
43178
43184
|
}
|
|
43179
43185
|
return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression);
|
|
@@ -43189,21 +43195,21 @@ function createTypeChecker(host) {
|
|
|
43189
43195
|
return !!(name && isStringLiteral(name) && (name.singleQuote || !nodeIsSynthesized(name) && startsWith(getTextOfNode(name, false), "'")));
|
|
43190
43196
|
}
|
|
43191
43197
|
function getPropertyNameNodeForSymbol(symbol, context) {
|
|
43198
|
+
const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed);
|
|
43192
43199
|
const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed);
|
|
43193
|
-
const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote);
|
|
43200
|
+
const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed);
|
|
43194
43201
|
if (fromNameType) {
|
|
43195
43202
|
return fromNameType;
|
|
43196
43203
|
}
|
|
43197
43204
|
const rawName = unescapeLeadingUnderscores(symbol.escapedName);
|
|
43198
|
-
const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed);
|
|
43199
43205
|
return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
|
|
43200
43206
|
}
|
|
43201
|
-
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {
|
|
43207
|
+
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed) {
|
|
43202
43208
|
const nameType = getSymbolLinks(symbol).nameType;
|
|
43203
43209
|
if (nameType) {
|
|
43204
43210
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
43205
43211
|
const name = "" + nameType.value;
|
|
43206
|
-
if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
43212
|
+
if (!isIdentifierText(name, getEmitScriptTarget(compilerOptions)) && (stringNamed || !isNumericLiteralName(name))) {
|
|
43207
43213
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
43208
43214
|
}
|
|
43209
43215
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
@@ -43303,7 +43309,7 @@ function createTypeChecker(host) {
|
|
|
43303
43309
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
43304
43310
|
const name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
43305
43311
|
name.symbol = sym;
|
|
43306
|
-
return { introducesError, node: setEmitFlags(setOriginalNode(name, node),
|
|
43312
|
+
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 33554432 /* NoAsciiEscaping */) };
|
|
43307
43313
|
}
|
|
43308
43314
|
}
|
|
43309
43315
|
return { introducesError, node };
|
|
@@ -48130,7 +48136,7 @@ function createTypeChecker(host) {
|
|
|
48130
48136
|
function containsArgumentsReference(declaration) {
|
|
48131
48137
|
const links = getNodeLinks(declaration);
|
|
48132
48138
|
if (links.containsArgumentsReference === void 0) {
|
|
48133
|
-
if (links.flags &
|
|
48139
|
+
if (links.flags & 512 /* CaptureArguments */) {
|
|
48134
48140
|
links.containsArgumentsReference = true;
|
|
48135
48141
|
} else {
|
|
48136
48142
|
links.containsArgumentsReference = traverse(declaration.body);
|
|
@@ -48652,8 +48658,21 @@ function createTypeChecker(host) {
|
|
|
48652
48658
|
return errorType;
|
|
48653
48659
|
}
|
|
48654
48660
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
48655
|
-
|
|
48656
|
-
|
|
48661
|
+
let newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : void 0;
|
|
48662
|
+
let aliasTypeArguments;
|
|
48663
|
+
if (newAliasSymbol) {
|
|
48664
|
+
aliasTypeArguments = getTypeArgumentsForAliasSymbol(newAliasSymbol);
|
|
48665
|
+
} else if (isTypeReferenceType(node)) {
|
|
48666
|
+
const aliasSymbol2 = resolveTypeReferenceName(node, 2097152 /* Alias */, true);
|
|
48667
|
+
if (aliasSymbol2 && aliasSymbol2 !== unknownSymbol) {
|
|
48668
|
+
const resolved = resolveAlias(aliasSymbol2);
|
|
48669
|
+
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
48670
|
+
newAliasSymbol = resolved;
|
|
48671
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
48672
|
+
}
|
|
48673
|
+
}
|
|
48674
|
+
}
|
|
48675
|
+
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
48657
48676
|
}
|
|
48658
48677
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
48659
48678
|
}
|
|
@@ -48892,7 +48911,7 @@ function createTypeChecker(host) {
|
|
|
48892
48911
|
const links = getNodeLinks(node);
|
|
48893
48912
|
if (!links.resolvedType) {
|
|
48894
48913
|
const type = checkExpressionWithTypeArguments(node);
|
|
48895
|
-
links.resolvedType =
|
|
48914
|
+
links.resolvedType = getWidenedType(type);
|
|
48896
48915
|
}
|
|
48897
48916
|
return links.resolvedType;
|
|
48898
48917
|
}
|
|
@@ -51647,7 +51666,7 @@ function createTypeChecker(host) {
|
|
|
51647
51666
|
return isTypeRelatedTo(source, target, assignableRelation);
|
|
51648
51667
|
}
|
|
51649
51668
|
function isTypeDerivedFrom(source, target) {
|
|
51650
|
-
return source.flags & 1048576 /* Union */ ? every(source.types, (t) => isTypeDerivedFrom(t, target)) : target.flags & 1048576 /* Union */ ? some(target.types, (t) => isTypeDerivedFrom(source, t)) : source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType);
|
|
51669
|
+
return source.flags & 1048576 /* Union */ ? every(source.types, (t) => isTypeDerivedFrom(t, target)) : target.flags & 1048576 /* Union */ ? some(target.types, (t) => isTypeDerivedFrom(source, t)) : source.flags & 2097152 /* Intersection */ ? some(source.types, (t) => isTypeDerivedFrom(t, target)) : source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : isEmptyAnonymousObjectType(target) ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) && !isEmptyAnonymousObjectType(source) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType);
|
|
51651
51670
|
}
|
|
51652
51671
|
function isTypeComparableTo(source, target) {
|
|
51653
51672
|
return isTypeRelatedTo(source, target, comparableRelation);
|
|
@@ -52030,7 +52049,7 @@ function createTypeChecker(host) {
|
|
|
52030
52049
|
return compareSignaturesRelated(
|
|
52031
52050
|
source,
|
|
52032
52051
|
target,
|
|
52033
|
-
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0
|
|
52052
|
+
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */,
|
|
52034
52053
|
false,
|
|
52035
52054
|
void 0,
|
|
52036
52055
|
void 0,
|
|
@@ -52264,7 +52283,9 @@ function createTypeChecker(host) {
|
|
|
52264
52283
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
52265
52284
|
if (s & 1 /* Any */)
|
|
52266
52285
|
return true;
|
|
52267
|
-
if (s &
|
|
52286
|
+
if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
|
|
52287
|
+
return true;
|
|
52288
|
+
if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value))
|
|
52268
52289
|
return true;
|
|
52269
52290
|
if (isUnknownLikeUnionType(target))
|
|
52270
52291
|
return true;
|
|
@@ -54572,7 +54593,8 @@ function createTypeChecker(host) {
|
|
|
54572
54593
|
return !!(type.flags & 109440 /* Unit */);
|
|
54573
54594
|
}
|
|
54574
54595
|
function isUnitLikeType(type) {
|
|
54575
|
-
|
|
54596
|
+
const t = getBaseConstraintOrType(type);
|
|
54597
|
+
return t.flags & 2097152 /* Intersection */ ? some(t.types, isUnitType) : isUnitType(t);
|
|
54576
54598
|
}
|
|
54577
54599
|
function extractUnitType(type) {
|
|
54578
54600
|
return type.flags & 2097152 /* Intersection */ ? find(type.types, isUnitType) || type : type;
|
|
@@ -55213,24 +55235,7 @@ function createTypeChecker(host) {
|
|
|
55213
55235
|
return isFinite(n) && (!roundTripOnly || "" + n === s);
|
|
55214
55236
|
}
|
|
55215
55237
|
function parseBigIntLiteralType(text) {
|
|
55216
|
-
|
|
55217
|
-
const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
|
|
55218
|
-
return getBigIntLiteralType({ negative, base10Value });
|
|
55219
|
-
}
|
|
55220
|
-
function isValidBigIntString(s, roundTripOnly) {
|
|
55221
|
-
if (s === "")
|
|
55222
|
-
return false;
|
|
55223
|
-
const scanner = createScanner(99 /* ESNext */, false);
|
|
55224
|
-
let success = true;
|
|
55225
|
-
scanner.setOnError(() => success = false);
|
|
55226
|
-
scanner.setText(s + "n");
|
|
55227
|
-
let result = scanner.scan();
|
|
55228
|
-
const negative = result === 40 /* MinusToken */;
|
|
55229
|
-
if (negative) {
|
|
55230
|
-
result = scanner.scan();
|
|
55231
|
-
}
|
|
55232
|
-
const flags = scanner.getTokenFlags();
|
|
55233
|
-
return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
|
|
55238
|
+
return getBigIntLiteralType(parseValidBigInt(text));
|
|
55234
55239
|
}
|
|
55235
55240
|
function isMemberOfStringMapping(source, target) {
|
|
55236
55241
|
if (target.flags & (4 /* String */ | 1 /* Any */)) {
|
|
@@ -55327,7 +55332,7 @@ function createTypeChecker(host) {
|
|
|
55327
55332
|
pos = p;
|
|
55328
55333
|
}
|
|
55329
55334
|
}
|
|
55330
|
-
function inferTypes(inferences, originalSource, originalTarget, priority = 0
|
|
55335
|
+
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
55331
55336
|
let bivariant = false;
|
|
55332
55337
|
let propagationType;
|
|
55333
55338
|
let inferencePriority = 2048 /* MaxValue */;
|
|
@@ -57769,8 +57774,8 @@ function createTypeChecker(host) {
|
|
|
57769
57774
|
}
|
|
57770
57775
|
const parent = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
57771
57776
|
const links = getNodeLinks(parent);
|
|
57772
|
-
if (!(links.flags &
|
|
57773
|
-
links.flags |=
|
|
57777
|
+
if (!(links.flags & 524288 /* AssignmentsMarked */)) {
|
|
57778
|
+
links.flags |= 524288 /* AssignmentsMarked */;
|
|
57774
57779
|
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
57775
57780
|
markNodeAssignments(parent);
|
|
57776
57781
|
}
|
|
@@ -57778,7 +57783,7 @@ function createTypeChecker(host) {
|
|
|
57778
57783
|
return symbol.isAssigned || false;
|
|
57779
57784
|
}
|
|
57780
57785
|
function hasParentWithAssignmentsMarked(node) {
|
|
57781
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
57786
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
|
|
57782
57787
|
}
|
|
57783
57788
|
function markNodeAssignments(node) {
|
|
57784
57789
|
if (node.kind === 79 /* Identifier */) {
|
|
@@ -57857,11 +57862,11 @@ function createTypeChecker(host) {
|
|
|
57857
57862
|
const parent = declaration.parent.parent;
|
|
57858
57863
|
if (parent.kind === 257 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 166 /* Parameter */) {
|
|
57859
57864
|
const links = getNodeLinks(parent);
|
|
57860
|
-
if (!(links.flags &
|
|
57861
|
-
links.flags |=
|
|
57865
|
+
if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
|
|
57866
|
+
links.flags |= 16777216 /* InCheckIdentifier */;
|
|
57862
57867
|
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
57863
57868
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
57864
|
-
links.flags &= ~
|
|
57869
|
+
links.flags &= ~16777216 /* InCheckIdentifier */;
|
|
57865
57870
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 166 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
57866
57871
|
const pattern = declaration.parent;
|
|
57867
57872
|
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
|
|
@@ -57911,7 +57916,7 @@ function createTypeChecker(host) {
|
|
|
57911
57916
|
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
|
57912
57917
|
}
|
|
57913
57918
|
}
|
|
57914
|
-
getNodeLinks(container).flags |=
|
|
57919
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
57915
57920
|
return getTypeOfSymbol(symbol);
|
|
57916
57921
|
}
|
|
57917
57922
|
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
@@ -57928,8 +57933,8 @@ function createTypeChecker(host) {
|
|
|
57928
57933
|
let container = getContainingClass(node);
|
|
57929
57934
|
while (container !== void 0) {
|
|
57930
57935
|
if (container === declaration && container.name !== node) {
|
|
57931
|
-
getNodeLinks(declaration).flags |=
|
|
57932
|
-
getNodeLinks(node).flags |=
|
|
57936
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57937
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57933
57938
|
break;
|
|
57934
57939
|
}
|
|
57935
57940
|
container = getContainingClass(container);
|
|
@@ -57939,8 +57944,8 @@ function createTypeChecker(host) {
|
|
|
57939
57944
|
while (container.kind !== 308 /* SourceFile */) {
|
|
57940
57945
|
if (container.parent === declaration) {
|
|
57941
57946
|
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
57942
|
-
getNodeLinks(declaration).flags |=
|
|
57943
|
-
getNodeLinks(node).flags |=
|
|
57947
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57948
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57944
57949
|
}
|
|
57945
57950
|
break;
|
|
57946
57951
|
}
|
|
@@ -58054,7 +58059,7 @@ function createTypeChecker(host) {
|
|
|
58054
58059
|
const part = getPartOfForStatementContainingNode(node.parent, container);
|
|
58055
58060
|
if (part) {
|
|
58056
58061
|
const links = getNodeLinks(part);
|
|
58057
|
-
links.flags |=
|
|
58062
|
+
links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */;
|
|
58058
58063
|
const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);
|
|
58059
58064
|
pushIfUnique(capturedBindings, symbol);
|
|
58060
58065
|
if (part === container.initializer) {
|
|
@@ -58064,19 +58069,19 @@ function createTypeChecker(host) {
|
|
|
58064
58069
|
}
|
|
58065
58070
|
}
|
|
58066
58071
|
if (capturesBlockScopeBindingInLoopBody) {
|
|
58067
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
58072
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
58068
58073
|
}
|
|
58069
58074
|
}
|
|
58070
58075
|
if (isForStatement(container)) {
|
|
58071
58076
|
const varDeclList = getAncestor(symbol.valueDeclaration, 258 /* VariableDeclarationList */);
|
|
58072
58077
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
58073
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58078
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
|
|
58074
58079
|
}
|
|
58075
58080
|
}
|
|
58076
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58081
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
58077
58082
|
}
|
|
58078
58083
|
if (isCaptured) {
|
|
58079
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58084
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */;
|
|
58080
58085
|
}
|
|
58081
58086
|
}
|
|
58082
58087
|
function isBindingCapturedByNode(node, decl) {
|
|
@@ -58293,23 +58298,23 @@ function createTypeChecker(host) {
|
|
|
58293
58298
|
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
|
|
58294
58299
|
}
|
|
58295
58300
|
if (isStatic(container) || isCallExpression2) {
|
|
58296
|
-
nodeCheckFlag =
|
|
58301
|
+
nodeCheckFlag = 32 /* SuperStatic */;
|
|
58297
58302
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
58298
58303
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
58299
58304
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
58300
|
-
getNodeLinks(current).flags |=
|
|
58305
|
+
getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
|
|
58301
58306
|
}
|
|
58302
58307
|
});
|
|
58303
58308
|
}
|
|
58304
58309
|
} else {
|
|
58305
|
-
nodeCheckFlag =
|
|
58310
|
+
nodeCheckFlag = 16 /* SuperInstance */;
|
|
58306
58311
|
}
|
|
58307
58312
|
getNodeLinks(node).flags |= nodeCheckFlag;
|
|
58308
58313
|
if (container.kind === 171 /* MethodDeclaration */ && inAsyncFunction) {
|
|
58309
58314
|
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
|
|
58310
|
-
getNodeLinks(container).flags |=
|
|
58315
|
+
getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */;
|
|
58311
58316
|
} else {
|
|
58312
|
-
getNodeLinks(container).flags |=
|
|
58317
|
+
getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */;
|
|
58313
58318
|
}
|
|
58314
58319
|
}
|
|
58315
58320
|
if (needToCaptureLexicalThis) {
|
|
@@ -58337,7 +58342,7 @@ function createTypeChecker(host) {
|
|
|
58337
58342
|
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
|
|
58338
58343
|
return errorType;
|
|
58339
58344
|
}
|
|
58340
|
-
return nodeCheckFlag ===
|
|
58345
|
+
return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
|
|
58341
58346
|
function isLegalUsageOfSuperExpression(container2) {
|
|
58342
58347
|
if (!container2) {
|
|
58343
58348
|
return false;
|
|
@@ -59352,9 +59357,9 @@ function createTypeChecker(host) {
|
|
|
59352
59357
|
const container = getEnclosingBlockScopeContainer(node.parent.parent);
|
|
59353
59358
|
const enclosingIterationStatement = getEnclosingIterationStatement(container);
|
|
59354
59359
|
if (enclosingIterationStatement) {
|
|
59355
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
59356
|
-
getNodeLinks(node).flags |=
|
|
59357
|
-
getNodeLinks(node.parent.parent).flags |=
|
|
59360
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
59361
|
+
getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59362
|
+
getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59358
59363
|
}
|
|
59359
59364
|
}
|
|
59360
59365
|
if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
|
|
@@ -62702,11 +62707,11 @@ function createTypeChecker(host) {
|
|
|
62702
62707
|
}
|
|
62703
62708
|
function checkSatisfiesExpression(node) {
|
|
62704
62709
|
checkSourceElement(node.type);
|
|
62710
|
+
const exprType = checkExpression(node.expression);
|
|
62705
62711
|
const targetType = getTypeFromTypeNode(node.type);
|
|
62706
62712
|
if (isErrorType(targetType)) {
|
|
62707
62713
|
return targetType;
|
|
62708
62714
|
}
|
|
62709
|
-
const exprType = checkExpression(node.expression);
|
|
62710
62715
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
62711
62716
|
return exprType;
|
|
62712
62717
|
}
|
|
@@ -63341,10 +63346,10 @@ function createTypeChecker(host) {
|
|
|
63341
63346
|
}
|
|
63342
63347
|
function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
|
|
63343
63348
|
const links = getNodeLinks(node);
|
|
63344
|
-
if (!(links.flags &
|
|
63349
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63345
63350
|
const contextualSignature = getContextualSignature(node);
|
|
63346
|
-
if (!(links.flags &
|
|
63347
|
-
links.flags |=
|
|
63351
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63352
|
+
links.flags |= 64 /* ContextChecked */;
|
|
63348
63353
|
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));
|
|
63349
63354
|
if (!signature) {
|
|
63350
63355
|
return;
|
|
@@ -63734,7 +63739,7 @@ function createTypeChecker(host) {
|
|
|
63734
63739
|
return booleanType;
|
|
63735
63740
|
}
|
|
63736
63741
|
function hasEmptyObjectIntersection(type) {
|
|
63737
|
-
return someType(type, (t) => t === unknownEmptyObjectType || !!(t.flags & 2097152 /* Intersection */) &&
|
|
63742
|
+
return someType(type, (t) => t === unknownEmptyObjectType || !!(t.flags & 2097152 /* Intersection */) && isEmptyAnonymousObjectType(getBaseConstraintOrType(t)));
|
|
63738
63743
|
}
|
|
63739
63744
|
function checkInExpression(left, right, leftType, rightType) {
|
|
63740
63745
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
@@ -65334,13 +65339,13 @@ function createTypeChecker(host) {
|
|
|
65334
65339
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
65335
65340
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
65336
65341
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
65337
|
-
getNodeLinks(lexicalScope).flags |=
|
|
65342
|
+
getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
|
|
65338
65343
|
}
|
|
65339
65344
|
if (isClassExpression(node.parent)) {
|
|
65340
65345
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
65341
65346
|
if (enclosingIterationStatement) {
|
|
65342
|
-
getNodeLinks(node.name).flags |=
|
|
65343
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
65347
|
+
getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
65348
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
65344
65349
|
}
|
|
65345
65350
|
}
|
|
65346
65351
|
}
|
|
@@ -66935,7 +66940,7 @@ function createTypeChecker(host) {
|
|
|
66935
66940
|
}
|
|
66936
66941
|
function checkWeakMapSetCollision(node) {
|
|
66937
66942
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
66938
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
66943
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
|
|
66939
66944
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
66940
66945
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
66941
66946
|
}
|
|
@@ -66949,18 +66954,18 @@ function createTypeChecker(host) {
|
|
|
66949
66954
|
let hasCollision = false;
|
|
66950
66955
|
if (isClassExpression(node)) {
|
|
66951
66956
|
for (const member of node.members) {
|
|
66952
|
-
if (getNodeCheckFlags(member) &
|
|
66957
|
+
if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66953
66958
|
hasCollision = true;
|
|
66954
66959
|
break;
|
|
66955
66960
|
}
|
|
66956
66961
|
}
|
|
66957
66962
|
} else if (isFunctionExpression(node)) {
|
|
66958
|
-
if (getNodeCheckFlags(node) &
|
|
66963
|
+
if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66959
66964
|
hasCollision = true;
|
|
66960
66965
|
}
|
|
66961
66966
|
} else {
|
|
66962
66967
|
const container = getEnclosingBlockScopeContainer(node);
|
|
66963
|
-
if (container && getNodeCheckFlags(container) &
|
|
66968
|
+
if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66964
66969
|
hasCollision = true;
|
|
66965
66970
|
}
|
|
66966
66971
|
}
|
|
@@ -68175,8 +68180,9 @@ function createTypeChecker(host) {
|
|
|
68175
68180
|
});
|
|
68176
68181
|
const containsArguments = containsArgumentsReference(node);
|
|
68177
68182
|
if (containsArguments) {
|
|
68178
|
-
const
|
|
68179
|
-
|
|
68183
|
+
const lastJSDocParamIndex = jsdocParameters.length - 1;
|
|
68184
|
+
const lastJSDocParam = jsdocParameters[lastJSDocParamIndex];
|
|
68185
|
+
if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !excludedParameters.has(lastJSDocParamIndex) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
68180
68186
|
error(lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name));
|
|
68181
68187
|
}
|
|
68182
68188
|
} else {
|
|
@@ -68844,8 +68850,8 @@ function createTypeChecker(host) {
|
|
|
68844
68850
|
}
|
|
68845
68851
|
function computeEnumMemberValues(node) {
|
|
68846
68852
|
const nodeLinks2 = getNodeLinks(node);
|
|
68847
|
-
if (!(nodeLinks2.flags &
|
|
68848
|
-
nodeLinks2.flags |=
|
|
68853
|
+
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
68854
|
+
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
68849
68855
|
let autoValue = 0;
|
|
68850
68856
|
for (const member of node.members) {
|
|
68851
68857
|
const value = computeMemberValue(member, autoValue);
|
|
@@ -69121,7 +69127,7 @@ function createTypeChecker(host) {
|
|
|
69121
69127
|
}
|
|
69122
69128
|
const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */);
|
|
69123
69129
|
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
|
|
69124
|
-
getNodeLinks(node).flags |=
|
|
69130
|
+
getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
|
|
69125
69131
|
}
|
|
69126
69132
|
}
|
|
69127
69133
|
if (isAmbientExternalModule) {
|
|
@@ -70752,8 +70758,8 @@ function createTypeChecker(host) {
|
|
|
70752
70758
|
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
70753
70759
|
if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, void 0, void 0, false)) {
|
|
70754
70760
|
links.isDeclarationWithCollidingName = true;
|
|
70755
|
-
} else if (nodeLinks2.flags &
|
|
70756
|
-
const isDeclaredInLoop = nodeLinks2.flags &
|
|
70761
|
+
} else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
|
|
70762
|
+
const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
|
|
70757
70763
|
const inLoopInitializer = isIterationStatement(container, false);
|
|
70758
70764
|
const inLoopBodyBlock = container.kind === 238 /* Block */ && isIterationStatement(container.parent, false);
|
|
70759
70765
|
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
|
|
@@ -73129,18 +73135,18 @@ function addDefaultValueAssignmentForInitializer(parameter, name, initializer, c
|
|
|
73129
73135
|
setEmitFlags(
|
|
73130
73136
|
setTextRange(
|
|
73131
73137
|
factory2.createAssignment(
|
|
73132
|
-
setEmitFlags(factory2.cloneNode(name),
|
|
73133
|
-
setEmitFlags(initializer,
|
|
73138
|
+
setEmitFlags(factory2.cloneNode(name), 96 /* NoSourceMap */),
|
|
73139
|
+
setEmitFlags(initializer, 96 /* NoSourceMap */ | getEmitFlags(initializer) | 3072 /* NoComments */)
|
|
73134
73140
|
),
|
|
73135
73141
|
parameter
|
|
73136
73142
|
),
|
|
73137
|
-
|
|
73143
|
+
3072 /* NoComments */
|
|
73138
73144
|
)
|
|
73139
73145
|
)
|
|
73140
73146
|
]),
|
|
73141
73147
|
parameter
|
|
73142
73148
|
),
|
|
73143
|
-
1 /* SingleLine */ |
|
|
73149
|
+
1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */
|
|
73144
73150
|
)
|
|
73145
73151
|
)
|
|
73146
73152
|
);
|
|
@@ -74189,10 +74195,10 @@ var visitEachChildTable = {
|
|
|
74189
74195
|
nodeVisitor(node.initializer, visitor, isExpression)
|
|
74190
74196
|
);
|
|
74191
74197
|
},
|
|
74192
|
-
[308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context,
|
|
74198
|
+
[308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
74193
74199
|
return context.factory.updateSourceFile(
|
|
74194
74200
|
node,
|
|
74195
|
-
visitLexicalEnvironment(node.statements, visitor, context
|
|
74201
|
+
visitLexicalEnvironment(node.statements, visitor, context)
|
|
74196
74202
|
);
|
|
74197
74203
|
},
|
|
74198
74204
|
[353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -75742,7 +75748,7 @@ function transformTypeScript(context) {
|
|
|
75742
75748
|
);
|
|
75743
75749
|
let emitFlags = getEmitFlags(node);
|
|
75744
75750
|
if (facts & 1 /* HasStaticInitializedProperties */) {
|
|
75745
|
-
emitFlags |=
|
|
75751
|
+
emitFlags |= 64 /* NoTrailingSourceMap */;
|
|
75746
75752
|
}
|
|
75747
75753
|
setEmitFlags(classStatement, emitFlags);
|
|
75748
75754
|
let statements = [classStatement];
|
|
@@ -75751,14 +75757,14 @@ function transformTypeScript(context) {
|
|
|
75751
75757
|
const localName = factory2.getInternalName(node);
|
|
75752
75758
|
const outer = factory2.createPartiallyEmittedExpression(localName);
|
|
75753
75759
|
setTextRangeEnd(outer, closingBraceLocation.end);
|
|
75754
|
-
setEmitFlags(outer,
|
|
75760
|
+
setEmitFlags(outer, 3072 /* NoComments */);
|
|
75755
75761
|
const statement = factory2.createReturnStatement(outer);
|
|
75756
75762
|
setTextRangePos(statement, closingBraceLocation.pos);
|
|
75757
|
-
setEmitFlags(statement,
|
|
75763
|
+
setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */);
|
|
75758
75764
|
statements.push(statement);
|
|
75759
75765
|
insertStatementsAfterStandardPrologue(statements, context.endLexicalEnvironment());
|
|
75760
75766
|
const iife = factory2.createImmediatelyInvokedArrowFunction(statements);
|
|
75761
|
-
setEmitFlags(iife,
|
|
75767
|
+
setEmitFlags(iife, 67108864 /* TypeScriptClassWrapper */);
|
|
75762
75768
|
const varStatement = factory2.createVariableStatement(
|
|
75763
75769
|
void 0,
|
|
75764
75770
|
factory2.createVariableDeclarationList([
|
|
@@ -75787,7 +75793,7 @@ function transformTypeScript(context) {
|
|
|
75787
75793
|
}
|
|
75788
75794
|
if (statements.length > 1) {
|
|
75789
75795
|
statements.push(factory2.createEndOfDeclarationMarker(node));
|
|
75790
|
-
setEmitFlags(classStatement, getEmitFlags(classStatement) |
|
|
75796
|
+
setEmitFlags(classStatement, getEmitFlags(classStatement) | 8388608 /* HasEndOfDeclarationMarker */);
|
|
75791
75797
|
}
|
|
75792
75798
|
return singleOrMany(statements);
|
|
75793
75799
|
}
|
|
@@ -75844,11 +75850,11 @@ function transformTypeScript(context) {
|
|
|
75844
75850
|
const expression = visitNode(parameterDecorator.expression, visitor, isExpression);
|
|
75845
75851
|
const helper = emitHelpers().createParamHelper(expression, parameterOffset);
|
|
75846
75852
|
setTextRange(helper, parameterDecorator.expression);
|
|
75847
|
-
setEmitFlags(helper,
|
|
75853
|
+
setEmitFlags(helper, 3072 /* NoComments */);
|
|
75848
75854
|
const decorator = factory2.createDecorator(helper);
|
|
75849
75855
|
setSourceMapRange(decorator, parameterDecorator.expression);
|
|
75850
75856
|
setCommentRange(decorator, parameterDecorator.expression);
|
|
75851
|
-
setEmitFlags(decorator,
|
|
75857
|
+
setEmitFlags(decorator, 3072 /* NoComments */);
|
|
75852
75858
|
decorators.push(decorator);
|
|
75853
75859
|
}
|
|
75854
75860
|
return decorators;
|
|
@@ -76032,9 +76038,9 @@ function transformTypeScript(context) {
|
|
|
76032
76038
|
return void 0;
|
|
76033
76039
|
}
|
|
76034
76040
|
const propertyName = setParent(setTextRange(factory2.cloneNode(name), name), name.parent);
|
|
76035
|
-
setEmitFlags(propertyName,
|
|
76041
|
+
setEmitFlags(propertyName, 3072 /* NoComments */ | 96 /* NoSourceMap */);
|
|
76036
76042
|
const localName = setParent(setTextRange(factory2.cloneNode(name), name), name.parent);
|
|
76037
|
-
setEmitFlags(localName,
|
|
76043
|
+
setEmitFlags(localName, 3072 /* NoComments */);
|
|
76038
76044
|
return startOnNewLine(
|
|
76039
76045
|
removeAllComments(
|
|
76040
76046
|
setTextRange(
|
|
@@ -76181,7 +76187,7 @@ function transformTypeScript(context) {
|
|
|
76181
76187
|
setCommentRange(updated, node);
|
|
76182
76188
|
setTextRange(updated, moveRangePastModifiers(node));
|
|
76183
76189
|
setSourceMapRange(updated, moveRangePastModifiers(node));
|
|
76184
|
-
setEmitFlags(updated.name,
|
|
76190
|
+
setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */);
|
|
76185
76191
|
}
|
|
76186
76192
|
return updated;
|
|
76187
76193
|
}
|
|
@@ -76305,11 +76311,11 @@ function transformTypeScript(context) {
|
|
|
76305
76311
|
return factory2.createNotEmittedStatement(node);
|
|
76306
76312
|
}
|
|
76307
76313
|
const statements = [];
|
|
76308
|
-
let emitFlags =
|
|
76314
|
+
let emitFlags = 4 /* AdviseOnEmitNode */;
|
|
76309
76315
|
const varAdded = addVarForEnumOrModuleDeclaration(statements, node);
|
|
76310
76316
|
if (varAdded) {
|
|
76311
76317
|
if (moduleKind !== 4 /* System */ || currentLexicalScope !== currentSourceFile) {
|
|
76312
|
-
emitFlags |=
|
|
76318
|
+
emitFlags |= 1024 /* NoLeadingComments */;
|
|
76313
76319
|
}
|
|
76314
76320
|
}
|
|
76315
76321
|
const parameterName = getNamespaceParameterName(node);
|
|
@@ -76454,12 +76460,12 @@ function transformTypeScript(context) {
|
|
|
76454
76460
|
setSourceMapRange(statement, node);
|
|
76455
76461
|
}
|
|
76456
76462
|
setCommentRange(statement, node);
|
|
76457
|
-
addEmitFlags(statement,
|
|
76463
|
+
addEmitFlags(statement, 2048 /* NoTrailingComments */ | 8388608 /* HasEndOfDeclarationMarker */);
|
|
76458
76464
|
statements.push(statement);
|
|
76459
76465
|
return true;
|
|
76460
76466
|
} else {
|
|
76461
76467
|
const mergeMarker = factory2.createMergeDeclarationMarker(statement);
|
|
76462
|
-
setEmitFlags(mergeMarker,
|
|
76468
|
+
setEmitFlags(mergeMarker, 3072 /* NoComments */ | 8388608 /* HasEndOfDeclarationMarker */);
|
|
76463
76469
|
statements.push(mergeMarker);
|
|
76464
76470
|
return false;
|
|
76465
76471
|
}
|
|
@@ -76471,11 +76477,11 @@ function transformTypeScript(context) {
|
|
|
76471
76477
|
Debug.assertNode(node.name, isIdentifier, "A TypeScript namespace should have an Identifier name.");
|
|
76472
76478
|
enableSubstitutionForNamespaceExports();
|
|
76473
76479
|
const statements = [];
|
|
76474
|
-
let emitFlags =
|
|
76480
|
+
let emitFlags = 4 /* AdviseOnEmitNode */;
|
|
76475
76481
|
const varAdded = addVarForEnumOrModuleDeclaration(statements, node);
|
|
76476
76482
|
if (varAdded) {
|
|
76477
76483
|
if (moduleKind !== 4 /* System */ || currentLexicalScope !== currentSourceFile) {
|
|
76478
|
-
emitFlags |=
|
|
76484
|
+
emitFlags |= 1024 /* NoLeadingComments */;
|
|
76479
76485
|
}
|
|
76480
76486
|
}
|
|
76481
76487
|
const parameterName = getNamespaceParameterName(node);
|
|
@@ -76560,7 +76566,7 @@ function transformTypeScript(context) {
|
|
|
76560
76566
|
);
|
|
76561
76567
|
setTextRange(block, blockLocation);
|
|
76562
76568
|
if (!node.body || node.body.kind !== 265 /* ModuleBlock */) {
|
|
76563
|
-
setEmitFlags(block, getEmitFlags(block) |
|
|
76569
|
+
setEmitFlags(block, getEmitFlags(block) | 3072 /* NoComments */);
|
|
76564
76570
|
}
|
|
76565
76571
|
return block;
|
|
76566
76572
|
}
|
|
@@ -76671,7 +76677,7 @@ function transformTypeScript(context) {
|
|
|
76671
76677
|
return void 0;
|
|
76672
76678
|
}
|
|
76673
76679
|
const moduleReference = createExpressionFromEntityName(factory2, node.moduleReference);
|
|
76674
|
-
setEmitFlags(moduleReference,
|
|
76680
|
+
setEmitFlags(moduleReference, 3072 /* NoComments */ | 4096 /* NoNestedComments */);
|
|
76675
76681
|
if (isNamedExternalModuleExport(node) || !isExportOfNamespace(node)) {
|
|
76676
76682
|
return setOriginalNode(
|
|
76677
76683
|
setTextRange(
|
|
@@ -77159,7 +77165,7 @@ function transformClassFields(context) {
|
|
|
77159
77165
|
}
|
|
77160
77166
|
const backingField = createAccessorPropertyBackingField(factory2, node, node.modifiers, node.initializer);
|
|
77161
77167
|
setOriginalNode(backingField, node);
|
|
77162
|
-
setEmitFlags(backingField,
|
|
77168
|
+
setEmitFlags(backingField, 3072 /* NoComments */);
|
|
77163
77169
|
setSourceMapRange(backingField, sourceMapRange);
|
|
77164
77170
|
const getter = createAccessorPropertyGetRedirector(factory2, node, node.modifiers, getterName);
|
|
77165
77171
|
setOriginalNode(getter, node);
|
|
@@ -77167,7 +77173,7 @@ function transformClassFields(context) {
|
|
|
77167
77173
|
setSourceMapRange(getter, sourceMapRange);
|
|
77168
77174
|
const setter = createAccessorPropertySetRedirector(factory2, node, node.modifiers, setterName);
|
|
77169
77175
|
setOriginalNode(setter, node);
|
|
77170
|
-
setEmitFlags(setter,
|
|
77176
|
+
setEmitFlags(setter, 3072 /* NoComments */);
|
|
77171
77177
|
setSourceMapRange(setter, sourceMapRange);
|
|
77172
77178
|
return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement);
|
|
77173
77179
|
}
|
|
@@ -77470,7 +77476,7 @@ function transformClassFields(context) {
|
|
|
77470
77476
|
const iife = factory2.createImmediatelyInvokedArrowFunction(statements);
|
|
77471
77477
|
setOriginalNode(iife, node);
|
|
77472
77478
|
setTextRange(iife, node);
|
|
77473
|
-
addEmitFlags(iife,
|
|
77479
|
+
addEmitFlags(iife, 4 /* AdviseOnEmitNode */);
|
|
77474
77480
|
return iife;
|
|
77475
77481
|
}
|
|
77476
77482
|
}
|
|
@@ -77728,12 +77734,12 @@ function transformClassFields(context) {
|
|
|
77728
77734
|
function visitClassExpressionInNewClassLexicalEnvironment(node, facts) {
|
|
77729
77735
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
77730
77736
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
77731
|
-
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) &
|
|
77737
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
|
|
77732
77738
|
let temp;
|
|
77733
77739
|
function createClassTempVar() {
|
|
77734
77740
|
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
77735
|
-
const isClassWithConstructorReference2 = classCheckFlags &
|
|
77736
|
-
const requiresBlockScopedVar = classCheckFlags &
|
|
77741
|
+
const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
|
|
77742
|
+
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
77737
77743
|
return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
|
|
77738
77744
|
}
|
|
77739
77745
|
if (facts & 2 /* NeedsClassConstructorReference */) {
|
|
@@ -77784,7 +77790,7 @@ function transformClassFields(context) {
|
|
|
77784
77790
|
alias.autoGenerateFlags &= ~8 /* ReservedInNestedScopes */;
|
|
77785
77791
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
77786
77792
|
}
|
|
77787
|
-
setEmitFlags(classExpression,
|
|
77793
|
+
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
77788
77794
|
expressions.push(startOnNewLine(factory2.createAssignment(temp, classExpression)));
|
|
77789
77795
|
addRange(expressions, map(pendingExpressions, startOnNewLine));
|
|
77790
77796
|
addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp));
|
|
@@ -78025,7 +78031,7 @@ function transformClassFields(context) {
|
|
|
78025
78031
|
}
|
|
78026
78032
|
const statement = factory2.createExpressionStatement(expression);
|
|
78027
78033
|
setOriginalNode(statement, property);
|
|
78028
|
-
addEmitFlags(statement, getEmitFlags(property) &
|
|
78034
|
+
addEmitFlags(statement, getEmitFlags(property) & 3072 /* NoComments */);
|
|
78029
78035
|
setSourceMapRange(statement, moveRangePastModifiers(property));
|
|
78030
78036
|
setCommentRange(statement, property);
|
|
78031
78037
|
setSyntheticLeadingComments(expression, void 0);
|
|
@@ -78041,7 +78047,7 @@ function transformClassFields(context) {
|
|
|
78041
78047
|
}
|
|
78042
78048
|
startOnNewLine(expression);
|
|
78043
78049
|
setOriginalNode(expression, property);
|
|
78044
|
-
addEmitFlags(expression, getEmitFlags(property) &
|
|
78050
|
+
addEmitFlags(expression, getEmitFlags(property) & 3072 /* NoComments */);
|
|
78045
78051
|
setSourceMapRange(expression, moveRangePastModifiers(property));
|
|
78046
78052
|
setCommentRange(expression, property);
|
|
78047
78053
|
expressions.push(expression);
|
|
@@ -78053,7 +78059,7 @@ function transformClassFields(context) {
|
|
|
78053
78059
|
const transformed = transformPropertyWorker(property, receiver);
|
|
78054
78060
|
if (transformed && hasStaticModifier(property) && (currentClassLexicalEnvironment == null ? void 0 : currentClassLexicalEnvironment.facts)) {
|
|
78055
78061
|
setOriginalNode(transformed, property);
|
|
78056
|
-
addEmitFlags(transformed,
|
|
78062
|
+
addEmitFlags(transformed, 4 /* AdviseOnEmitNode */);
|
|
78057
78063
|
classLexicalEnvironmentMap.set(getOriginalNodeId(transformed), currentClassLexicalEnvironment);
|
|
78058
78064
|
}
|
|
78059
78065
|
currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock;
|
|
@@ -78167,7 +78173,7 @@ function transformClassFields(context) {
|
|
|
78167
78173
|
}
|
|
78168
78174
|
switch (node.kind) {
|
|
78169
78175
|
case 215 /* FunctionExpression */:
|
|
78170
|
-
if (isArrowFunction(original) || getEmitFlags(node) &
|
|
78176
|
+
if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) {
|
|
78171
78177
|
break;
|
|
78172
78178
|
}
|
|
78173
78179
|
case 259 /* FunctionDeclaration */:
|
|
@@ -78246,7 +78252,7 @@ function transformClassFields(context) {
|
|
|
78246
78252
|
}
|
|
78247
78253
|
function trySubstituteClassAlias(node) {
|
|
78248
78254
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
78249
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78255
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
78250
78256
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
78251
78257
|
if (declaration) {
|
|
78252
78258
|
const classAlias = classAliases[declaration.id];
|
|
@@ -78269,7 +78275,7 @@ function transformClassFields(context) {
|
|
|
78269
78275
|
const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
78270
78276
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
78271
78277
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
78272
|
-
if (resolver.getNodeCheckFlags(name) &
|
|
78278
|
+
if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78273
78279
|
addBlockScopedVariable(generatedName);
|
|
78274
78280
|
} else {
|
|
78275
78281
|
hoistVariableDeclaration(generatedName);
|
|
@@ -78418,7 +78424,7 @@ function transformClassFields(context) {
|
|
|
78418
78424
|
const { className } = getPrivateIdentifierEnvironment();
|
|
78419
78425
|
const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_";
|
|
78420
78426
|
const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable(void 0, true, prefix, suffix);
|
|
78421
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78427
|
+
if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78422
78428
|
addBlockScopedVariable(identifier);
|
|
78423
78429
|
} else {
|
|
78424
78430
|
hoistVariableDeclaration(identifier);
|
|
@@ -79003,7 +79009,7 @@ function transformLegacyDecorators(context) {
|
|
|
79003
79009
|
const statements = hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name);
|
|
79004
79010
|
if (statements.length > 1) {
|
|
79005
79011
|
statements.push(factory2.createEndOfDeclarationMarker(node));
|
|
79006
|
-
setEmitFlags(statements[0], getEmitFlags(statements[0]) |
|
|
79012
|
+
setEmitFlags(statements[0], getEmitFlags(statements[0]) | 8388608 /* HasEndOfDeclarationMarker */);
|
|
79007
79013
|
}
|
|
79008
79014
|
return singleOrMany(statements);
|
|
79009
79015
|
}
|
|
@@ -79176,7 +79182,7 @@ function transformLegacyDecorators(context) {
|
|
|
79176
79182
|
setCommentRange(updated, node);
|
|
79177
79183
|
setTextRange(updated, moveRangePastModifiers(node));
|
|
79178
79184
|
setSourceMapRange(updated, moveRangePastModifiers(node));
|
|
79179
|
-
setEmitFlags(updated.name,
|
|
79185
|
+
setEmitFlags(updated.name, 64 /* NoTrailingSourceMap */);
|
|
79180
79186
|
}
|
|
79181
79187
|
return updated;
|
|
79182
79188
|
}
|
|
@@ -79221,7 +79227,7 @@ function transformLegacyDecorators(context) {
|
|
|
79221
79227
|
memberName,
|
|
79222
79228
|
descriptor
|
|
79223
79229
|
);
|
|
79224
|
-
setEmitFlags(helper,
|
|
79230
|
+
setEmitFlags(helper, 3072 /* NoComments */);
|
|
79225
79231
|
setSourceMapRange(helper, moveRangePastModifiers(member));
|
|
79226
79232
|
return helper;
|
|
79227
79233
|
}
|
|
@@ -79241,7 +79247,7 @@ function transformLegacyDecorators(context) {
|
|
|
79241
79247
|
const localName = languageVersion <= 2 /* ES2015 */ ? factory2.getInternalName(node, false, true) : factory2.getLocalName(node, false, true);
|
|
79242
79248
|
const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName);
|
|
79243
79249
|
const expression = factory2.createAssignment(localName, classAlias ? factory2.createAssignment(classAlias, decorate) : decorate);
|
|
79244
|
-
setEmitFlags(expression,
|
|
79250
|
+
setEmitFlags(expression, 3072 /* NoComments */);
|
|
79245
79251
|
setSourceMapRange(expression, moveRangePastModifiers(node));
|
|
79246
79252
|
return expression;
|
|
79247
79253
|
}
|
|
@@ -79258,7 +79264,7 @@ function transformLegacyDecorators(context) {
|
|
|
79258
79264
|
parameterOffset
|
|
79259
79265
|
);
|
|
79260
79266
|
setTextRange(helper, decorator.expression);
|
|
79261
|
-
setEmitFlags(helper,
|
|
79267
|
+
setEmitFlags(helper, 3072 /* NoComments */);
|
|
79262
79268
|
expressions.push(helper);
|
|
79263
79269
|
}
|
|
79264
79270
|
}
|
|
@@ -79283,7 +79289,7 @@ function transformLegacyDecorators(context) {
|
|
|
79283
79289
|
}
|
|
79284
79290
|
}
|
|
79285
79291
|
function getClassAliasIfNeeded(node) {
|
|
79286
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79292
|
+
if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
|
|
79287
79293
|
enableSubstitutionForClassAliases();
|
|
79288
79294
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
79289
79295
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -79317,7 +79323,7 @@ function transformLegacyDecorators(context) {
|
|
|
79317
79323
|
}
|
|
79318
79324
|
function trySubstituteClassAlias(node) {
|
|
79319
79325
|
if (classAliases) {
|
|
79320
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79326
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
79321
79327
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
79322
79328
|
if (declaration) {
|
|
79323
79329
|
const classAlias = classAliases[declaration.id];
|
|
@@ -79352,7 +79358,7 @@ function transformES2017(context) {
|
|
|
79352
79358
|
let capturedSuperProperties;
|
|
79353
79359
|
let hasSuperElementAccess;
|
|
79354
79360
|
const substitutedSuperAccessors = [];
|
|
79355
|
-
let contextFlags = 0
|
|
79361
|
+
let contextFlags = 0 /* None */;
|
|
79356
79362
|
const previousOnEmitNode = context.onEmitNode;
|
|
79357
79363
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
79358
79364
|
context.onEmitNode = onEmitNode;
|
|
@@ -79679,7 +79685,7 @@ function transformES2017(context) {
|
|
|
79679
79685
|
hasSuperElementAccess = false;
|
|
79680
79686
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
79681
79687
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
79682
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79688
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
79683
79689
|
if (emitSuperHelpers) {
|
|
79684
79690
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79685
79691
|
if (capturedSuperProperties.size) {
|
|
@@ -79690,9 +79696,9 @@ function transformES2017(context) {
|
|
|
79690
79696
|
updated = factory2.updateBlock(updated, statements);
|
|
79691
79697
|
}
|
|
79692
79698
|
if (hasSuperElementAccess) {
|
|
79693
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79699
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79694
79700
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
79695
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79701
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79696
79702
|
addEmitHelper(updated, asyncSuperHelper);
|
|
79697
79703
|
}
|
|
79698
79704
|
}
|
|
@@ -79707,7 +79713,7 @@ function transformES2017(context) {
|
|
|
79707
79713
|
const nodeType = original.type;
|
|
79708
79714
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
79709
79715
|
const isArrowFunction2 = node.kind === 216 /* ArrowFunction */;
|
|
79710
|
-
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) &
|
|
79716
|
+
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
79711
79717
|
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
|
|
79712
79718
|
enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
|
|
79713
79719
|
for (const parameter of node.parameters) {
|
|
@@ -79734,7 +79740,7 @@ function transformES2017(context) {
|
|
|
79734
79740
|
)
|
|
79735
79741
|
);
|
|
79736
79742
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
79737
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79743
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
79738
79744
|
if (emitSuperHelpers) {
|
|
79739
79745
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79740
79746
|
if (capturedSuperProperties.size) {
|
|
@@ -79746,9 +79752,9 @@ function transformES2017(context) {
|
|
|
79746
79752
|
const block = factory2.createBlock(statements, true);
|
|
79747
79753
|
setTextRange(block, node.body);
|
|
79748
79754
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
79749
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79755
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79750
79756
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
79751
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79757
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79752
79758
|
addEmitHelper(block, asyncSuperHelper);
|
|
79753
79759
|
}
|
|
79754
79760
|
}
|
|
@@ -79808,7 +79814,7 @@ function transformES2017(context) {
|
|
|
79808
79814
|
}
|
|
79809
79815
|
function onEmitNode(hint, node, emitCallback) {
|
|
79810
79816
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
79811
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
79817
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
79812
79818
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
79813
79819
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
79814
79820
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -79884,7 +79890,7 @@ function transformES2017(context) {
|
|
|
79884
79890
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
79885
79891
|
}
|
|
79886
79892
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
79887
|
-
if (enclosingSuperContainerFlags &
|
|
79893
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79888
79894
|
return setTextRange(
|
|
79889
79895
|
factory2.createPropertyAccessExpression(
|
|
79890
79896
|
factory2.createCallExpression(
|
|
@@ -79909,7 +79915,7 @@ function transformES2017(context) {
|
|
|
79909
79915
|
}
|
|
79910
79916
|
}
|
|
79911
79917
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
79912
|
-
const hasBinding = (resolver.getNodeCheckFlags(node) &
|
|
79918
|
+
const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
79913
79919
|
const accessors = [];
|
|
79914
79920
|
names.forEach((_, key) => {
|
|
79915
79921
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -79926,11 +79932,11 @@ function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
|
79926
79932
|
factory2.createPropertyAccessExpression(
|
|
79927
79933
|
setEmitFlags(
|
|
79928
79934
|
factory2.createSuper(),
|
|
79929
|
-
|
|
79935
|
+
8 /* NoSubstitution */
|
|
79930
79936
|
),
|
|
79931
79937
|
name
|
|
79932
79938
|
),
|
|
79933
|
-
|
|
79939
|
+
8 /* NoSubstitution */
|
|
79934
79940
|
)
|
|
79935
79941
|
)
|
|
79936
79942
|
));
|
|
@@ -79958,11 +79964,11 @@ function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
|
79958
79964
|
factory2.createPropertyAccessExpression(
|
|
79959
79965
|
setEmitFlags(
|
|
79960
79966
|
factory2.createSuper(),
|
|
79961
|
-
|
|
79967
|
+
8 /* NoSubstitution */
|
|
79962
79968
|
),
|
|
79963
79969
|
name
|
|
79964
79970
|
),
|
|
79965
|
-
|
|
79971
|
+
8 /* NoSubstitution */
|
|
79966
79972
|
),
|
|
79967
79973
|
factory2.createIdentifier("v")
|
|
79968
79974
|
)
|
|
@@ -80534,7 +80540,7 @@ function transformES2018(context) {
|
|
|
80534
80540
|
),
|
|
80535
80541
|
bodyLocation
|
|
80536
80542
|
),
|
|
80537
|
-
|
|
80543
|
+
96 /* NoSourceMap */ | 768 /* NoTokenSourceMaps */
|
|
80538
80544
|
);
|
|
80539
80545
|
return factory2.createBlock([
|
|
80540
80546
|
iteratorValueStatement,
|
|
@@ -80580,7 +80586,7 @@ function transformES2018(context) {
|
|
|
80580
80586
|
]),
|
|
80581
80587
|
node.expression
|
|
80582
80588
|
),
|
|
80583
|
-
|
|
80589
|
+
4194304 /* NoHoisting */
|
|
80584
80590
|
),
|
|
80585
80591
|
factory2.inlineExpressions([
|
|
80586
80592
|
factory2.createAssignment(result, createDownlevelAwait(callNext)),
|
|
@@ -80592,7 +80598,7 @@ function transformES2018(context) {
|
|
|
80592
80598
|
),
|
|
80593
80599
|
node
|
|
80594
80600
|
),
|
|
80595
|
-
|
|
80601
|
+
512 /* NoTokenTrailingSourceMaps */
|
|
80596
80602
|
);
|
|
80597
80603
|
setOriginalNode(forStatement, node);
|
|
80598
80604
|
return factory2.createTryStatement(
|
|
@@ -80847,7 +80853,7 @@ function transformES2018(context) {
|
|
|
80847
80853
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
80848
80854
|
)
|
|
80849
80855
|
);
|
|
80850
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
80856
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
80851
80857
|
if (emitSuperHelpers) {
|
|
80852
80858
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
80853
80859
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -80858,9 +80864,9 @@ function transformES2018(context) {
|
|
|
80858
80864
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
80859
80865
|
const block = factory2.updateBlock(node.body, statements);
|
|
80860
80866
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
80861
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
80867
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
80862
80868
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
80863
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
80869
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
80864
80870
|
addEmitHelper(block, asyncSuperHelper);
|
|
80865
80871
|
}
|
|
80866
80872
|
}
|
|
@@ -80903,7 +80909,7 @@ function transformES2018(context) {
|
|
|
80903
80909
|
if (some(declarations)) {
|
|
80904
80910
|
const declarationList = factory2.createVariableDeclarationList(declarations);
|
|
80905
80911
|
const statement = factory2.createVariableStatement(void 0, declarationList);
|
|
80906
|
-
setEmitFlags(statement,
|
|
80912
|
+
setEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
80907
80913
|
statements = append(statements, statement);
|
|
80908
80914
|
}
|
|
80909
80915
|
} else if (parameter.initializer) {
|
|
@@ -80911,26 +80917,26 @@ function transformES2018(context) {
|
|
|
80911
80917
|
const initializer = visitNode(parameter.initializer, visitor, isExpression);
|
|
80912
80918
|
const assignment = factory2.createAssignment(name, initializer);
|
|
80913
80919
|
const statement = factory2.createExpressionStatement(assignment);
|
|
80914
|
-
setEmitFlags(statement,
|
|
80920
|
+
setEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
80915
80921
|
statements = append(statements, statement);
|
|
80916
80922
|
}
|
|
80917
80923
|
} else if (parameter.initializer) {
|
|
80918
80924
|
const name = factory2.cloneNode(parameter.name);
|
|
80919
80925
|
setTextRange(name, parameter.name);
|
|
80920
|
-
setEmitFlags(name,
|
|
80926
|
+
setEmitFlags(name, 96 /* NoSourceMap */);
|
|
80921
80927
|
const initializer = visitNode(parameter.initializer, visitor, isExpression);
|
|
80922
|
-
addEmitFlags(initializer,
|
|
80928
|
+
addEmitFlags(initializer, 96 /* NoSourceMap */ | 3072 /* NoComments */);
|
|
80923
80929
|
const assignment = factory2.createAssignment(name, initializer);
|
|
80924
80930
|
setTextRange(assignment, parameter);
|
|
80925
|
-
setEmitFlags(assignment,
|
|
80931
|
+
setEmitFlags(assignment, 3072 /* NoComments */);
|
|
80926
80932
|
const block = factory2.createBlock([factory2.createExpressionStatement(assignment)]);
|
|
80927
80933
|
setTextRange(block, parameter);
|
|
80928
|
-
setEmitFlags(block, 1 /* SingleLine */ |
|
|
80934
|
+
setEmitFlags(block, 1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */);
|
|
80929
80935
|
const typeCheck = factory2.createTypeCheck(factory2.cloneNode(parameter.name), "undefined");
|
|
80930
80936
|
const statement = factory2.createIfStatement(typeCheck, block);
|
|
80931
80937
|
startOnNewLine(statement);
|
|
80932
80938
|
setTextRange(statement, parameter);
|
|
80933
|
-
setEmitFlags(statement,
|
|
80939
|
+
setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2097152 /* CustomPrologue */ | 3072 /* NoComments */);
|
|
80934
80940
|
statements = append(statements, statement);
|
|
80935
80941
|
}
|
|
80936
80942
|
} else if (parameter.transformFlags & 65536 /* ContainsObjectRestOrSpread */) {
|
|
@@ -80947,7 +80953,7 @@ function transformES2018(context) {
|
|
|
80947
80953
|
if (some(declarations)) {
|
|
80948
80954
|
const declarationList = factory2.createVariableDeclarationList(declarations);
|
|
80949
80955
|
const statement = factory2.createVariableStatement(void 0, declarationList);
|
|
80950
|
-
setEmitFlags(statement,
|
|
80956
|
+
setEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
80951
80957
|
statements = append(statements, statement);
|
|
80952
80958
|
}
|
|
80953
80959
|
}
|
|
@@ -80970,7 +80976,7 @@ function transformES2018(context) {
|
|
|
80970
80976
|
}
|
|
80971
80977
|
function onEmitNode(hint, node, emitCallback) {
|
|
80972
80978
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
80973
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
80979
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
80974
80980
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
80975
80981
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
80976
80982
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -81046,7 +81052,7 @@ function transformES2018(context) {
|
|
|
81046
81052
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
81047
81053
|
}
|
|
81048
81054
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
81049
|
-
if (enclosingSuperContainerFlags &
|
|
81055
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
81050
81056
|
return setTextRange(
|
|
81051
81057
|
factory2.createPropertyAccessExpression(
|
|
81052
81058
|
factory2.createCallExpression(
|
|
@@ -81239,7 +81245,7 @@ function transformES2020(context) {
|
|
|
81239
81245
|
if (i === 0 && leftThisArg) {
|
|
81240
81246
|
if (!isGeneratedIdentifier(leftThisArg)) {
|
|
81241
81247
|
leftThisArg = factory2.cloneNode(leftThisArg);
|
|
81242
|
-
addEmitFlags(leftThisArg,
|
|
81248
|
+
addEmitFlags(leftThisArg, 3072 /* NoComments */);
|
|
81243
81249
|
}
|
|
81244
81250
|
rightExpression = factory2.createFunctionCallCall(
|
|
81245
81251
|
rightExpression,
|
|
@@ -82204,7 +82210,7 @@ function transformES2015(context) {
|
|
|
82204
82210
|
return node.transformFlags & 4194304 /* ContainsHoistedDeclarationOrCompletion */ && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement(node, false) || isBlock(node));
|
|
82205
82211
|
}
|
|
82206
82212
|
function shouldVisitNode(node) {
|
|
82207
|
-
return (node.transformFlags & 1024 /* ContainsES2015 */) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && isOrMayContainReturnCompletion(node) || isIterationStatement(node, false) && shouldConvertIterationStatement(node) || (getEmitFlags(node) &
|
|
82213
|
+
return (node.transformFlags & 1024 /* ContainsES2015 */) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */ && isOrMayContainReturnCompletion(node) || isIterationStatement(node, false) && shouldConvertIterationStatement(node) || (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) !== 0;
|
|
82208
82214
|
}
|
|
82209
82215
|
function visitor(node) {
|
|
82210
82216
|
return shouldVisitNode(node) ? visitorWorker(node, false) : node;
|
|
@@ -82492,9 +82498,9 @@ function transformES2015(context) {
|
|
|
82492
82498
|
statements.push(exportStatement);
|
|
82493
82499
|
}
|
|
82494
82500
|
const emitFlags = getEmitFlags(node);
|
|
82495
|
-
if ((emitFlags &
|
|
82501
|
+
if ((emitFlags & 8388608 /* HasEndOfDeclarationMarker */) === 0) {
|
|
82496
82502
|
statements.push(factory2.createEndOfDeclarationMarker(node));
|
|
82497
|
-
setEmitFlags(statement, emitFlags |
|
|
82503
|
+
setEmitFlags(statement, emitFlags | 8388608 /* HasEndOfDeclarationMarker */);
|
|
82498
82504
|
}
|
|
82499
82505
|
return singleOrMany(statements);
|
|
82500
82506
|
}
|
|
@@ -82515,13 +82521,13 @@ function transformES2015(context) {
|
|
|
82515
82521
|
void 0,
|
|
82516
82522
|
transformClassBody(node, extendsClauseElement)
|
|
82517
82523
|
);
|
|
82518
|
-
setEmitFlags(classFunction, getEmitFlags(node) &
|
|
82524
|
+
setEmitFlags(classFunction, getEmitFlags(node) & 131072 /* Indented */ | 1048576 /* ReuseTempVariableScope */);
|
|
82519
82525
|
const inner = factory2.createPartiallyEmittedExpression(classFunction);
|
|
82520
82526
|
setTextRangeEnd(inner, node.end);
|
|
82521
|
-
setEmitFlags(inner,
|
|
82527
|
+
setEmitFlags(inner, 3072 /* NoComments */);
|
|
82522
82528
|
const outer = factory2.createPartiallyEmittedExpression(inner);
|
|
82523
82529
|
setTextRangeEnd(outer, skipTrivia(currentText, node.pos));
|
|
82524
|
-
setEmitFlags(outer,
|
|
82530
|
+
setEmitFlags(outer, 3072 /* NoComments */);
|
|
82525
82531
|
const result = factory2.createParenthesizedExpression(
|
|
82526
82532
|
factory2.createCallExpression(
|
|
82527
82533
|
outer,
|
|
@@ -82543,14 +82549,14 @@ function transformES2015(context) {
|
|
|
82543
82549
|
const closingBraceLocation = createTokenRange(skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */);
|
|
82544
82550
|
const outer = factory2.createPartiallyEmittedExpression(constructorLikeName);
|
|
82545
82551
|
setTextRangeEnd(outer, closingBraceLocation.end);
|
|
82546
|
-
setEmitFlags(outer,
|
|
82552
|
+
setEmitFlags(outer, 3072 /* NoComments */);
|
|
82547
82553
|
const statement = factory2.createReturnStatement(outer);
|
|
82548
82554
|
setTextRangePos(statement, closingBraceLocation.pos);
|
|
82549
|
-
setEmitFlags(statement,
|
|
82555
|
+
setEmitFlags(statement, 3072 /* NoComments */ | 768 /* NoTokenSourceMaps */);
|
|
82550
82556
|
statements.push(statement);
|
|
82551
82557
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
82552
82558
|
const block = factory2.createBlock(setTextRange(factory2.createNodeArray(statements), node.members), true);
|
|
82553
|
-
setEmitFlags(block,
|
|
82559
|
+
setEmitFlags(block, 3072 /* NoComments */);
|
|
82554
82560
|
return block;
|
|
82555
82561
|
}
|
|
82556
82562
|
function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) {
|
|
@@ -82582,7 +82588,7 @@ function transformES2015(context) {
|
|
|
82582
82588
|
);
|
|
82583
82589
|
setTextRange(constructorFunction, constructor || node);
|
|
82584
82590
|
if (extendsClauseElement) {
|
|
82585
|
-
setEmitFlags(constructorFunction,
|
|
82591
|
+
setEmitFlags(constructorFunction, 16 /* CapturesThis */);
|
|
82586
82592
|
}
|
|
82587
82593
|
statements.push(constructorFunction);
|
|
82588
82594
|
exitSubtree(ancestorFacts, 98304 /* FunctionSubtreeExcludes */, 0 /* None */);
|
|
@@ -82602,7 +82608,7 @@ function transformES2015(context) {
|
|
|
82602
82608
|
setTextRange(statementsArray, node.members);
|
|
82603
82609
|
const block = factory2.createBlock(statementsArray, true);
|
|
82604
82610
|
setTextRange(block, node);
|
|
82605
|
-
setEmitFlags(block,
|
|
82611
|
+
setEmitFlags(block, 3072 /* NoComments */);
|
|
82606
82612
|
return block;
|
|
82607
82613
|
}
|
|
82608
82614
|
function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
|
|
@@ -82639,7 +82645,7 @@ function transformES2015(context) {
|
|
|
82639
82645
|
const superCall2 = cast(cast(superCallExpression, isBinaryExpression).left, isCallExpression);
|
|
82640
82646
|
const returnStatement = factory2.createReturnStatement(superCallExpression);
|
|
82641
82647
|
setCommentRange(returnStatement, getCommentRange(superCall2));
|
|
82642
|
-
setEmitFlags(superCall2,
|
|
82648
|
+
setEmitFlags(superCall2, 3072 /* NoComments */);
|
|
82643
82649
|
statements.push(returnStatement);
|
|
82644
82650
|
} else {
|
|
82645
82651
|
if (superStatementIndex <= existingPrologue.length) {
|
|
@@ -82705,7 +82711,7 @@ function transformES2015(context) {
|
|
|
82705
82711
|
return false;
|
|
82706
82712
|
}
|
|
82707
82713
|
function createActualThis() {
|
|
82708
|
-
return setEmitFlags(factory2.createThis(),
|
|
82714
|
+
return setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */);
|
|
82709
82715
|
}
|
|
82710
82716
|
function createDefaultSuperCallOrThis() {
|
|
82711
82717
|
return factory2.createLogicalOr(
|
|
@@ -82799,7 +82805,7 @@ function transformES2015(context) {
|
|
|
82799
82805
|
)
|
|
82800
82806
|
)
|
|
82801
82807
|
),
|
|
82802
|
-
|
|
82808
|
+
2097152 /* CustomPrologue */
|
|
82803
82809
|
)
|
|
82804
82810
|
);
|
|
82805
82811
|
return true;
|
|
@@ -82813,7 +82819,7 @@ function transformES2015(context) {
|
|
|
82813
82819
|
visitNode(initializer, visitor, isExpression)
|
|
82814
82820
|
)
|
|
82815
82821
|
),
|
|
82816
|
-
|
|
82822
|
+
2097152 /* CustomPrologue */
|
|
82817
82823
|
)
|
|
82818
82824
|
);
|
|
82819
82825
|
return true;
|
|
@@ -82831,23 +82837,23 @@ function transformES2015(context) {
|
|
|
82831
82837
|
setEmitFlags(
|
|
82832
82838
|
setTextRange(
|
|
82833
82839
|
factory2.createAssignment(
|
|
82834
|
-
setEmitFlags(setParent(setTextRange(factory2.cloneNode(name), name), name.parent),
|
|
82835
|
-
setEmitFlags(initializer,
|
|
82840
|
+
setEmitFlags(setParent(setTextRange(factory2.cloneNode(name), name), name.parent), 96 /* NoSourceMap */),
|
|
82841
|
+
setEmitFlags(initializer, 96 /* NoSourceMap */ | getEmitFlags(initializer) | 3072 /* NoComments */)
|
|
82836
82842
|
),
|
|
82837
82843
|
parameter
|
|
82838
82844
|
),
|
|
82839
|
-
|
|
82845
|
+
3072 /* NoComments */
|
|
82840
82846
|
)
|
|
82841
82847
|
)
|
|
82842
82848
|
]),
|
|
82843
82849
|
parameter
|
|
82844
82850
|
),
|
|
82845
|
-
1 /* SingleLine */ |
|
|
82851
|
+
1 /* SingleLine */ | 64 /* NoTrailingSourceMap */ | 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */
|
|
82846
82852
|
)
|
|
82847
82853
|
);
|
|
82848
82854
|
startOnNewLine(statement);
|
|
82849
82855
|
setTextRange(statement, parameter);
|
|
82850
|
-
setEmitFlags(statement,
|
|
82856
|
+
setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2097152 /* CustomPrologue */ | 3072 /* NoComments */);
|
|
82851
82857
|
insertStatementAfterCustomPrologue(statements, statement);
|
|
82852
82858
|
}
|
|
82853
82859
|
function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) {
|
|
@@ -82860,7 +82866,7 @@ function transformES2015(context) {
|
|
|
82860
82866
|
return false;
|
|
82861
82867
|
}
|
|
82862
82868
|
const declarationName = parameter.name.kind === 79 /* Identifier */ ? setParent(setTextRange(factory2.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory2.createTempVariable(void 0);
|
|
82863
|
-
setEmitFlags(declarationName,
|
|
82869
|
+
setEmitFlags(declarationName, 96 /* NoSourceMap */);
|
|
82864
82870
|
const expressionName = parameter.name.kind === 79 /* Identifier */ ? factory2.cloneNode(parameter.name) : declarationName;
|
|
82865
82871
|
const restIndex = node.parameters.length - 1;
|
|
82866
82872
|
const temp = factory2.createLoopVariable();
|
|
@@ -82880,7 +82886,7 @@ function transformES2015(context) {
|
|
|
82880
82886
|
),
|
|
82881
82887
|
parameter
|
|
82882
82888
|
),
|
|
82883
|
-
|
|
82889
|
+
2097152 /* CustomPrologue */
|
|
82884
82890
|
)
|
|
82885
82891
|
);
|
|
82886
82892
|
const forStatement = factory2.createForStatement(
|
|
@@ -82915,7 +82921,7 @@ function transformES2015(context) {
|
|
|
82915
82921
|
)
|
|
82916
82922
|
])
|
|
82917
82923
|
);
|
|
82918
|
-
setEmitFlags(forStatement,
|
|
82924
|
+
setEmitFlags(forStatement, 2097152 /* CustomPrologue */);
|
|
82919
82925
|
startOnNewLine(forStatement);
|
|
82920
82926
|
prologueStatements.push(forStatement);
|
|
82921
82927
|
if (parameter.name.kind !== 79 /* Identifier */) {
|
|
@@ -82930,7 +82936,7 @@ function transformES2015(context) {
|
|
|
82930
82936
|
),
|
|
82931
82937
|
parameter
|
|
82932
82938
|
),
|
|
82933
|
-
|
|
82939
|
+
2097152 /* CustomPrologue */
|
|
82934
82940
|
)
|
|
82935
82941
|
);
|
|
82936
82942
|
}
|
|
@@ -82969,7 +82975,7 @@ function transformES2015(context) {
|
|
|
82969
82975
|
)
|
|
82970
82976
|
])
|
|
82971
82977
|
);
|
|
82972
|
-
setEmitFlags(captureThisStatement,
|
|
82978
|
+
setEmitFlags(captureThisStatement, 3072 /* NoComments */ | 2097152 /* CustomPrologue */);
|
|
82973
82979
|
setSourceMapRange(captureThisStatement, node);
|
|
82974
82980
|
insertStatementAfterCustomPrologue(statements, captureThisStatement);
|
|
82975
82981
|
}
|
|
@@ -82986,7 +82992,7 @@ function transformES2015(context) {
|
|
|
82986
82992
|
break;
|
|
82987
82993
|
case 173 /* Constructor */:
|
|
82988
82994
|
newTarget = factory2.createPropertyAccessExpression(
|
|
82989
|
-
setEmitFlags(factory2.createThis(),
|
|
82995
|
+
setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */),
|
|
82990
82996
|
"constructor"
|
|
82991
82997
|
);
|
|
82992
82998
|
break;
|
|
@@ -82994,16 +83000,16 @@ function transformES2015(context) {
|
|
|
82994
83000
|
case 215 /* FunctionExpression */:
|
|
82995
83001
|
newTarget = factory2.createConditionalExpression(
|
|
82996
83002
|
factory2.createLogicalAnd(
|
|
82997
|
-
setEmitFlags(factory2.createThis(),
|
|
83003
|
+
setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */),
|
|
82998
83004
|
factory2.createBinaryExpression(
|
|
82999
|
-
setEmitFlags(factory2.createThis(),
|
|
83005
|
+
setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */),
|
|
83000
83006
|
102 /* InstanceOfKeyword */,
|
|
83001
83007
|
factory2.getLocalName(node)
|
|
83002
83008
|
)
|
|
83003
83009
|
),
|
|
83004
83010
|
void 0,
|
|
83005
83011
|
factory2.createPropertyAccessExpression(
|
|
83006
|
-
setEmitFlags(factory2.createThis(),
|
|
83012
|
+
setEmitFlags(factory2.createThis(), 8 /* NoSubstitution */),
|
|
83007
83013
|
"constructor"
|
|
83008
83014
|
),
|
|
83009
83015
|
void 0,
|
|
@@ -83024,7 +83030,7 @@ function transformES2015(context) {
|
|
|
83024
83030
|
)
|
|
83025
83031
|
])
|
|
83026
83032
|
);
|
|
83027
|
-
setEmitFlags(captureNewTargetStatement,
|
|
83033
|
+
setEmitFlags(captureNewTargetStatement, 3072 /* NoComments */ | 2097152 /* CustomPrologue */);
|
|
83028
83034
|
if (copyOnWrite) {
|
|
83029
83035
|
statements = statements.slice();
|
|
83030
83036
|
}
|
|
@@ -83073,36 +83079,36 @@ function transformES2015(context) {
|
|
|
83073
83079
|
const memberName = createMemberAccessForPropertyName(factory2, receiver, propertyName, member.name);
|
|
83074
83080
|
e = factory2.createAssignment(memberName, memberFunction);
|
|
83075
83081
|
}
|
|
83076
|
-
setEmitFlags(memberFunction,
|
|
83082
|
+
setEmitFlags(memberFunction, 3072 /* NoComments */);
|
|
83077
83083
|
setSourceMapRange(memberFunction, sourceMapRange);
|
|
83078
83084
|
const statement = setTextRange(factory2.createExpressionStatement(e), member);
|
|
83079
83085
|
setOriginalNode(statement, member);
|
|
83080
83086
|
setCommentRange(statement, commentRange);
|
|
83081
|
-
setEmitFlags(statement,
|
|
83087
|
+
setEmitFlags(statement, 96 /* NoSourceMap */);
|
|
83082
83088
|
return statement;
|
|
83083
83089
|
}
|
|
83084
83090
|
function transformAccessorsToStatement(receiver, accessors, container) {
|
|
83085
83091
|
const statement = factory2.createExpressionStatement(transformAccessorsToExpression(receiver, accessors, container, false));
|
|
83086
|
-
setEmitFlags(statement,
|
|
83092
|
+
setEmitFlags(statement, 3072 /* NoComments */);
|
|
83087
83093
|
setSourceMapRange(statement, getSourceMapRange(accessors.firstAccessor));
|
|
83088
83094
|
return statement;
|
|
83089
83095
|
}
|
|
83090
83096
|
function transformAccessorsToExpression(receiver, { firstAccessor, getAccessor, setAccessor }, container, startsOnNewLine) {
|
|
83091
83097
|
const target = setParent(setTextRange(factory2.cloneNode(receiver), receiver), receiver.parent);
|
|
83092
|
-
setEmitFlags(target,
|
|
83098
|
+
setEmitFlags(target, 3072 /* NoComments */ | 64 /* NoTrailingSourceMap */);
|
|
83093
83099
|
setSourceMapRange(target, firstAccessor.name);
|
|
83094
83100
|
const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName);
|
|
83095
83101
|
if (isPrivateIdentifier(visitedAccessorName)) {
|
|
83096
83102
|
return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015.");
|
|
83097
83103
|
}
|
|
83098
83104
|
const propertyName = createExpressionForPropertyName(factory2, visitedAccessorName);
|
|
83099
|
-
setEmitFlags(propertyName,
|
|
83105
|
+
setEmitFlags(propertyName, 3072 /* NoComments */ | 32 /* NoLeadingSourceMap */);
|
|
83100
83106
|
setSourceMapRange(propertyName, firstAccessor.name);
|
|
83101
83107
|
const properties = [];
|
|
83102
83108
|
if (getAccessor) {
|
|
83103
83109
|
const getterFunction = transformFunctionLikeToExpression(getAccessor, void 0, void 0, container);
|
|
83104
83110
|
setSourceMapRange(getterFunction, getSourceMapRange(getAccessor));
|
|
83105
|
-
setEmitFlags(getterFunction,
|
|
83111
|
+
setEmitFlags(getterFunction, 1024 /* NoLeadingComments */);
|
|
83106
83112
|
const getter = factory2.createPropertyAssignment("get", getterFunction);
|
|
83107
83113
|
setCommentRange(getter, getCommentRange(getAccessor));
|
|
83108
83114
|
properties.push(getter);
|
|
@@ -83110,7 +83116,7 @@ function transformES2015(context) {
|
|
|
83110
83116
|
if (setAccessor) {
|
|
83111
83117
|
const setterFunction = transformFunctionLikeToExpression(setAccessor, void 0, void 0, container);
|
|
83112
83118
|
setSourceMapRange(setterFunction, getSourceMapRange(setAccessor));
|
|
83113
|
-
setEmitFlags(setterFunction,
|
|
83119
|
+
setEmitFlags(setterFunction, 1024 /* NoLeadingComments */);
|
|
83114
83120
|
const setter = factory2.createPropertyAssignment("set", setterFunction);
|
|
83115
83121
|
setCommentRange(setter, getCommentRange(setAccessor));
|
|
83116
83122
|
properties.push(setter);
|
|
@@ -83151,13 +83157,13 @@ function transformES2015(context) {
|
|
|
83151
83157
|
);
|
|
83152
83158
|
setTextRange(func, node);
|
|
83153
83159
|
setOriginalNode(func, node);
|
|
83154
|
-
setEmitFlags(func,
|
|
83160
|
+
setEmitFlags(func, 16 /* CapturesThis */);
|
|
83155
83161
|
exitSubtree(ancestorFacts, 0 /* ArrowFunctionSubtreeExcludes */, 0 /* None */);
|
|
83156
83162
|
convertedLoopState = savedConvertedLoopState;
|
|
83157
83163
|
return func;
|
|
83158
83164
|
}
|
|
83159
83165
|
function visitFunctionExpression(node) {
|
|
83160
|
-
const ancestorFacts = getEmitFlags(node) &
|
|
83166
|
+
const ancestorFacts = getEmitFlags(node) & 524288 /* AsyncFunctionBody */ ? enterSubtree(32662 /* AsyncFunctionBodyExcludes */, 69 /* AsyncFunctionBodyIncludes */) : enterSubtree(32670 /* FunctionExcludes */, 65 /* FunctionIncludes */);
|
|
83161
83167
|
const savedConvertedLoopState = convertedLoopState;
|
|
83162
83168
|
convertedLoopState = void 0;
|
|
83163
83169
|
const parameters = visitParameterList(node.parameters, visitor, context);
|
|
@@ -83262,7 +83268,7 @@ function transformES2015(context) {
|
|
|
83262
83268
|
const returnStatement = factory2.createReturnStatement(expression);
|
|
83263
83269
|
setTextRange(returnStatement, body);
|
|
83264
83270
|
moveSyntheticComments(returnStatement, body);
|
|
83265
|
-
setEmitFlags(returnStatement,
|
|
83271
|
+
setEmitFlags(returnStatement, 768 /* NoTokenSourceMaps */ | 64 /* NoTrailingSourceMap */ | 2048 /* NoTrailingComments */);
|
|
83266
83272
|
statements.push(returnStatement);
|
|
83267
83273
|
closeBraceLocation = body;
|
|
83268
83274
|
}
|
|
@@ -83339,7 +83345,7 @@ function transformES2015(context) {
|
|
|
83339
83345
|
return factory2.updateCommaListExpression(node, elements);
|
|
83340
83346
|
}
|
|
83341
83347
|
function isVariableStatementOfTypeScriptClassWrapper(node) {
|
|
83342
|
-
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) &
|
|
83348
|
+
return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getEmitFlags(node.declarationList.declarations[0].initializer) & 67108864 /* TypeScriptClassWrapper */);
|
|
83343
83349
|
}
|
|
83344
83350
|
function visitVariableStatement(node) {
|
|
83345
83351
|
const ancestorFacts = enterSubtree(0 /* None */, hasSyntacticModifier(node, 1 /* Export */) ? 32 /* ExportedVariableStatement */ : 0 /* None */);
|
|
@@ -83402,8 +83408,8 @@ function transformES2015(context) {
|
|
|
83402
83408
|
}
|
|
83403
83409
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
83404
83410
|
const flags = resolver.getNodeCheckFlags(node);
|
|
83405
|
-
const isCapturedInFunction = flags &
|
|
83406
|
-
const isDeclaredInLoop = flags &
|
|
83411
|
+
const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
|
|
83412
|
+
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
83407
83413
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
83408
83414
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
83409
83415
|
return emitExplicitInitializer;
|
|
@@ -83586,14 +83592,14 @@ function transformES2015(context) {
|
|
|
83586
83592
|
factory2.createNodeArray(statements),
|
|
83587
83593
|
true
|
|
83588
83594
|
),
|
|
83589
|
-
|
|
83595
|
+
96 /* NoSourceMap */ | 768 /* NoTokenSourceMaps */
|
|
83590
83596
|
);
|
|
83591
83597
|
}
|
|
83592
83598
|
function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) {
|
|
83593
83599
|
const expression = visitNode(node.expression, visitor, isExpression);
|
|
83594
83600
|
const counter = factory2.createLoopVariable();
|
|
83595
83601
|
const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable(void 0);
|
|
83596
|
-
setEmitFlags(expression,
|
|
83602
|
+
setEmitFlags(expression, 96 /* NoSourceMap */ | getEmitFlags(expression));
|
|
83597
83603
|
const forStatement = setTextRange(
|
|
83598
83604
|
factory2.createForStatement(
|
|
83599
83605
|
setEmitFlags(
|
|
@@ -83604,7 +83610,7 @@ function transformES2015(context) {
|
|
|
83604
83610
|
]),
|
|
83605
83611
|
node.expression
|
|
83606
83612
|
),
|
|
83607
|
-
|
|
83613
|
+
4194304 /* NoHoisting */
|
|
83608
83614
|
),
|
|
83609
83615
|
setTextRange(
|
|
83610
83616
|
factory2.createLessThan(
|
|
@@ -83622,7 +83628,7 @@ function transformES2015(context) {
|
|
|
83622
83628
|
),
|
|
83623
83629
|
node
|
|
83624
83630
|
);
|
|
83625
|
-
setEmitFlags(forStatement,
|
|
83631
|
+
setEmitFlags(forStatement, 512 /* NoTokenTrailingSourceMaps */);
|
|
83626
83632
|
setTextRange(forStatement, node);
|
|
83627
83633
|
return factory2.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel);
|
|
83628
83634
|
}
|
|
@@ -83649,7 +83655,7 @@ function transformES2015(context) {
|
|
|
83649
83655
|
]),
|
|
83650
83656
|
node.expression
|
|
83651
83657
|
),
|
|
83652
|
-
|
|
83658
|
+
4194304 /* NoHoisting */
|
|
83653
83659
|
),
|
|
83654
83660
|
factory2.createLogicalNot(factory2.createPropertyAccessExpression(result, "done")),
|
|
83655
83661
|
factory2.createAssignment(result, next),
|
|
@@ -83661,7 +83667,7 @@ function transformES2015(context) {
|
|
|
83661
83667
|
),
|
|
83662
83668
|
node
|
|
83663
83669
|
),
|
|
83664
|
-
|
|
83670
|
+
512 /* NoTokenTrailingSourceMaps */
|
|
83665
83671
|
);
|
|
83666
83672
|
return factory2.createTryStatement(
|
|
83667
83673
|
factory2.createBlock([
|
|
@@ -83752,7 +83758,7 @@ function transformES2015(context) {
|
|
|
83752
83758
|
visitNodes2(properties, visitor, isObjectLiteralElementLike, 0, numInitialProperties),
|
|
83753
83759
|
node.multiLine
|
|
83754
83760
|
),
|
|
83755
|
-
hasComputed ?
|
|
83761
|
+
hasComputed ? 131072 /* Indented */ : 0
|
|
83756
83762
|
)
|
|
83757
83763
|
);
|
|
83758
83764
|
if (node.multiLine) {
|
|
@@ -83764,7 +83770,7 @@ function transformES2015(context) {
|
|
|
83764
83770
|
return factory2.inlineExpressions(expressions);
|
|
83765
83771
|
}
|
|
83766
83772
|
function shouldConvertPartOfIterationStatement(node) {
|
|
83767
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83773
|
+
return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
|
|
83768
83774
|
}
|
|
83769
83775
|
function shouldConvertInitializerOfForStatement(node) {
|
|
83770
83776
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -83779,7 +83785,7 @@ function transformES2015(context) {
|
|
|
83779
83785
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
83780
83786
|
}
|
|
83781
83787
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
83782
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83788
|
+
return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
|
|
83783
83789
|
}
|
|
83784
83790
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
83785
83791
|
if (!state.hoistedLocalVariables) {
|
|
@@ -84008,9 +84014,9 @@ function transformES2015(context) {
|
|
|
84008
84014
|
const containsYield = (node.initializer.transformFlags & 1048576 /* ContainsYield */) !== 0;
|
|
84009
84015
|
let emitFlags = 0 /* None */;
|
|
84010
84016
|
if (currentState.containsLexicalThis)
|
|
84011
|
-
emitFlags |=
|
|
84017
|
+
emitFlags |= 16 /* CapturesThis */;
|
|
84012
84018
|
if (containsYield && hierarchyFacts & 4 /* AsyncFunctionBody */)
|
|
84013
|
-
emitFlags |=
|
|
84019
|
+
emitFlags |= 524288 /* AsyncFunctionBody */;
|
|
84014
84020
|
const statements = [];
|
|
84015
84021
|
statements.push(factory2.createVariableStatement(void 0, node.initializer));
|
|
84016
84022
|
copyOutParameters(currentState.loopOutParameters, 2 /* Initializer */, 1 /* ToOutParameter */, statements);
|
|
@@ -84040,7 +84046,7 @@ function transformES2015(context) {
|
|
|
84040
84046
|
)
|
|
84041
84047
|
)
|
|
84042
84048
|
]),
|
|
84043
|
-
|
|
84049
|
+
4194304 /* NoHoisting */
|
|
84044
84050
|
)
|
|
84045
84051
|
);
|
|
84046
84052
|
const part = factory2.createVariableDeclarationList(map(currentState.loopOutParameters, createOutVariable));
|
|
@@ -84084,11 +84090,11 @@ function transformES2015(context) {
|
|
|
84084
84090
|
if (isBlock(statement))
|
|
84085
84091
|
setOriginalNode(loopBody, statement);
|
|
84086
84092
|
const containsYield = (node.statement.transformFlags & 1048576 /* ContainsYield */) !== 0;
|
|
84087
|
-
let emitFlags =
|
|
84093
|
+
let emitFlags = 1048576 /* ReuseTempVariableScope */;
|
|
84088
84094
|
if (currentState.containsLexicalThis)
|
|
84089
|
-
emitFlags |=
|
|
84095
|
+
emitFlags |= 16 /* CapturesThis */;
|
|
84090
84096
|
if (containsYield && (hierarchyFacts & 4 /* AsyncFunctionBody */) !== 0)
|
|
84091
|
-
emitFlags |=
|
|
84097
|
+
emitFlags |= 524288 /* AsyncFunctionBody */;
|
|
84092
84098
|
const functionDeclaration = factory2.createVariableStatement(
|
|
84093
84099
|
void 0,
|
|
84094
84100
|
setEmitFlags(
|
|
@@ -84113,7 +84119,7 @@ function transformES2015(context) {
|
|
|
84113
84119
|
)
|
|
84114
84120
|
]
|
|
84115
84121
|
),
|
|
84116
|
-
|
|
84122
|
+
4194304 /* NoHoisting */
|
|
84117
84123
|
)
|
|
84118
84124
|
);
|
|
84119
84125
|
const part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield);
|
|
@@ -84135,7 +84141,7 @@ function transformES2015(context) {
|
|
|
84135
84141
|
const call = factory2.createCallExpression(initFunctionExpressionName, void 0, []);
|
|
84136
84142
|
const callResult = containsYield ? factory2.createYieldExpression(
|
|
84137
84143
|
factory2.createToken(41 /* AsteriskToken */),
|
|
84138
|
-
setEmitFlags(call,
|
|
84144
|
+
setEmitFlags(call, 16777216 /* Iterator */)
|
|
84139
84145
|
) : call;
|
|
84140
84146
|
return factory2.createExpressionStatement(callResult);
|
|
84141
84147
|
}
|
|
@@ -84145,7 +84151,7 @@ function transformES2015(context) {
|
|
|
84145
84151
|
const call = factory2.createCallExpression(loopFunctionExpressionName, void 0, map(state.loopParameters, (p) => p.name));
|
|
84146
84152
|
const callResult = containsYield ? factory2.createYieldExpression(
|
|
84147
84153
|
factory2.createToken(41 /* AsteriskToken */),
|
|
84148
|
-
setEmitFlags(call,
|
|
84154
|
+
setEmitFlags(call, 16777216 /* Iterator */)
|
|
84149
84155
|
) : call;
|
|
84150
84156
|
if (isSimpleLoop) {
|
|
84151
84157
|
statements.push(factory2.createExpressionStatement(callResult));
|
|
@@ -84240,10 +84246,10 @@ function transformES2015(context) {
|
|
|
84240
84246
|
} else {
|
|
84241
84247
|
loopParameters.push(factory2.createParameterDeclaration(void 0, void 0, name));
|
|
84242
84248
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
84243
|
-
if (checkFlags &
|
|
84249
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
84244
84250
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
84245
|
-
let flags = 0
|
|
84246
|
-
if (checkFlags &
|
|
84251
|
+
let flags = 0 /* None */;
|
|
84252
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
|
|
84247
84253
|
flags |= 1 /* Body */;
|
|
84248
84254
|
}
|
|
84249
84255
|
if (isForStatement(container)) {
|
|
@@ -84363,7 +84369,7 @@ function transformES2015(context) {
|
|
|
84363
84369
|
function visitMethodDeclaration(node) {
|
|
84364
84370
|
Debug.assert(!isComputedPropertyName(node.name));
|
|
84365
84371
|
const functionExpression = transformFunctionLikeToExpression(node, moveRangePos(node, -1), void 0, void 0);
|
|
84366
|
-
setEmitFlags(functionExpression,
|
|
84372
|
+
setEmitFlags(functionExpression, 1024 /* NoLeadingComments */ | getEmitFlags(functionExpression));
|
|
84367
84373
|
return setTextRange(
|
|
84368
84374
|
factory2.createPropertyAssignment(
|
|
84369
84375
|
node.name,
|
|
@@ -84411,7 +84417,7 @@ function transformES2015(context) {
|
|
|
84411
84417
|
return visitEachChild(node, visitor, context);
|
|
84412
84418
|
}
|
|
84413
84419
|
function visitCallExpression(node) {
|
|
84414
|
-
if (getEmitFlags(node) &
|
|
84420
|
+
if (getEmitFlags(node) & 67108864 /* TypeScriptClassWrapper */) {
|
|
84415
84421
|
return visitTypeScriptClassWrapper(node);
|
|
84416
84422
|
}
|
|
84417
84423
|
const expression = skipOuterExpressions(node.expression);
|
|
@@ -84511,7 +84517,7 @@ function transformES2015(context) {
|
|
|
84511
84517
|
if (node.transformFlags & 32768 /* ContainsRestOrSpread */ || node.expression.kind === 106 /* SuperKeyword */ || isSuperProperty(skipOuterExpressions(node.expression))) {
|
|
84512
84518
|
const { target, thisArg } = factory2.createCallBinding(node.expression, hoistVariableDeclaration);
|
|
84513
84519
|
if (node.expression.kind === 106 /* SuperKeyword */) {
|
|
84514
|
-
setEmitFlags(thisArg,
|
|
84520
|
+
setEmitFlags(thisArg, 8 /* NoSubstitution */);
|
|
84515
84521
|
}
|
|
84516
84522
|
let resultingCall;
|
|
84517
84523
|
if (node.transformFlags & 32768 /* ContainsRestOrSpread */) {
|
|
@@ -84664,7 +84670,7 @@ function transformES2015(context) {
|
|
|
84664
84670
|
if (enabledSubstitutions & 1 /* CapturedThis */ && isFunctionLike(node)) {
|
|
84665
84671
|
const ancestorFacts = enterSubtree(
|
|
84666
84672
|
32670 /* FunctionExcludes */,
|
|
84667
|
-
getEmitFlags(node) &
|
|
84673
|
+
getEmitFlags(node) & 16 /* CapturesThis */ ? 65 /* FunctionIncludes */ | 16 /* CapturesThis */ : 65 /* FunctionIncludes */
|
|
84668
84674
|
);
|
|
84669
84675
|
previousOnEmitNode(hint, node, emitCallback);
|
|
84670
84676
|
exitSubtree(ancestorFacts, 0 /* None */, 0 /* None */);
|
|
@@ -85146,7 +85152,7 @@ function transformGenerators(context) {
|
|
|
85146
85152
|
transformAndEmitVariableDeclarationList(node.declarationList);
|
|
85147
85153
|
return void 0;
|
|
85148
85154
|
} else {
|
|
85149
|
-
if (getEmitFlags(node) &
|
|
85155
|
+
if (getEmitFlags(node) & 2097152 /* CustomPrologue */) {
|
|
85150
85156
|
return node;
|
|
85151
85157
|
}
|
|
85152
85158
|
for (const variable of node.declarationList.declarations) {
|
|
@@ -85303,7 +85309,7 @@ function transformGenerators(context) {
|
|
|
85303
85309
|
const resumeLabel = defineLabel();
|
|
85304
85310
|
const expression = visitNode(node.expression, visitor, isExpression);
|
|
85305
85311
|
if (node.asteriskToken) {
|
|
85306
|
-
const iterator = (getEmitFlags(node.expression) &
|
|
85312
|
+
const iterator = (getEmitFlags(node.expression) & 16777216 /* Iterator */) === 0 ? setTextRange(emitHelpers().createValuesHelper(expression), node) : expression;
|
|
85307
85313
|
emitYieldStar(iterator, node);
|
|
85308
85314
|
} else {
|
|
85309
85315
|
emitYield(expression, node);
|
|
@@ -85961,7 +85967,7 @@ function transformGenerators(context) {
|
|
|
85961
85967
|
return node;
|
|
85962
85968
|
}
|
|
85963
85969
|
function cacheExpression(node) {
|
|
85964
|
-
if (isGeneratedIdentifier(node) || getEmitFlags(node) &
|
|
85970
|
+
if (isGeneratedIdentifier(node) || getEmitFlags(node) & 8192 /* HelperName */) {
|
|
85965
85971
|
return node;
|
|
85966
85972
|
}
|
|
85967
85973
|
const temp = factory2.createTempVariable(hoistVariableDeclaration);
|
|
@@ -86367,7 +86373,7 @@ function transformGenerators(context) {
|
|
|
86367
86373
|
buildResult.length > 0
|
|
86368
86374
|
)
|
|
86369
86375
|
),
|
|
86370
|
-
|
|
86376
|
+
1048576 /* ReuseTempVariableScope */
|
|
86371
86377
|
)
|
|
86372
86378
|
);
|
|
86373
86379
|
}
|
|
@@ -86611,7 +86617,7 @@ function transformGenerators(context) {
|
|
|
86611
86617
|
),
|
|
86612
86618
|
operationLocation
|
|
86613
86619
|
),
|
|
86614
|
-
|
|
86620
|
+
768 /* NoTokenSourceMaps */
|
|
86615
86621
|
)
|
|
86616
86622
|
);
|
|
86617
86623
|
}
|
|
@@ -86628,7 +86634,7 @@ function transformGenerators(context) {
|
|
|
86628
86634
|
),
|
|
86629
86635
|
operationLocation
|
|
86630
86636
|
),
|
|
86631
|
-
|
|
86637
|
+
768 /* NoTokenSourceMaps */
|
|
86632
86638
|
)
|
|
86633
86639
|
);
|
|
86634
86640
|
}
|
|
@@ -86647,7 +86653,7 @@ function transformGenerators(context) {
|
|
|
86647
86653
|
),
|
|
86648
86654
|
operationLocation
|
|
86649
86655
|
),
|
|
86650
|
-
|
|
86656
|
+
768 /* NoTokenSourceMaps */
|
|
86651
86657
|
)
|
|
86652
86658
|
),
|
|
86653
86659
|
1 /* SingleLine */
|
|
@@ -86669,7 +86675,7 @@ function transformGenerators(context) {
|
|
|
86669
86675
|
),
|
|
86670
86676
|
operationLocation
|
|
86671
86677
|
),
|
|
86672
|
-
|
|
86678
|
+
768 /* NoTokenSourceMaps */
|
|
86673
86679
|
)
|
|
86674
86680
|
),
|
|
86675
86681
|
1 /* SingleLine */
|
|
@@ -86688,7 +86694,7 @@ function transformGenerators(context) {
|
|
|
86688
86694
|
),
|
|
86689
86695
|
operationLocation
|
|
86690
86696
|
),
|
|
86691
|
-
|
|
86697
|
+
768 /* NoTokenSourceMaps */
|
|
86692
86698
|
)
|
|
86693
86699
|
);
|
|
86694
86700
|
}
|
|
@@ -86705,7 +86711,7 @@ function transformGenerators(context) {
|
|
|
86705
86711
|
),
|
|
86706
86712
|
operationLocation
|
|
86707
86713
|
),
|
|
86708
|
-
|
|
86714
|
+
768 /* NoTokenSourceMaps */
|
|
86709
86715
|
)
|
|
86710
86716
|
);
|
|
86711
86717
|
}
|
|
@@ -86990,7 +86996,7 @@ function transformModule(context) {
|
|
|
86990
86996
|
const importAliasName = getLocalNameForExternalImport(factory2, importNode, currentSourceFile);
|
|
86991
86997
|
if (externalModuleName) {
|
|
86992
86998
|
if (includeNonAmdDependencies && importAliasName) {
|
|
86993
|
-
setEmitFlags(importAliasName,
|
|
86999
|
+
setEmitFlags(importAliasName, 8 /* NoSubstitution */);
|
|
86994
87000
|
aliasedModuleNames.push(externalModuleName);
|
|
86995
87001
|
importAliasNames.push(factory2.createParameterDeclaration(void 0, void 0, importAliasName));
|
|
86996
87002
|
} else {
|
|
@@ -87041,7 +87047,7 @@ function transformModule(context) {
|
|
|
87041
87047
|
if (emitAsReturn) {
|
|
87042
87048
|
const statement = factory2.createReturnStatement(expressionResult);
|
|
87043
87049
|
setTextRange(statement, currentModuleInfo.exportEquals);
|
|
87044
|
-
setEmitFlags(statement,
|
|
87050
|
+
setEmitFlags(statement, 768 /* NoTokenSourceMaps */ | 3072 /* NoComments */);
|
|
87045
87051
|
statements.push(statement);
|
|
87046
87052
|
} else {
|
|
87047
87053
|
const statement = factory2.createExpressionStatement(
|
|
@@ -87054,7 +87060,7 @@ function transformModule(context) {
|
|
|
87054
87060
|
)
|
|
87055
87061
|
);
|
|
87056
87062
|
setTextRange(statement, currentModuleInfo.exportEquals);
|
|
87057
|
-
setEmitFlags(statement,
|
|
87063
|
+
setEmitFlags(statement, 3072 /* NoComments */);
|
|
87058
87064
|
statements.push(statement);
|
|
87059
87065
|
}
|
|
87060
87066
|
}
|
|
@@ -87239,7 +87245,7 @@ function transformModule(context) {
|
|
|
87239
87245
|
function createImportCallExpressionUMD(arg, containsLexicalThis) {
|
|
87240
87246
|
needUMDDynamicImportHelper = true;
|
|
87241
87247
|
if (isSimpleCopiableExpression(arg)) {
|
|
87242
|
-
const argClone = isGeneratedIdentifier(arg) ? arg : isStringLiteral(arg) ? factory2.createStringLiteralFromNode(arg) : setEmitFlags(setTextRange(factory2.cloneNode(arg), arg),
|
|
87248
|
+
const argClone = isGeneratedIdentifier(arg) ? arg : isStringLiteral(arg) ? factory2.createStringLiteralFromNode(arg) : setEmitFlags(setTextRange(factory2.cloneNode(arg), arg), 3072 /* NoComments */);
|
|
87243
87249
|
return factory2.createConditionalExpression(
|
|
87244
87250
|
factory2.createIdentifier("__syncRequire"),
|
|
87245
87251
|
void 0,
|
|
@@ -87295,7 +87301,7 @@ function transformModule(context) {
|
|
|
87295
87301
|
body
|
|
87296
87302
|
);
|
|
87297
87303
|
if (containsLexicalThis) {
|
|
87298
|
-
setEmitFlags(func,
|
|
87304
|
+
setEmitFlags(func, 16 /* CapturesThis */);
|
|
87299
87305
|
}
|
|
87300
87306
|
}
|
|
87301
87307
|
const promise = factory2.createNewExpression(factory2.createIdentifier("Promise"), void 0, [func]);
|
|
@@ -87305,26 +87311,43 @@ function transformModule(context) {
|
|
|
87305
87311
|
return promise;
|
|
87306
87312
|
}
|
|
87307
87313
|
function createImportCallExpressionCommonJS(arg, isInlineable) {
|
|
87308
|
-
const
|
|
87314
|
+
const needSyncEval = arg && !isSimpleInlineableExpression(arg) && !isInlineable;
|
|
87309
87315
|
const promiseResolveCall = factory2.createCallExpression(
|
|
87310
87316
|
factory2.createPropertyAccessExpression(factory2.createIdentifier("Promise"), "resolve"),
|
|
87311
87317
|
void 0,
|
|
87312
|
-
[
|
|
87318
|
+
needSyncEval ? languageVersion >= 2 /* ES2015 */ ? [
|
|
87319
|
+
factory2.createTemplateExpression(factory2.createTemplateHead(""), [
|
|
87320
|
+
factory2.createTemplateSpan(arg, factory2.createTemplateTail(""))
|
|
87321
|
+
])
|
|
87322
|
+
] : [
|
|
87323
|
+
factory2.createCallExpression(
|
|
87324
|
+
factory2.createPropertyAccessExpression(factory2.createStringLiteral(""), "concat"),
|
|
87325
|
+
void 0,
|
|
87326
|
+
[arg]
|
|
87327
|
+
)
|
|
87328
|
+
] : []
|
|
87313
87329
|
);
|
|
87314
87330
|
let requireCall = factory2.createCallExpression(
|
|
87315
87331
|
factory2.createIdentifier("require"),
|
|
87316
87332
|
void 0,
|
|
87317
|
-
|
|
87333
|
+
needSyncEval ? [factory2.createIdentifier("s")] : arg ? [arg] : []
|
|
87318
87334
|
);
|
|
87319
87335
|
if (getESModuleInterop(compilerOptions)) {
|
|
87320
87336
|
requireCall = emitHelpers().createImportStarHelper(requireCall);
|
|
87321
87337
|
}
|
|
87338
|
+
const parameters = needSyncEval ? [
|
|
87339
|
+
factory2.createParameterDeclaration(
|
|
87340
|
+
void 0,
|
|
87341
|
+
void 0,
|
|
87342
|
+
"s"
|
|
87343
|
+
)
|
|
87344
|
+
] : [];
|
|
87322
87345
|
let func;
|
|
87323
87346
|
if (languageVersion >= 2 /* ES2015 */) {
|
|
87324
87347
|
func = factory2.createArrowFunction(
|
|
87325
87348
|
void 0,
|
|
87326
87349
|
void 0,
|
|
87327
|
-
|
|
87350
|
+
parameters,
|
|
87328
87351
|
void 0,
|
|
87329
87352
|
void 0,
|
|
87330
87353
|
requireCall
|
|
@@ -87335,16 +87358,16 @@ function transformModule(context) {
|
|
|
87335
87358
|
void 0,
|
|
87336
87359
|
void 0,
|
|
87337
87360
|
void 0,
|
|
87338
|
-
|
|
87361
|
+
parameters,
|
|
87339
87362
|
void 0,
|
|
87340
87363
|
factory2.createBlock([factory2.createReturnStatement(requireCall)])
|
|
87341
87364
|
);
|
|
87342
87365
|
}
|
|
87343
87366
|
const downleveledImport = factory2.createCallExpression(factory2.createPropertyAccessExpression(promiseResolveCall, "then"), void 0, [func]);
|
|
87344
|
-
return
|
|
87367
|
+
return downleveledImport;
|
|
87345
87368
|
}
|
|
87346
87369
|
function getHelperExpressionForExport(node, innerExpr) {
|
|
87347
|
-
if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) &
|
|
87370
|
+
if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) {
|
|
87348
87371
|
return innerExpr;
|
|
87349
87372
|
}
|
|
87350
87373
|
if (getExportNeedsImportStarHelper(node)) {
|
|
@@ -87353,7 +87376,7 @@ function transformModule(context) {
|
|
|
87353
87376
|
return innerExpr;
|
|
87354
87377
|
}
|
|
87355
87378
|
function getHelperExpressionForImport(node, innerExpr) {
|
|
87356
|
-
if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) &
|
|
87379
|
+
if (!getESModuleInterop(compilerOptions) || getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) {
|
|
87357
87380
|
return innerExpr;
|
|
87358
87381
|
}
|
|
87359
87382
|
if (getImportNeedsImportStarHelper(node)) {
|
|
@@ -87570,7 +87593,7 @@ function transformModule(context) {
|
|
|
87570
87593
|
)
|
|
87571
87594
|
);
|
|
87572
87595
|
} else {
|
|
87573
|
-
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) &
|
|
87596
|
+
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getEmitFlags(node) & 134217728 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default";
|
|
87574
87597
|
const exportedValue = factory2.createPropertyAccessExpression(
|
|
87575
87598
|
exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName,
|
|
87576
87599
|
specifier.propertyName || specifier.name
|
|
@@ -87759,7 +87782,7 @@ function transformModule(context) {
|
|
|
87759
87782
|
if (exportedNames) {
|
|
87760
87783
|
let expression = isExportName(name) ? value : factory2.createAssignment(name, value);
|
|
87761
87784
|
for (const exportName of exportedNames) {
|
|
87762
|
-
setEmitFlags(expression,
|
|
87785
|
+
setEmitFlags(expression, 8 /* NoSubstitution */);
|
|
87763
87786
|
expression = createExportExpression(exportName, expression, location);
|
|
87764
87787
|
}
|
|
87765
87788
|
return expression;
|
|
@@ -87797,7 +87820,7 @@ function transformModule(context) {
|
|
|
87797
87820
|
return node;
|
|
87798
87821
|
}
|
|
87799
87822
|
function hasAssociatedEndOfDeclarationMarker(node) {
|
|
87800
|
-
return (getEmitFlags(node) &
|
|
87823
|
+
return (getEmitFlags(node) & 8388608 /* HasEndOfDeclarationMarker */) !== 0;
|
|
87801
87824
|
}
|
|
87802
87825
|
function visitEndOfDeclarationMarker(node) {
|
|
87803
87826
|
const id = getOriginalNodeId(node);
|
|
@@ -87915,14 +87938,14 @@ function transformModule(context) {
|
|
|
87915
87938
|
)
|
|
87916
87939
|
);
|
|
87917
87940
|
}
|
|
87918
|
-
setEmitFlags(statement,
|
|
87941
|
+
setEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
87919
87942
|
return statement;
|
|
87920
87943
|
}
|
|
87921
87944
|
function createExportStatement(name, value, location, allowComments, liveBinding) {
|
|
87922
87945
|
const statement = setTextRange(factory2.createExpressionStatement(createExportExpression(name, value, void 0, liveBinding)), location);
|
|
87923
87946
|
startOnNewLine(statement);
|
|
87924
87947
|
if (!allowComments) {
|
|
87925
|
-
setEmitFlags(statement,
|
|
87948
|
+
setEmitFlags(statement, 3072 /* NoComments */);
|
|
87926
87949
|
}
|
|
87927
87950
|
return statement;
|
|
87928
87951
|
}
|
|
@@ -88020,7 +88043,7 @@ function transformModule(context) {
|
|
|
88020
88043
|
if (isIdentifier(node.expression)) {
|
|
88021
88044
|
const expression = substituteExpressionIdentifier(node.expression);
|
|
88022
88045
|
noSubstitution[getNodeId(expression)] = true;
|
|
88023
|
-
if (!isIdentifier(expression) && !(getEmitFlags(node.expression) &
|
|
88046
|
+
if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192 /* HelperName */)) {
|
|
88024
88047
|
return addEmitFlags(
|
|
88025
88048
|
factory2.updateCallExpression(
|
|
88026
88049
|
node,
|
|
@@ -88028,7 +88051,7 @@ function transformModule(context) {
|
|
|
88028
88051
|
void 0,
|
|
88029
88052
|
node.arguments
|
|
88030
88053
|
),
|
|
88031
|
-
|
|
88054
|
+
1073741824 /* IndirectCall */
|
|
88032
88055
|
);
|
|
88033
88056
|
}
|
|
88034
88057
|
}
|
|
@@ -88038,7 +88061,7 @@ function transformModule(context) {
|
|
|
88038
88061
|
if (isIdentifier(node.tag)) {
|
|
88039
88062
|
const tag = substituteExpressionIdentifier(node.tag);
|
|
88040
88063
|
noSubstitution[getNodeId(tag)] = true;
|
|
88041
|
-
if (!isIdentifier(tag) && !(getEmitFlags(node.tag) &
|
|
88064
|
+
if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192 /* HelperName */)) {
|
|
88042
88065
|
return addEmitFlags(
|
|
88043
88066
|
factory2.updateTaggedTemplateExpression(
|
|
88044
88067
|
node,
|
|
@@ -88046,7 +88069,7 @@ function transformModule(context) {
|
|
|
88046
88069
|
void 0,
|
|
88047
88070
|
node.template
|
|
88048
88071
|
),
|
|
88049
|
-
|
|
88072
|
+
1073741824 /* IndirectCall */
|
|
88050
88073
|
);
|
|
88051
88074
|
}
|
|
88052
88075
|
}
|
|
@@ -88054,7 +88077,7 @@ function transformModule(context) {
|
|
|
88054
88077
|
}
|
|
88055
88078
|
function substituteExpressionIdentifier(node) {
|
|
88056
88079
|
var _a2, _b;
|
|
88057
|
-
if (getEmitFlags(node) &
|
|
88080
|
+
if (getEmitFlags(node) & 8192 /* HelperName */) {
|
|
88058
88081
|
const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile);
|
|
88059
88082
|
if (externalHelpersModuleName) {
|
|
88060
88083
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
@@ -88201,7 +88224,7 @@ function transformSystemModule(context) {
|
|
|
88201
88224
|
node.statements
|
|
88202
88225
|
)
|
|
88203
88226
|
),
|
|
88204
|
-
|
|
88227
|
+
2048 /* NoTrailingComments */
|
|
88205
88228
|
);
|
|
88206
88229
|
if (!outFile(compilerOptions)) {
|
|
88207
88230
|
moveEmitHelpers(updated, moduleBodyBlock, (helper) => !helper.scoped);
|
|
@@ -88659,7 +88682,7 @@ function transformSystemModule(context) {
|
|
|
88659
88682
|
}
|
|
88660
88683
|
}
|
|
88661
88684
|
function shouldHoistVariableDeclarationList(node) {
|
|
88662
|
-
return (getEmitFlags(node) &
|
|
88685
|
+
return (getEmitFlags(node) & 4194304 /* NoHoisting */) === 0 && (enclosingBlockScopedContainer.kind === 308 /* SourceFile */ || (getOriginalNode(node).flags & 3 /* BlockScoped */) === 0);
|
|
88663
88686
|
}
|
|
88664
88687
|
function transformInitializedVariable(node, isExportedDeclaration) {
|
|
88665
88688
|
const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment;
|
|
@@ -88691,7 +88714,7 @@ function transformSystemModule(context) {
|
|
|
88691
88714
|
return node;
|
|
88692
88715
|
}
|
|
88693
88716
|
function hasAssociatedEndOfDeclarationMarker(node) {
|
|
88694
|
-
return (getEmitFlags(node) &
|
|
88717
|
+
return (getEmitFlags(node) & 8388608 /* HasEndOfDeclarationMarker */) !== 0;
|
|
88695
88718
|
}
|
|
88696
88719
|
function visitEndOfDeclarationMarker(node) {
|
|
88697
88720
|
const id = getOriginalNodeId(node);
|
|
@@ -88808,13 +88831,13 @@ function transformSystemModule(context) {
|
|
|
88808
88831
|
const statement = factory2.createExpressionStatement(createExportExpression(name, value));
|
|
88809
88832
|
startOnNewLine(statement);
|
|
88810
88833
|
if (!allowComments) {
|
|
88811
|
-
setEmitFlags(statement,
|
|
88834
|
+
setEmitFlags(statement, 3072 /* NoComments */);
|
|
88812
88835
|
}
|
|
88813
88836
|
return statement;
|
|
88814
88837
|
}
|
|
88815
88838
|
function createExportExpression(name, value) {
|
|
88816
88839
|
const exportName = isIdentifier(name) ? factory2.createStringLiteralFromNode(name) : name;
|
|
88817
|
-
setEmitFlags(value, getEmitFlags(value) |
|
|
88840
|
+
setEmitFlags(value, getEmitFlags(value) | 3072 /* NoComments */);
|
|
88818
88841
|
return setCommentRange(factory2.createCallExpression(exportFunction, void 0, [exportName, value]), value);
|
|
88819
88842
|
}
|
|
88820
88843
|
function topLevelNestedVisitor(node) {
|
|
@@ -89205,7 +89228,7 @@ function transformSystemModule(context) {
|
|
|
89205
89228
|
}
|
|
89206
89229
|
function substituteExpressionIdentifier(node) {
|
|
89207
89230
|
var _a2, _b;
|
|
89208
|
-
if (getEmitFlags(node) &
|
|
89231
|
+
if (getEmitFlags(node) & 8192 /* HelperName */) {
|
|
89209
89232
|
const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile);
|
|
89210
89233
|
if (externalHelpersModuleName) {
|
|
89211
89234
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
@@ -89479,7 +89502,7 @@ function transformECMAScriptModule(context) {
|
|
|
89479
89502
|
}
|
|
89480
89503
|
function onSubstituteNode(hint, node) {
|
|
89481
89504
|
node = previousOnSubstituteNode(hint, node);
|
|
89482
|
-
if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) &
|
|
89505
|
+
if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
|
|
89483
89506
|
return substituteHelperName(node);
|
|
89484
89507
|
}
|
|
89485
89508
|
return node;
|
|
@@ -91504,7 +91527,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91504
91527
|
enabledSyntaxKindFeatures[kind] |= 1 /* Substitution */;
|
|
91505
91528
|
}
|
|
91506
91529
|
function isSubstitutionEnabled(node) {
|
|
91507
|
-
return (enabledSyntaxKindFeatures[node.kind] & 1 /* Substitution */) !== 0 && (getEmitFlags(node) &
|
|
91530
|
+
return (enabledSyntaxKindFeatures[node.kind] & 1 /* Substitution */) !== 0 && (getEmitFlags(node) & 8 /* NoSubstitution */) === 0;
|
|
91508
91531
|
}
|
|
91509
91532
|
function substituteNode(hint, node) {
|
|
91510
91533
|
Debug.assert(state < 3 /* Disposed */, "Cannot substitute a node after the result is disposed.");
|
|
@@ -91515,7 +91538,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91515
91538
|
enabledSyntaxKindFeatures[kind] |= 2 /* EmitNotifications */;
|
|
91516
91539
|
}
|
|
91517
91540
|
function isEmitNotificationEnabled(node) {
|
|
91518
|
-
return (enabledSyntaxKindFeatures[node.kind] & 2 /* EmitNotifications */) !== 0 || (getEmitFlags(node) &
|
|
91541
|
+
return (enabledSyntaxKindFeatures[node.kind] & 2 /* EmitNotifications */) !== 0 || (getEmitFlags(node) & 4 /* AdviseOnEmitNode */) !== 0;
|
|
91519
91542
|
}
|
|
91520
91543
|
function emitNodeWithNotification(hint, node, emitCallback) {
|
|
91521
91544
|
Debug.assert(state < 3 /* Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed.");
|
|
@@ -91530,7 +91553,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91530
91553
|
function hoistVariableDeclaration(name) {
|
|
91531
91554
|
Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization.");
|
|
91532
91555
|
Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed.");
|
|
91533
|
-
const decl = setEmitFlags(factory2.createVariableDeclaration(name),
|
|
91556
|
+
const decl = setEmitFlags(factory2.createVariableDeclaration(name), 128 /* NoNestedSourceMaps */);
|
|
91534
91557
|
if (!lexicalEnvironmentVariableDeclarations) {
|
|
91535
91558
|
lexicalEnvironmentVariableDeclarations = [decl];
|
|
91536
91559
|
} else {
|
|
@@ -91543,7 +91566,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91543
91566
|
function hoistFunctionDeclaration(func) {
|
|
91544
91567
|
Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization.");
|
|
91545
91568
|
Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed.");
|
|
91546
|
-
setEmitFlags(func,
|
|
91569
|
+
setEmitFlags(func, 2097152 /* CustomPrologue */);
|
|
91547
91570
|
if (!lexicalEnvironmentFunctionDeclarations) {
|
|
91548
91571
|
lexicalEnvironmentFunctionDeclarations = [func];
|
|
91549
91572
|
} else {
|
|
@@ -91553,7 +91576,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91553
91576
|
function addInitializationStatement(node) {
|
|
91554
91577
|
Debug.assert(state > 0 /* Uninitialized */, "Cannot modify the lexical environment during initialization.");
|
|
91555
91578
|
Debug.assert(state < 2 /* Completed */, "Cannot modify the lexical environment after transformation has completed.");
|
|
91556
|
-
setEmitFlags(node,
|
|
91579
|
+
setEmitFlags(node, 2097152 /* CustomPrologue */);
|
|
91557
91580
|
if (!lexicalEnvironmentStatements) {
|
|
91558
91581
|
lexicalEnvironmentStatements = [node];
|
|
91559
91582
|
} else {
|
|
@@ -91600,7 +91623,7 @@ function transformNodes(resolver, host, factory2, options, nodes, transformers,
|
|
|
91600
91623
|
void 0,
|
|
91601
91624
|
factory2.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations)
|
|
91602
91625
|
);
|
|
91603
|
-
setEmitFlags(statement,
|
|
91626
|
+
setEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
91604
91627
|
if (!statements) {
|
|
91605
91628
|
statements = [statement];
|
|
91606
91629
|
} else {
|
|
@@ -92160,7 +92183,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
92160
92183
|
const sourceMap = sourceMapGenerator.toString();
|
|
92161
92184
|
writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
|
|
92162
92185
|
if (printer.bundleFileInfo)
|
|
92163
|
-
printer.bundleFileInfo.mapHash = computeSignature(sourceMap,
|
|
92186
|
+
printer.bundleFileInfo.mapHash = computeSignature(sourceMap, host);
|
|
92164
92187
|
}
|
|
92165
92188
|
} else {
|
|
92166
92189
|
writer.writeLine();
|
|
@@ -92168,7 +92191,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
92168
92191
|
const text = writer.getText();
|
|
92169
92192
|
writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos, diagnostics: transform.diagnostics });
|
|
92170
92193
|
if (printer.bundleFileInfo)
|
|
92171
|
-
printer.bundleFileInfo.hash = computeSignature(text,
|
|
92194
|
+
printer.bundleFileInfo.hash = computeSignature(text, host);
|
|
92172
92195
|
writer.clear();
|
|
92173
92196
|
}
|
|
92174
92197
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
@@ -92314,7 +92337,6 @@ function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
|
|
|
92314
92337
|
return result;
|
|
92315
92338
|
}
|
|
92316
92339
|
function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers) {
|
|
92317
|
-
const createHash = maybeBind(host, host.createHash);
|
|
92318
92340
|
const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, false);
|
|
92319
92341
|
const buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
|
|
92320
92342
|
if (!buildInfo)
|
|
@@ -92324,22 +92346,22 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92324
92346
|
const jsFileText = host.readFile(Debug.checkDefined(jsFilePath));
|
|
92325
92347
|
if (!jsFileText)
|
|
92326
92348
|
return jsFilePath;
|
|
92327
|
-
if (computeSignature(jsFileText,
|
|
92349
|
+
if (computeSignature(jsFileText, host) !== buildInfo.bundle.js.hash)
|
|
92328
92350
|
return jsFilePath;
|
|
92329
92351
|
const sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
|
|
92330
92352
|
if (sourceMapFilePath && !sourceMapText || config.options.inlineSourceMap)
|
|
92331
92353
|
return sourceMapFilePath || "inline sourcemap decoding";
|
|
92332
|
-
if (sourceMapFilePath && computeSignature(sourceMapText,
|
|
92354
|
+
if (sourceMapFilePath && computeSignature(sourceMapText, host) !== buildInfo.bundle.js.mapHash)
|
|
92333
92355
|
return sourceMapFilePath;
|
|
92334
92356
|
const declarationText = declarationFilePath && host.readFile(declarationFilePath);
|
|
92335
92357
|
if (declarationFilePath && !declarationText)
|
|
92336
92358
|
return declarationFilePath;
|
|
92337
|
-
if (declarationFilePath && computeSignature(declarationText,
|
|
92359
|
+
if (declarationFilePath && computeSignature(declarationText, host) !== buildInfo.bundle.dts.hash)
|
|
92338
92360
|
return declarationFilePath;
|
|
92339
92361
|
const declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
|
|
92340
92362
|
if (declarationMapPath && !declarationMapText || config.options.inlineSourceMap)
|
|
92341
92363
|
return declarationMapPath || "inline sourcemap decoding";
|
|
92342
|
-
if (declarationMapPath && computeSignature(declarationMapText,
|
|
92364
|
+
if (declarationMapPath && computeSignature(declarationMapText, host) !== buildInfo.bundle.dts.mapHash)
|
|
92343
92365
|
return declarationMapPath;
|
|
92344
92366
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
92345
92367
|
const ownPrependInput = createInputFilesWithFileTexts(
|
|
@@ -92409,7 +92431,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92409
92431
|
getBuildInfo: (bundle) => {
|
|
92410
92432
|
const program = buildInfo.program;
|
|
92411
92433
|
if (program && changedDtsText !== void 0 && config.options.composite) {
|
|
92412
|
-
program.outSignature = computeSignature(changedDtsText,
|
|
92434
|
+
program.outSignature = computeSignature(changedDtsText, host, changedDtsData);
|
|
92413
92435
|
}
|
|
92414
92436
|
const { js, dts, sourceFiles } = buildInfo.bundle;
|
|
92415
92437
|
bundle.js.sources = js.sources;
|
|
@@ -92422,7 +92444,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92422
92444
|
getSourceFileFromReference: returnUndefined,
|
|
92423
92445
|
redirectTargetsMap: createMultiMap(),
|
|
92424
92446
|
getFileIncludeReasons: notImplemented,
|
|
92425
|
-
createHash
|
|
92447
|
+
createHash: maybeBind(host, host.createHash)
|
|
92426
92448
|
};
|
|
92427
92449
|
emitFiles(
|
|
92428
92450
|
notImplementedResolver,
|
|
@@ -92739,7 +92761,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
92739
92761
|
pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node);
|
|
92740
92762
|
}
|
|
92741
92763
|
function beforeEmitNode(node) {
|
|
92742
|
-
if (preserveSourceNewlines && getEmitFlags(node) &
|
|
92764
|
+
if (preserveSourceNewlines && getEmitFlags(node) & 268435456 /* IgnoreSourceNewlines */) {
|
|
92743
92765
|
preserveSourceNewlines = false;
|
|
92744
92766
|
}
|
|
92745
92767
|
}
|
|
@@ -93772,7 +93794,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93772
93794
|
}
|
|
93773
93795
|
function emitObjectLiteralExpression(node) {
|
|
93774
93796
|
forEach(node.properties, generateMemberNames);
|
|
93775
|
-
const indentedFlag = getEmitFlags(node) &
|
|
93797
|
+
const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
|
|
93776
93798
|
if (indentedFlag) {
|
|
93777
93799
|
increaseIndent();
|
|
93778
93800
|
}
|
|
@@ -93820,7 +93842,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93820
93842
|
emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node);
|
|
93821
93843
|
}
|
|
93822
93844
|
function emitCallExpression(node) {
|
|
93823
|
-
const indirectCall = getEmitFlags(node) &
|
|
93845
|
+
const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */;
|
|
93824
93846
|
if (indirectCall) {
|
|
93825
93847
|
writePunctuation("(");
|
|
93826
93848
|
writeLiteral("0");
|
|
@@ -93843,7 +93865,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93843
93865
|
emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma);
|
|
93844
93866
|
}
|
|
93845
93867
|
function emitTaggedTemplateExpression(node) {
|
|
93846
|
-
const indirectCall = getEmitFlags(node) &
|
|
93868
|
+
const indirectCall = getEmitFlags(node) & 1073741824 /* IndirectCall */;
|
|
93847
93869
|
if (indirectCall) {
|
|
93848
93870
|
writePunctuation("(");
|
|
93849
93871
|
writeLiteral("0");
|
|
@@ -94336,7 +94358,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94336
94358
|
const body = node.body;
|
|
94337
94359
|
if (body) {
|
|
94338
94360
|
if (isBlock(body)) {
|
|
94339
|
-
const indentedFlag = getEmitFlags(node) &
|
|
94361
|
+
const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
|
|
94340
94362
|
if (indentedFlag) {
|
|
94341
94363
|
increaseIndent();
|
|
94342
94364
|
}
|
|
@@ -94423,7 +94445,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94423
94445
|
writeSpace();
|
|
94424
94446
|
emitIdentifierName(node.name);
|
|
94425
94447
|
}
|
|
94426
|
-
const indentedFlag = getEmitFlags(node) &
|
|
94448
|
+
const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
|
|
94427
94449
|
if (indentedFlag) {
|
|
94428
94450
|
increaseIndent();
|
|
94429
94451
|
}
|
|
@@ -94611,7 +94633,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94611
94633
|
writePunctuation(":");
|
|
94612
94634
|
writeSpace();
|
|
94613
94635
|
const value = node.value;
|
|
94614
|
-
if ((getEmitFlags(value) &
|
|
94636
|
+
if ((getEmitFlags(value) & 1024 /* NoLeadingComments */) === 0) {
|
|
94615
94637
|
const commentRange = getCommentRange(value);
|
|
94616
94638
|
emitTrailingCommentsOfPosition(commentRange.pos);
|
|
94617
94639
|
}
|
|
@@ -94799,7 +94821,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94799
94821
|
writePunctuation(":");
|
|
94800
94822
|
writeSpace();
|
|
94801
94823
|
const initializer = node.initializer;
|
|
94802
|
-
if ((getEmitFlags(initializer) &
|
|
94824
|
+
if ((getEmitFlags(initializer) & 1024 /* NoLeadingComments */) === 0) {
|
|
94803
94825
|
const commentRange = getCommentRange(initializer);
|
|
94804
94826
|
emitTrailingCommentsOfPosition(commentRange.pos);
|
|
94805
94827
|
}
|
|
@@ -95051,11 +95073,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95051
95073
|
}
|
|
95052
95074
|
function emitPartiallyEmittedExpression(node) {
|
|
95053
95075
|
const emitFlags = getEmitFlags(node);
|
|
95054
|
-
if (!(emitFlags &
|
|
95076
|
+
if (!(emitFlags & 1024 /* NoLeadingComments */) && node.pos !== node.expression.pos) {
|
|
95055
95077
|
emitTrailingCommentsOfPosition(node.expression.pos);
|
|
95056
95078
|
}
|
|
95057
95079
|
emitExpression(node.expression);
|
|
95058
|
-
if (!(emitFlags &
|
|
95080
|
+
if (!(emitFlags & 2048 /* NoTrailingComments */) && node.end !== node.expression.end) {
|
|
95059
95081
|
emitLeadingCommentsOfPosition(node.expression.end);
|
|
95060
95082
|
}
|
|
95061
95083
|
}
|
|
@@ -95331,7 +95353,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95331
95353
|
}
|
|
95332
95354
|
}
|
|
95333
95355
|
function emitList(parentNode, children, format, parenthesizerRule, start, count) {
|
|
95334
|
-
emitNodeList(
|
|
95356
|
+
emitNodeList(
|
|
95357
|
+
emit,
|
|
95358
|
+
parentNode,
|
|
95359
|
+
children,
|
|
95360
|
+
format | (parentNode && getEmitFlags(parentNode) & 2 /* MultiLine */ ? 65536 /* PreferNewLine */ : 0),
|
|
95361
|
+
parenthesizerRule,
|
|
95362
|
+
start,
|
|
95363
|
+
count
|
|
95364
|
+
);
|
|
95335
95365
|
}
|
|
95336
95366
|
function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) {
|
|
95337
95367
|
emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count);
|
|
@@ -95427,7 +95457,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95427
95457
|
previousSibling = child;
|
|
95428
95458
|
}
|
|
95429
95459
|
const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0;
|
|
95430
|
-
const skipTrailingComments = commentsDisabled || !!(emitFlags &
|
|
95460
|
+
const skipTrailingComments = commentsDisabled || !!(emitFlags & 2048 /* NoTrailingComments */);
|
|
95431
95461
|
const emitTrailingComma = hasTrailingComma && format & 64 /* AllowTrailingComma */ && format & 16 /* CommaDelimited */;
|
|
95432
95462
|
if (emitTrailingComma) {
|
|
95433
95463
|
if (previousSibling && !skipTrailingComments) {
|
|
@@ -95687,7 +95717,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95687
95717
|
return (format & 65536 /* PreferNewLine */) !== 0;
|
|
95688
95718
|
}
|
|
95689
95719
|
function getLinesBetweenNodes(parent, node1, node2) {
|
|
95690
|
-
if (getEmitFlags(parent) &
|
|
95720
|
+
if (getEmitFlags(parent) & 262144 /* NoIndentation */) {
|
|
95691
95721
|
return 0;
|
|
95692
95722
|
}
|
|
95693
95723
|
parent = skipSynthesizedParentheses(parent);
|
|
@@ -95746,7 +95776,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95746
95776
|
const textSourceNode = node.textSourceNode;
|
|
95747
95777
|
if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode)) {
|
|
95748
95778
|
const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode);
|
|
95749
|
-
return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) &
|
|
95779
|
+
return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 33554432 /* NoAsciiEscaping */ ? `"${escapeString(text)}"` : `"${escapeNonAsciiString(text)}"`;
|
|
95750
95780
|
} else {
|
|
95751
95781
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
95752
95782
|
}
|
|
@@ -95755,7 +95785,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95755
95785
|
return getLiteralText(node, currentSourceFile, flags);
|
|
95756
95786
|
}
|
|
95757
95787
|
function pushNameGenerationScope(node) {
|
|
95758
|
-
if (node && getEmitFlags(node) &
|
|
95788
|
+
if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
|
|
95759
95789
|
return;
|
|
95760
95790
|
}
|
|
95761
95791
|
tempFlagsStack.push(tempFlags);
|
|
@@ -95767,7 +95797,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95767
95797
|
reservedNamesStack.push(reservedNames);
|
|
95768
95798
|
}
|
|
95769
95799
|
function popNameGenerationScope(node) {
|
|
95770
|
-
if (node && getEmitFlags(node) &
|
|
95800
|
+
if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
|
|
95771
95801
|
return;
|
|
95772
95802
|
}
|
|
95773
95803
|
tempFlags = tempFlagsStack.pop();
|
|
@@ -95837,7 +95867,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
95837
95867
|
break;
|
|
95838
95868
|
case 259 /* FunctionDeclaration */:
|
|
95839
95869
|
generateNameIfNeeded(node.name);
|
|
95840
|
-
if (getEmitFlags(node) &
|
|
95870
|
+
if (getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
|
|
95841
95871
|
forEach(node.parameters, generateNames);
|
|
95842
95872
|
generateNames(node.body);
|
|
95843
95873
|
}
|
|
@@ -96111,14 +96141,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96111
96141
|
const emitFlags = getEmitFlags(node);
|
|
96112
96142
|
const commentRange = getCommentRange(node);
|
|
96113
96143
|
emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end);
|
|
96114
|
-
if (emitFlags &
|
|
96144
|
+
if (emitFlags & 4096 /* NoNestedComments */) {
|
|
96115
96145
|
commentsDisabled = true;
|
|
96116
96146
|
}
|
|
96117
96147
|
}
|
|
96118
96148
|
function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) {
|
|
96119
96149
|
const emitFlags = getEmitFlags(node);
|
|
96120
96150
|
const commentRange = getCommentRange(node);
|
|
96121
|
-
if (emitFlags &
|
|
96151
|
+
if (emitFlags & 4096 /* NoNestedComments */) {
|
|
96122
96152
|
commentsDisabled = false;
|
|
96123
96153
|
}
|
|
96124
96154
|
emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
|
|
@@ -96130,16 +96160,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96130
96160
|
function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
|
|
96131
96161
|
enterComment();
|
|
96132
96162
|
hasWrittenComment = false;
|
|
96133
|
-
const skipLeadingComments = pos < 0 || (emitFlags &
|
|
96134
|
-
const skipTrailingComments = end < 0 || (emitFlags &
|
|
96163
|
+
const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */;
|
|
96164
|
+
const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
|
|
96135
96165
|
if ((pos > 0 || end > 0) && pos !== end) {
|
|
96136
96166
|
if (!skipLeadingComments) {
|
|
96137
96167
|
emitLeadingComments(pos, node.kind !== 352 /* NotEmittedStatement */);
|
|
96138
96168
|
}
|
|
96139
|
-
if (!skipLeadingComments || pos >= 0 && (emitFlags &
|
|
96169
|
+
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
96140
96170
|
containerPos = pos;
|
|
96141
96171
|
}
|
|
96142
|
-
if (!skipTrailingComments || end >= 0 && (emitFlags &
|
|
96172
|
+
if (!skipTrailingComments || end >= 0 && (emitFlags & 2048 /* NoTrailingComments */) !== 0) {
|
|
96143
96173
|
containerEnd = end;
|
|
96144
96174
|
if (node.kind === 258 /* VariableDeclarationList */) {
|
|
96145
96175
|
declarationListContainerEnd = end;
|
|
@@ -96151,7 +96181,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96151
96181
|
}
|
|
96152
96182
|
function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) {
|
|
96153
96183
|
enterComment();
|
|
96154
|
-
const skipTrailingComments = end < 0 || (emitFlags &
|
|
96184
|
+
const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
|
|
96155
96185
|
forEach(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment);
|
|
96156
96186
|
if ((pos > 0 || end > 0) && pos !== end) {
|
|
96157
96187
|
containerPos = savedContainerPos;
|
|
@@ -96195,13 +96225,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96195
96225
|
enterComment();
|
|
96196
96226
|
const { pos, end } = detachedRange;
|
|
96197
96227
|
const emitFlags = getEmitFlags(node);
|
|
96198
|
-
const skipLeadingComments = pos < 0 || (emitFlags &
|
|
96199
|
-
const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags &
|
|
96228
|
+
const skipLeadingComments = pos < 0 || (emitFlags & 1024 /* NoLeadingComments */) !== 0;
|
|
96229
|
+
const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0;
|
|
96200
96230
|
if (!skipLeadingComments) {
|
|
96201
96231
|
emitDetachedCommentsAndUpdateCommentsInfo(detachedRange);
|
|
96202
96232
|
}
|
|
96203
96233
|
exitComment();
|
|
96204
|
-
if (emitFlags &
|
|
96234
|
+
if (emitFlags & 4096 /* NoNestedComments */ && !commentsDisabled) {
|
|
96205
96235
|
commentsDisabled = true;
|
|
96206
96236
|
emitCallback(node);
|
|
96207
96237
|
commentsDisabled = false;
|
|
@@ -96409,10 +96439,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96409
96439
|
}
|
|
96410
96440
|
} else {
|
|
96411
96441
|
const source = sourceMapRange.source || sourceMapSource;
|
|
96412
|
-
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags &
|
|
96442
|
+
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
96413
96443
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
96414
96444
|
}
|
|
96415
|
-
if (emitFlags &
|
|
96445
|
+
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
96416
96446
|
sourceMapsDisabled = true;
|
|
96417
96447
|
}
|
|
96418
96448
|
}
|
|
@@ -96421,10 +96451,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96421
96451
|
const emitFlags = getEmitFlags(node);
|
|
96422
96452
|
const sourceMapRange = getSourceMapRange(node);
|
|
96423
96453
|
if (!isUnparsedNode(node)) {
|
|
96424
|
-
if (emitFlags &
|
|
96454
|
+
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
96425
96455
|
sourceMapsDisabled = false;
|
|
96426
96456
|
}
|
|
96427
|
-
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags &
|
|
96457
|
+
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
96428
96458
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
96429
96459
|
}
|
|
96430
96460
|
}
|
|
@@ -96466,13 +96496,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96466
96496
|
const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
|
|
96467
96497
|
const source = range && range.source || sourceMapSource;
|
|
96468
96498
|
tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos);
|
|
96469
|
-
if ((emitFlags &
|
|
96499
|
+
if ((emitFlags & 256 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) {
|
|
96470
96500
|
emitSourcePos(source, tokenPos);
|
|
96471
96501
|
}
|
|
96472
96502
|
tokenPos = emitCallback(token, writer2, tokenPos);
|
|
96473
96503
|
if (range)
|
|
96474
96504
|
tokenPos = range.end;
|
|
96475
|
-
if ((emitFlags &
|
|
96505
|
+
if ((emitFlags & 512 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) {
|
|
96476
96506
|
emitSourcePos(source, tokenPos);
|
|
96477
96507
|
}
|
|
96478
96508
|
return tokenPos;
|
|
@@ -97328,16 +97358,15 @@ function loadWithTypeDirectiveCache(names, containingFile, redirectedReference,
|
|
|
97328
97358
|
return [];
|
|
97329
97359
|
}
|
|
97330
97360
|
const resolutions = [];
|
|
97331
|
-
const cache =
|
|
97361
|
+
const cache = createModeAwareCache();
|
|
97332
97362
|
for (const name of names) {
|
|
97333
97363
|
let result;
|
|
97334
97364
|
const mode = getModeForFileReference(name, containingFileMode);
|
|
97335
97365
|
const strName = getResolutionName(name);
|
|
97336
|
-
|
|
97337
|
-
|
|
97338
|
-
result = cache.get(cacheKey);
|
|
97366
|
+
if (cache.has(strName, mode)) {
|
|
97367
|
+
result = cache.get(strName, mode);
|
|
97339
97368
|
} else {
|
|
97340
|
-
cache.set(
|
|
97369
|
+
cache.set(strName, mode, result = loader(strName, containingFile, redirectedReference, mode));
|
|
97341
97370
|
}
|
|
97342
97371
|
resolutions.push(result);
|
|
97343
97372
|
}
|
|
@@ -97413,18 +97442,17 @@ function loadWithModeAwareCache(names, containingFile, containingFileName, redir
|
|
|
97413
97442
|
return [];
|
|
97414
97443
|
}
|
|
97415
97444
|
const resolutions = [];
|
|
97416
|
-
const cache =
|
|
97445
|
+
const cache = createModeAwareCache();
|
|
97417
97446
|
let i = 0;
|
|
97418
97447
|
for (const entry of resolutionInfo ? resolutionInfo.names : names) {
|
|
97419
97448
|
let result;
|
|
97420
97449
|
const mode = !isString(entry) ? getModeForUsageLocation(containingFile, entry) : getModeForResolutionAtIndex(containingFile, i);
|
|
97421
97450
|
i++;
|
|
97422
97451
|
const name = isString(entry) ? entry : entry.text;
|
|
97423
|
-
|
|
97424
|
-
|
|
97425
|
-
result = cache.get(cacheKey);
|
|
97452
|
+
if (cache.has(name, mode)) {
|
|
97453
|
+
result = cache.get(name, mode);
|
|
97426
97454
|
} else {
|
|
97427
|
-
cache.set(
|
|
97455
|
+
cache.set(name, mode, result = loader(name, mode, containingFileName, redirectedReference));
|
|
97428
97456
|
}
|
|
97429
97457
|
resolutions.push(result);
|
|
97430
97458
|
}
|
|
@@ -98926,7 +98954,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98926
98954
|
function createSyntheticImport(text, file) {
|
|
98927
98955
|
const externalHelpersModuleReference = factory.createStringLiteral(text);
|
|
98928
98956
|
const importDecl = factory.createImportDeclaration(void 0, void 0, externalHelpersModuleReference, void 0);
|
|
98929
|
-
addEmitFlags(importDecl,
|
|
98957
|
+
addEmitFlags(importDecl, 134217728 /* NeverApplyImportHelper */);
|
|
98930
98958
|
setParent(externalHelpersModuleReference, importDecl);
|
|
98931
98959
|
setParent(importDecl, file);
|
|
98932
98960
|
externalHelpersModuleReference.flags &= ~8 /* Synthesized */;
|
|
@@ -100479,7 +100507,7 @@ var BuilderState;
|
|
|
100479
100507
|
return oldState && !oldState.referencedMap === !newReferencedMap;
|
|
100480
100508
|
}
|
|
100481
100509
|
BuilderState2.canReuseOldState = canReuseOldState;
|
|
100482
|
-
function create(newProgram,
|
|
100510
|
+
function create(newProgram, oldState, disableUseFileVersionAsSignature) {
|
|
100483
100511
|
var _a2, _b, _c;
|
|
100484
100512
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
100485
100513
|
const options = newProgram.getCompilerOptions();
|
|
@@ -100487,6 +100515,7 @@ var BuilderState;
|
|
|
100487
100515
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
100488
100516
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
100489
100517
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
100518
|
+
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
100490
100519
|
newProgram.getTypeChecker();
|
|
100491
100520
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
100492
100521
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
@@ -100525,30 +100554,29 @@ var BuilderState;
|
|
|
100525
100554
|
state.allFileNames = void 0;
|
|
100526
100555
|
}
|
|
100527
100556
|
BuilderState2.releaseCache = releaseCache2;
|
|
100528
|
-
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken,
|
|
100557
|
+
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, host) {
|
|
100529
100558
|
var _a2, _b;
|
|
100530
100559
|
const result = getFilesAffectedByWithOldState(
|
|
100531
100560
|
state,
|
|
100532
100561
|
programOfThisState,
|
|
100533
100562
|
path,
|
|
100534
100563
|
cancellationToken,
|
|
100535
|
-
|
|
100536
|
-
getCanonicalFileName
|
|
100564
|
+
host
|
|
100537
100565
|
);
|
|
100538
100566
|
(_a2 = state.oldSignatures) == null ? void 0 : _a2.clear();
|
|
100539
100567
|
(_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear();
|
|
100540
100568
|
return result;
|
|
100541
100569
|
}
|
|
100542
100570
|
BuilderState2.getFilesAffectedBy = getFilesAffectedBy;
|
|
100543
|
-
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken,
|
|
100571
|
+
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, host) {
|
|
100544
100572
|
const sourceFile = programOfThisState.getSourceFileByPath(path);
|
|
100545
100573
|
if (!sourceFile) {
|
|
100546
100574
|
return emptyArray;
|
|
100547
100575
|
}
|
|
100548
|
-
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken,
|
|
100576
|
+
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host)) {
|
|
100549
100577
|
return [sourceFile];
|
|
100550
100578
|
}
|
|
100551
|
-
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken,
|
|
100579
|
+
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host);
|
|
100552
100580
|
}
|
|
100553
100581
|
BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
|
|
100554
100582
|
function updateSignatureOfFile(state, signature, path) {
|
|
@@ -100556,7 +100584,7 @@ var BuilderState;
|
|
|
100556
100584
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
|
|
100557
100585
|
}
|
|
100558
100586
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
100559
|
-
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken,
|
|
100587
|
+
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
100560
100588
|
var _a2;
|
|
100561
100589
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
100562
100590
|
return false;
|
|
@@ -100569,10 +100597,10 @@ var BuilderState;
|
|
|
100569
100597
|
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
100570
100598
|
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
100571
100599
|
latestSignature = computeSignatureWithDiagnostics(
|
|
100600
|
+
programOfThisState,
|
|
100572
100601
|
sourceFile,
|
|
100573
100602
|
text,
|
|
100574
|
-
|
|
100575
|
-
getCanonicalFileName,
|
|
100603
|
+
host,
|
|
100576
100604
|
data
|
|
100577
100605
|
);
|
|
100578
100606
|
if (latestSignature !== prevSignature) {
|
|
@@ -100711,7 +100739,7 @@ var BuilderState;
|
|
|
100711
100739
|
}
|
|
100712
100740
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100713
100741
|
}
|
|
100714
|
-
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken,
|
|
100742
|
+
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, host) {
|
|
100715
100743
|
if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
|
|
100716
100744
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100717
100745
|
}
|
|
@@ -100727,7 +100755,7 @@ var BuilderState;
|
|
|
100727
100755
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
100728
100756
|
const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
|
|
100729
100757
|
seenFileNamesMap.set(currentPath, currentSourceFile);
|
|
100730
|
-
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken,
|
|
100758
|
+
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, host)) {
|
|
100731
100759
|
queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
100732
100760
|
}
|
|
100733
100761
|
}
|
|
@@ -100769,9 +100797,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
|
100769
100797
|
function hasSameKeys(map1, map2) {
|
|
100770
100798
|
return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
|
|
100771
100799
|
}
|
|
100772
|
-
function createBuilderProgramState(newProgram,
|
|
100800
|
+
function createBuilderProgramState(newProgram, oldState, disableUseFileVersionAsSignature) {
|
|
100773
100801
|
var _a2, _b;
|
|
100774
|
-
const state = BuilderState.create(newProgram,
|
|
100802
|
+
const state = BuilderState.create(newProgram, oldState, disableUseFileVersionAsSignature);
|
|
100775
100803
|
state.program = newProgram;
|
|
100776
100804
|
const compilerOptions = newProgram.getCompilerOptions();
|
|
100777
100805
|
state.compilerOptions = compilerOptions;
|
|
@@ -100815,7 +100843,7 @@ function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, d
|
|
|
100815
100843
|
return;
|
|
100816
100844
|
const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
|
|
100817
100845
|
if (diagnostics) {
|
|
100818
|
-
state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram
|
|
100846
|
+
state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : diagnostics);
|
|
100819
100847
|
if (!state.semanticDiagnosticsFromOldState) {
|
|
100820
100848
|
state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set();
|
|
100821
100849
|
}
|
|
@@ -100875,10 +100903,11 @@ function addFileToChangeSet(state, path) {
|
|
|
100875
100903
|
function getEmitSignatureFromOldSignature(options, oldOptions, oldEmitSignature) {
|
|
100876
100904
|
return !!options.declarationMap === !!oldOptions.declarationMap ? oldEmitSignature : isString(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0];
|
|
100877
100905
|
}
|
|
100878
|
-
function convertToDiagnostics(diagnostics, newProgram
|
|
100906
|
+
function convertToDiagnostics(diagnostics, newProgram) {
|
|
100879
100907
|
if (!diagnostics.length)
|
|
100880
100908
|
return emptyArray;
|
|
100881
|
-
|
|
100909
|
+
let buildInfoDirectory;
|
|
100910
|
+
let getCanonicalFileName;
|
|
100882
100911
|
return diagnostics.map((diagnostic) => {
|
|
100883
100912
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
100884
100913
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -100890,7 +100919,8 @@ function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
|
|
|
100890
100919
|
return result;
|
|
100891
100920
|
});
|
|
100892
100921
|
function toPath3(path) {
|
|
100893
|
-
|
|
100922
|
+
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
100923
|
+
return toPath(path, buildInfoDirectory, getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames()));
|
|
100894
100924
|
}
|
|
100895
100925
|
}
|
|
100896
100926
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -100932,7 +100962,7 @@ function restoreBuilderProgramEmitState(state, savedEmitState) {
|
|
|
100932
100962
|
function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
|
|
100933
100963
|
Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
|
|
100934
100964
|
}
|
|
100935
|
-
function getNextAffectedFile(state, cancellationToken,
|
|
100965
|
+
function getNextAffectedFile(state, cancellationToken, host) {
|
|
100936
100966
|
var _a2, _b;
|
|
100937
100967
|
while (true) {
|
|
100938
100968
|
const { affectedFiles } = state;
|
|
@@ -100948,8 +100978,6 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
|
|
|
100948
100978
|
state,
|
|
100949
100979
|
affectedFile,
|
|
100950
100980
|
cancellationToken,
|
|
100951
|
-
computeHash,
|
|
100952
|
-
getCanonicalFileName,
|
|
100953
100981
|
host
|
|
100954
100982
|
);
|
|
100955
100983
|
return affectedFile;
|
|
@@ -100977,8 +101005,7 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
|
|
|
100977
101005
|
program,
|
|
100978
101006
|
nextKey.value,
|
|
100979
101007
|
cancellationToken,
|
|
100980
|
-
|
|
100981
|
-
getCanonicalFileName
|
|
101008
|
+
host
|
|
100982
101009
|
);
|
|
100983
101010
|
state.currentChangedFilePath = nextKey.value;
|
|
100984
101011
|
state.affectedFilesIndex = 0;
|
|
@@ -101030,7 +101057,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
|
|
|
101030
101057
|
);
|
|
101031
101058
|
}
|
|
101032
101059
|
}
|
|
101033
|
-
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken,
|
|
101060
|
+
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
101034
101061
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
101035
101062
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
101036
101063
|
removeDiagnosticsOfLibraryFiles(state);
|
|
@@ -101039,8 +101066,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
101039
101066
|
Debug.checkDefined(state.program),
|
|
101040
101067
|
affectedFile,
|
|
101041
101068
|
cancellationToken,
|
|
101042
|
-
|
|
101043
|
-
getCanonicalFileName
|
|
101069
|
+
host
|
|
101044
101070
|
);
|
|
101045
101071
|
return;
|
|
101046
101072
|
}
|
|
@@ -101050,12 +101076,10 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
101050
101076
|
state,
|
|
101051
101077
|
affectedFile,
|
|
101052
101078
|
cancellationToken,
|
|
101053
|
-
computeHash,
|
|
101054
|
-
getCanonicalFileName,
|
|
101055
101079
|
host
|
|
101056
101080
|
);
|
|
101057
101081
|
}
|
|
101058
|
-
function handleDtsMayChangeOf(state, path, cancellationToken,
|
|
101082
|
+
function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
101059
101083
|
removeSemanticDiagnosticsOf(state, path);
|
|
101060
101084
|
if (!state.changedFilesSet.has(path)) {
|
|
101061
101085
|
const program = Debug.checkDefined(state.program);
|
|
@@ -101066,8 +101090,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, getCa
|
|
|
101066
101090
|
program,
|
|
101067
101091
|
sourceFile,
|
|
101068
101092
|
cancellationToken,
|
|
101069
|
-
|
|
101070
|
-
getCanonicalFileName,
|
|
101093
|
+
host,
|
|
101071
101094
|
!host.disableUseFileVersionAsSignature
|
|
101072
101095
|
);
|
|
101073
101096
|
if (getEmitDeclarations(state.compilerOptions)) {
|
|
@@ -101089,7 +101112,7 @@ function isChangedSignature(state, path) {
|
|
|
101089
101112
|
const newSignature = Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
101090
101113
|
return newSignature !== oldSignature;
|
|
101091
101114
|
}
|
|
101092
|
-
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken,
|
|
101115
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host) {
|
|
101093
101116
|
var _a2;
|
|
101094
101117
|
if (!((_a2 = state.fileInfos.get(filePath)) == null ? void 0 : _a2.affectsGlobalScope))
|
|
101095
101118
|
return false;
|
|
@@ -101097,14 +101120,12 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, com
|
|
|
101097
101120
|
state,
|
|
101098
101121
|
file.resolvedPath,
|
|
101099
101122
|
cancellationToken,
|
|
101100
|
-
computeHash,
|
|
101101
|
-
getCanonicalFileName,
|
|
101102
101123
|
host
|
|
101103
101124
|
));
|
|
101104
101125
|
removeDiagnosticsOfLibraryFiles(state);
|
|
101105
101126
|
return true;
|
|
101106
101127
|
}
|
|
101107
|
-
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken,
|
|
101128
|
+
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
101108
101129
|
var _a2;
|
|
101109
101130
|
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
101110
101131
|
return;
|
|
@@ -101118,9 +101139,9 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101118
101139
|
const currentPath = queue.pop();
|
|
101119
101140
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
101120
101141
|
seenFileNamesMap.set(currentPath, true);
|
|
101121
|
-
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken,
|
|
101142
|
+
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, host))
|
|
101122
101143
|
return;
|
|
101123
|
-
handleDtsMayChangeOf(state, currentPath, cancellationToken,
|
|
101144
|
+
handleDtsMayChangeOf(state, currentPath, cancellationToken, host);
|
|
101124
101145
|
if (isChangedSignature(state, currentPath)) {
|
|
101125
101146
|
const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
101126
101147
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -101130,7 +101151,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101130
101151
|
}
|
|
101131
101152
|
const seenFileAndExportsOfFile = /* @__PURE__ */ new Set();
|
|
101132
101153
|
(_a2 = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _a2.forEach((exportedFromPath) => {
|
|
101133
|
-
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken,
|
|
101154
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host))
|
|
101134
101155
|
return true;
|
|
101135
101156
|
const references = state.referencedMap.getKeys(exportedFromPath);
|
|
101136
101157
|
return references && forEachKey(
|
|
@@ -101140,28 +101161,24 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101140
101161
|
filePath,
|
|
101141
101162
|
seenFileAndExportsOfFile,
|
|
101142
101163
|
cancellationToken,
|
|
101143
|
-
computeHash,
|
|
101144
|
-
getCanonicalFileName,
|
|
101145
101164
|
host
|
|
101146
101165
|
)
|
|
101147
101166
|
);
|
|
101148
101167
|
});
|
|
101149
101168
|
}
|
|
101150
|
-
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken,
|
|
101169
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) {
|
|
101151
101170
|
var _a2, _b;
|
|
101152
101171
|
if (!tryAddToSet(seenFileAndExportsOfFile, filePath))
|
|
101153
101172
|
return void 0;
|
|
101154
|
-
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken,
|
|
101173
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host))
|
|
101155
101174
|
return true;
|
|
101156
|
-
handleDtsMayChangeOf(state, filePath, cancellationToken,
|
|
101175
|
+
handleDtsMayChangeOf(state, filePath, cancellationToken, host);
|
|
101157
101176
|
(_a2 = state.exportedModulesMap.getKeys(filePath)) == null ? void 0 : _a2.forEach(
|
|
101158
101177
|
(exportedFromPath) => handleDtsMayChangeOfFileAndExportsOfFile(
|
|
101159
101178
|
state,
|
|
101160
101179
|
exportedFromPath,
|
|
101161
101180
|
seenFileAndExportsOfFile,
|
|
101162
101181
|
cancellationToken,
|
|
101163
|
-
computeHash,
|
|
101164
|
-
getCanonicalFileName,
|
|
101165
101182
|
host
|
|
101166
101183
|
)
|
|
101167
101184
|
);
|
|
@@ -101170,8 +101187,6 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndEx
|
|
|
101170
101187
|
state,
|
|
101171
101188
|
referencingFilePath,
|
|
101172
101189
|
cancellationToken,
|
|
101173
|
-
computeHash,
|
|
101174
|
-
getCanonicalFileName,
|
|
101175
101190
|
host
|
|
101176
101191
|
)
|
|
101177
101192
|
);
|
|
@@ -101200,9 +101215,10 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
101200
101215
|
function isProgramBundleEmitBuildInfo(info) {
|
|
101201
101216
|
return !!outFile(info.options || {});
|
|
101202
101217
|
}
|
|
101203
|
-
function getBuildInfo2(state,
|
|
101218
|
+
function getBuildInfo2(state, bundle) {
|
|
101204
101219
|
var _a2, _b, _c;
|
|
101205
101220
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
101221
|
+
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
101206
101222
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
101207
101223
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
101208
101224
|
const fileNames = [];
|
|
@@ -101287,7 +101303,7 @@ function getBuildInfo2(state, getCanonicalFileName, bundle) {
|
|
|
101287
101303
|
for (const path of arrayFrom(state.affectedFilesPendingEmit.keys()).sort(compareStringsCaseSensitive)) {
|
|
101288
101304
|
if (tryAddToSet(seenFiles, path)) {
|
|
101289
101305
|
const file = state.program.getSourceFileByPath(path);
|
|
101290
|
-
if (!sourceFileMayBeEmitted(file, state.program))
|
|
101306
|
+
if (!file || !sourceFileMayBeEmitted(file, state.program))
|
|
101291
101307
|
continue;
|
|
101292
101308
|
const fileId = toFileId(path), pendingEmit = state.affectedFilesPendingEmit.get(path);
|
|
101293
101309
|
(affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(
|
|
@@ -101421,8 +101437,9 @@ function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldP
|
|
|
101421
101437
|
function getTextHandlingSourceMapForSignature(text, data) {
|
|
101422
101438
|
return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text;
|
|
101423
101439
|
}
|
|
101424
|
-
function computeSignatureWithDiagnostics(sourceFile, text,
|
|
101425
|
-
var _a2;
|
|
101440
|
+
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
101441
|
+
var _a2, _b;
|
|
101442
|
+
let getCanonicalFileName;
|
|
101426
101443
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
101427
101444
|
let sourceFileDirectory;
|
|
101428
101445
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -101430,7 +101447,7 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
|
|
|
101430
101447
|
(diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`
|
|
101431
101448
|
).join("\n");
|
|
101432
101449
|
}
|
|
101433
|
-
return (
|
|
101450
|
+
return ((_b = host.createHash) != null ? _b : generateDjb2Hash)(text);
|
|
101434
101451
|
function flattenDiagnosticMessageText2(diagnostic) {
|
|
101435
101452
|
return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n");
|
|
101436
101453
|
}
|
|
@@ -101439,11 +101456,16 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
|
|
|
101439
101456
|
return `(${diagnostic.start},${diagnostic.length})`;
|
|
101440
101457
|
if (sourceFileDirectory === void 0)
|
|
101441
101458
|
sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath);
|
|
101442
|
-
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101459
|
+
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101460
|
+
sourceFileDirectory,
|
|
101461
|
+
diagnostic.file.resolvedPath,
|
|
101462
|
+
getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames())
|
|
101463
|
+
))}(${diagnostic.start},${diagnostic.length})`;
|
|
101443
101464
|
}
|
|
101444
101465
|
}
|
|
101445
|
-
function computeSignature(text,
|
|
101446
|
-
|
|
101466
|
+
function computeSignature(text, host, data) {
|
|
101467
|
+
var _a2;
|
|
101468
|
+
return ((_a2 = host.createHash) != null ? _a2 : generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
101447
101469
|
}
|
|
101448
101470
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
101449
101471
|
let oldState = oldProgram && oldProgram.getState();
|
|
@@ -101452,10 +101474,8 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101452
101474
|
oldState = void 0;
|
|
101453
101475
|
return oldProgram;
|
|
101454
101476
|
}
|
|
101455
|
-
const
|
|
101456
|
-
|
|
101457
|
-
const state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
|
101458
|
-
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, getCanonicalFileName, bundle);
|
|
101477
|
+
const state = createBuilderProgramState(newProgram, oldState, host.disableUseFileVersionAsSignature);
|
|
101478
|
+
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
|
|
101459
101479
|
newProgram = void 0;
|
|
101460
101480
|
oldProgram = void 0;
|
|
101461
101481
|
oldState = void 0;
|
|
@@ -101489,7 +101509,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101489
101509
|
}
|
|
101490
101510
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
101491
101511
|
var _a2, _b, _c, _d, _e;
|
|
101492
|
-
let affected = getNextAffectedFile(state, cancellationToken,
|
|
101512
|
+
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
101493
101513
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
101494
101514
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
101495
101515
|
if (!affected) {
|
|
@@ -101563,10 +101583,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101563
101583
|
const info = state.fileInfos.get(file.resolvedPath);
|
|
101564
101584
|
if (info.signature === file.version) {
|
|
101565
101585
|
const signature = computeSignatureWithDiagnostics(
|
|
101586
|
+
state.program,
|
|
101566
101587
|
file,
|
|
101567
101588
|
text,
|
|
101568
|
-
|
|
101569
|
-
getCanonicalFileName,
|
|
101589
|
+
host,
|
|
101570
101590
|
data
|
|
101571
101591
|
);
|
|
101572
101592
|
if (!((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length))
|
|
@@ -101610,7 +101630,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101610
101630
|
state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
101611
101631
|
function handleNewSignature(oldSignatureFormat, newSignature) {
|
|
101612
101632
|
const oldSignature = !oldSignatureFormat || isString(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0];
|
|
101613
|
-
newSignature != null ? newSignature : newSignature = computeSignature(text,
|
|
101633
|
+
newSignature != null ? newSignature : newSignature = computeSignature(text, host, data);
|
|
101614
101634
|
if (newSignature === oldSignature) {
|
|
101615
101635
|
if (oldSignatureFormat === oldSignature)
|
|
101616
101636
|
return void 0;
|
|
@@ -101666,7 +101686,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101666
101686
|
}
|
|
101667
101687
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
101668
101688
|
while (true) {
|
|
101669
|
-
const affected = getNextAffectedFile(state, cancellationToken,
|
|
101689
|
+
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
101670
101690
|
let result;
|
|
101671
101691
|
if (!affected)
|
|
101672
101692
|
return void 0;
|
|
@@ -101926,23 +101946,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
101926
101946
|
const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory());
|
|
101927
101947
|
const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost();
|
|
101928
101948
|
const resolvedModuleNames = /* @__PURE__ */ new Map();
|
|
101929
|
-
const perDirectoryResolvedModuleNames = createCacheWithRedirects();
|
|
101930
|
-
const nonRelativeModuleNameCache = createCacheWithRedirects();
|
|
101931
101949
|
const moduleResolutionCache = createModuleResolutionCache(
|
|
101932
101950
|
getCurrentDirectory(),
|
|
101933
101951
|
resolutionHost.getCanonicalFileName,
|
|
101934
|
-
|
|
101935
|
-
perDirectoryResolvedModuleNames,
|
|
101936
|
-
nonRelativeModuleNameCache
|
|
101952
|
+
resolutionHost.getCompilationSettings()
|
|
101937
101953
|
);
|
|
101938
101954
|
const resolvedTypeReferenceDirectives = /* @__PURE__ */ new Map();
|
|
101939
|
-
const perDirectoryResolvedTypeReferenceDirectives = createCacheWithRedirects();
|
|
101940
101955
|
const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
101941
101956
|
getCurrentDirectory(),
|
|
101942
101957
|
resolutionHost.getCanonicalFileName,
|
|
101943
|
-
|
|
101944
|
-
moduleResolutionCache.getPackageJsonInfoCache()
|
|
101945
|
-
perDirectoryResolvedTypeReferenceDirectives
|
|
101958
|
+
resolutionHost.getCompilationSettings(),
|
|
101959
|
+
moduleResolutionCache.getPackageJsonInfoCache()
|
|
101946
101960
|
);
|
|
101947
101961
|
const failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
|
|
101948
101962
|
const customFailedLookupPaths = /* @__PURE__ */ new Map();
|
|
@@ -102003,6 +102017,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102003
102017
|
affectingPathChecksForFile = void 0;
|
|
102004
102018
|
moduleResolutionCache.clear();
|
|
102005
102019
|
typeReferenceDirectiveResolutionCache.clear();
|
|
102020
|
+
moduleResolutionCache.update(resolutionHost.getCompilationSettings());
|
|
102021
|
+
typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings());
|
|
102006
102022
|
impliedFormatPackageJsons.clear();
|
|
102007
102023
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
102008
102024
|
}
|
|
@@ -102107,8 +102123,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102107
102123
|
names,
|
|
102108
102124
|
containingFile,
|
|
102109
102125
|
redirectedReference,
|
|
102110
|
-
|
|
102111
|
-
perDirectoryCacheWithRedirects,
|
|
102126
|
+
perFileCache,
|
|
102112
102127
|
loader,
|
|
102113
102128
|
getResolutionWithResolvedFileName,
|
|
102114
102129
|
shouldRetryResolution,
|
|
@@ -102118,16 +102133,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102118
102133
|
containingSourceFile,
|
|
102119
102134
|
containingSourceFileMode
|
|
102120
102135
|
}) {
|
|
102121
|
-
var _a2, _b, _c
|
|
102136
|
+
var _a2, _b, _c;
|
|
102122
102137
|
const path = resolutionHost.toPath(containingFile);
|
|
102123
|
-
const resolutionsInFile =
|
|
102124
|
-
const dirPath = getDirectoryPath(path);
|
|
102125
|
-
const perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
|
|
102126
|
-
let perDirectoryResolution = perDirectoryCache.get(dirPath);
|
|
102127
|
-
if (!perDirectoryResolution) {
|
|
102128
|
-
perDirectoryResolution = createModeAwareCache();
|
|
102129
|
-
perDirectoryCache.set(dirPath, perDirectoryResolution);
|
|
102130
|
-
}
|
|
102138
|
+
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
102131
102139
|
const resolvedModules = [];
|
|
102132
102140
|
const compilerOptions = resolutionHost.getCompilationSettings();
|
|
102133
102141
|
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
|
@@ -102143,28 +102151,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102143
102151
|
let resolution = resolutionsInFile.get(name, mode);
|
|
102144
102152
|
if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
|
|
102145
102153
|
const existingResolution = resolution;
|
|
102146
|
-
|
|
102147
|
-
if (
|
|
102148
|
-
|
|
102149
|
-
const host = ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost;
|
|
102150
|
-
if (isTraceEnabled(compilerOptions, host)) {
|
|
102151
|
-
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102152
|
-
trace(
|
|
102153
|
-
host,
|
|
102154
|
-
loader === resolveModuleName2 ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved,
|
|
102155
|
-
name,
|
|
102156
|
-
containingFile,
|
|
102157
|
-
getDirectoryPath(containingFile),
|
|
102158
|
-
resolved == null ? void 0 : resolved.resolvedFileName,
|
|
102159
|
-
(resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId)
|
|
102160
|
-
);
|
|
102161
|
-
}
|
|
102162
|
-
} else {
|
|
102163
|
-
resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) == null ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
102164
|
-
perDirectoryResolution.set(name, mode, resolution);
|
|
102165
|
-
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
102166
|
-
resolutionHost.onDiscoveredSymlink();
|
|
102167
|
-
}
|
|
102154
|
+
resolution = loader(name, containingFile, compilerOptions, ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
102155
|
+
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
102156
|
+
resolutionHost.onDiscoveredSymlink();
|
|
102168
102157
|
}
|
|
102169
102158
|
resolutionsInFile.set(name, mode, resolution);
|
|
102170
102159
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
@@ -102176,7 +102165,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102176
102165
|
logChanges = false;
|
|
102177
102166
|
}
|
|
102178
102167
|
} else {
|
|
102179
|
-
const host = ((
|
|
102168
|
+
const host = ((_b = resolutionHost.getCompilerHost) == null ? void 0 : _b.call(resolutionHost)) || resolutionHost;
|
|
102180
102169
|
if (isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name, mode)) {
|
|
102181
102170
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102182
102171
|
trace(
|
|
@@ -102194,7 +102183,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102194
102183
|
resolvedModules.push(getResolutionWithResolvedFileName(resolution));
|
|
102195
102184
|
}
|
|
102196
102185
|
if (resolutionInfo && (loader === resolveTypeReferenceDirective2 || containingSourceFile)) {
|
|
102197
|
-
(
|
|
102186
|
+
(_c = resolutionInfo.reusedNames) == null ? void 0 : _c.forEach((entry) => seenNamesInFile.set(
|
|
102198
102187
|
getResolutionName(entry),
|
|
102199
102188
|
!isString(entry) && isStringLiteralLike(entry) ? getModeForUsageLocation(containingSourceFile, entry) : getModeForFileReference(entry, containingSourceFileMode),
|
|
102200
102189
|
true
|
|
@@ -102233,8 +102222,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102233
102222
|
names: typeDirectiveNames,
|
|
102234
102223
|
containingFile,
|
|
102235
102224
|
redirectedReference,
|
|
102236
|
-
|
|
102237
|
-
perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives,
|
|
102225
|
+
perFileCache: resolvedTypeReferenceDirectives,
|
|
102238
102226
|
loader: resolveTypeReferenceDirective2,
|
|
102239
102227
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
|
|
102240
102228
|
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
|
|
@@ -102247,8 +102235,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102247
102235
|
names: moduleNames,
|
|
102248
102236
|
containingFile,
|
|
102249
102237
|
redirectedReference,
|
|
102250
|
-
|
|
102251
|
-
perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames,
|
|
102238
|
+
perFileCache: resolvedModuleNames,
|
|
102252
102239
|
loader: resolveModuleName2,
|
|
102253
102240
|
getResolutionWithResolvedFileName: getResolvedModule2,
|
|
102254
102241
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -103106,9 +103093,9 @@ function createWatchFactory(host, options) {
|
|
|
103106
103093
|
function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
|
|
103107
103094
|
const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
103108
103095
|
const hostGetNewLine = memoize(() => host.getNewLine());
|
|
103109
|
-
|
|
103096
|
+
const compilerHost = {
|
|
103110
103097
|
getSourceFile: createGetSourceFile(
|
|
103111
|
-
(fileName, encoding) => host.readFile(fileName, encoding),
|
|
103098
|
+
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
103112
103099
|
getCompilerOptions,
|
|
103113
103100
|
void 0
|
|
103114
103101
|
),
|
|
@@ -103135,6 +103122,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
103135
103122
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
103136
103123
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
103137
103124
|
};
|
|
103125
|
+
return compilerHost;
|
|
103138
103126
|
}
|
|
103139
103127
|
function getSourceFileVersionAsHashFromText(host, text) {
|
|
103140
103128
|
if (text.match(sourceMapCommentRegExpDontCareLineStart)) {
|
|
@@ -103168,12 +103156,12 @@ function getSourceFileVersionAsHashFromText(host, text) {
|
|
|
103168
103156
|
}
|
|
103169
103157
|
return (host.createHash || generateDjb2Hash)(text);
|
|
103170
103158
|
}
|
|
103171
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
103159
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
103172
103160
|
const originalGetSourceFile = compilerHost.getSourceFile;
|
|
103173
103161
|
compilerHost.getSourceFile = (...args) => {
|
|
103174
103162
|
const result = originalGetSourceFile.call(compilerHost, ...args);
|
|
103175
103163
|
if (result) {
|
|
103176
|
-
result.version = getSourceFileVersionAsHashFromText(
|
|
103164
|
+
result.version = getSourceFileVersionAsHashFromText(compilerHost, result.text);
|
|
103177
103165
|
}
|
|
103178
103166
|
return result;
|
|
103179
103167
|
};
|
|
@@ -103302,7 +103290,7 @@ function createIncrementalCompilerHost(options, system = sys) {
|
|
|
103302
103290
|
host.createHash = maybeBind(system, system.createHash);
|
|
103303
103291
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
103304
103292
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
103305
|
-
setGetSourceFileAsHashVersioned(host
|
|
103293
|
+
setGetSourceFileAsHashVersioned(host);
|
|
103306
103294
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
|
|
103307
103295
|
return host;
|
|
103308
103296
|
}
|
|
@@ -103364,7 +103352,7 @@ function createWatchProgram(host) {
|
|
|
103364
103352
|
configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
|
|
103365
103353
|
}
|
|
103366
103354
|
const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost);
|
|
103367
|
-
setGetSourceFileAsHashVersioned(compilerHost
|
|
103355
|
+
setGetSourceFileAsHashVersioned(compilerHost);
|
|
103368
103356
|
const getNewSourceFile = compilerHost.getSourceFile;
|
|
103369
103357
|
compilerHost.getSourceFile = (fileName, ...args) => getVersionedSourceFileByPath(fileName, toPath3(fileName), ...args);
|
|
103370
103358
|
compilerHost.getSourceFileByPath = getVersionedSourceFileByPath;
|
|
@@ -103463,9 +103451,10 @@ function createWatchProgram(host) {
|
|
|
103463
103451
|
originalFileExists,
|
|
103464
103452
|
originalDirectoryExists,
|
|
103465
103453
|
originalCreateDirectory,
|
|
103466
|
-
originalWriteFile
|
|
103454
|
+
originalWriteFile,
|
|
103455
|
+
readFileWithCache
|
|
103467
103456
|
} = changeCompilerHostLikeToUseCache(compilerHost, toPath3);
|
|
103468
|
-
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
103457
|
+
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, (path) => getSourceVersion(path, readFileWithCache), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
103469
103458
|
if (hasChangedConfigFileParsingErrors) {
|
|
103470
103459
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
103471
103460
|
reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -103584,9 +103573,14 @@ function createWatchProgram(host) {
|
|
|
103584
103573
|
}
|
|
103585
103574
|
}
|
|
103586
103575
|
}
|
|
103587
|
-
function getSourceVersion(path) {
|
|
103576
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
103588
103577
|
const hostSourceFile = sourceFilesCache.get(path);
|
|
103589
|
-
|
|
103578
|
+
if (!hostSourceFile)
|
|
103579
|
+
return void 0;
|
|
103580
|
+
if (hostSourceFile.version)
|
|
103581
|
+
return hostSourceFile.version;
|
|
103582
|
+
const text = readFileWithCache(path);
|
|
103583
|
+
return text !== void 0 ? getSourceFileVersionAsHashFromText(compilerHost, text) : void 0;
|
|
103590
103584
|
}
|
|
103591
103585
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
103592
103586
|
const hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -104025,7 +104019,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104025
104019
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
104026
104020
|
const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
104027
104021
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
104028
|
-
setGetSourceFileAsHashVersioned(compilerHost
|
|
104022
|
+
setGetSourceFileAsHashVersioned(compilerHost);
|
|
104029
104023
|
compilerHost.getParsedCommandLine = (fileName) => parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName));
|
|
104030
104024
|
compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames);
|
|
104031
104025
|
compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -105096,7 +105090,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
105096
105090
|
buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
105097
105091
|
version2 = buildInfoVersionMap.get(toPath2(state, inputFile));
|
|
105098
105092
|
const text = version2 ? state.readFileWithCache(inputFile) : void 0;
|
|
105099
|
-
currentVersion = text
|
|
105093
|
+
currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0;
|
|
105100
105094
|
if (version2 && version2 === currentVersion)
|
|
105101
105095
|
pseudoInputUpToDate = true;
|
|
105102
105096
|
}
|