@typescript-deploys/pr-build 5.0.0-pr-50996-2 → 5.0.0-pr-50996-9
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.es5.d.ts +1 -1
- package/lib/tsc.js +353 -415
- package/lib/tsserver.js +827 -835
- package/lib/tsserverlibrary.d.ts +27 -28
- package/lib/tsserverlibrary.js +840 -838
- package/lib/typescript.d.ts +25 -26
- package/lib/typescript.js +823 -822
- package/lib/typingsInstaller.js +149 -221
- 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.20221123`;
|
|
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";
|
|
@@ -3784,19 +3733,19 @@ var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
|
3784
3733
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
3785
3734
|
return ModuleResolutionKind2;
|
|
3786
3735
|
})(ModuleResolutionKind || {});
|
|
3787
|
-
var ModuleKind = /* @__PURE__ */ ((
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
return
|
|
3736
|
+
var ModuleKind = /* @__PURE__ */ ((ModuleKind2) => {
|
|
3737
|
+
ModuleKind2[ModuleKind2["None"] = 0] = "None";
|
|
3738
|
+
ModuleKind2[ModuleKind2["CommonJS"] = 1] = "CommonJS";
|
|
3739
|
+
ModuleKind2[ModuleKind2["AMD"] = 2] = "AMD";
|
|
3740
|
+
ModuleKind2[ModuleKind2["UMD"] = 3] = "UMD";
|
|
3741
|
+
ModuleKind2[ModuleKind2["System"] = 4] = "System";
|
|
3742
|
+
ModuleKind2[ModuleKind2["ES2015"] = 5] = "ES2015";
|
|
3743
|
+
ModuleKind2[ModuleKind2["ES2020"] = 6] = "ES2020";
|
|
3744
|
+
ModuleKind2[ModuleKind2["ES2022"] = 7] = "ES2022";
|
|
3745
|
+
ModuleKind2[ModuleKind2["ESNext"] = 99] = "ESNext";
|
|
3746
|
+
ModuleKind2[ModuleKind2["Node16"] = 100] = "Node16";
|
|
3747
|
+
ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext";
|
|
3748
|
+
return ModuleKind2;
|
|
3800
3749
|
})(ModuleKind || {});
|
|
3801
3750
|
var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
|
|
3802
3751
|
TransformFlags3[TransformFlags3["None"] = 0] = "None";
|
|
@@ -6776,10 +6725,10 @@ var Diagnostics = {
|
|
|
6776
6725
|
Module_name_0_matched_pattern_1: diag(6092, 3 /* Message */, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."),
|
|
6777
6726
|
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
6727
|
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
|
-
|
|
6728
|
+
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
6729
|
File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."),
|
|
6781
6730
|
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
|
-
|
|
6731
|
+
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
6732
|
Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."),
|
|
6784
6733
|
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
6734
|
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}'."),
|
|
@@ -15134,6 +15083,7 @@ var supportedJSExtensionsFlat = flatten(supportedJSExtensions);
|
|
|
15134
15083
|
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
15084
|
var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
|
|
15136
15085
|
var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
|
|
15086
|
+
var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
|
|
15137
15087
|
function getSupportedExtensions(options, extraFileExtensions) {
|
|
15138
15088
|
const needJsExtensions = options && getAllowJSCompilerOption(options);
|
|
15139
15089
|
if (!extraFileExtensions || extraFileExtensions.length === 0) {
|
|
@@ -21145,7 +21095,7 @@ var asyncDelegator = {
|
|
|
21145
21095
|
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
21146
21096
|
var i, p;
|
|
21147
21097
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
21148
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
21098
|
+
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; }
|
|
21149
21099
|
};`
|
|
21150
21100
|
};
|
|
21151
21101
|
var asyncValues = {
|
|
@@ -32746,15 +32696,18 @@ function removeIgnoredPackageId(r) {
|
|
|
32746
32696
|
return { path: r.path, ext: r.extension };
|
|
32747
32697
|
}
|
|
32748
32698
|
}
|
|
32749
|
-
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32753
|
-
|
|
32754
|
-
|
|
32755
|
-
|
|
32756
|
-
|
|
32757
|
-
|
|
32699
|
+
function formatExtensions(extensions) {
|
|
32700
|
+
const result = [];
|
|
32701
|
+
if (extensions & 1 /* TypeScript */)
|
|
32702
|
+
result.push("TypeScript");
|
|
32703
|
+
if (extensions & 2 /* JavaScript */)
|
|
32704
|
+
result.push("JavaScript");
|
|
32705
|
+
if (extensions & 4 /* Declaration */)
|
|
32706
|
+
result.push("Declaration");
|
|
32707
|
+
if (extensions & 8 /* Json */)
|
|
32708
|
+
result.push("JSON");
|
|
32709
|
+
return result.join(", ");
|
|
32710
|
+
}
|
|
32758
32711
|
function resolvedTypeScriptOnly(resolved) {
|
|
32759
32712
|
if (!resolved) {
|
|
32760
32713
|
return void 0;
|
|
@@ -32958,7 +32911,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32958
32911
|
features,
|
|
32959
32912
|
conditions,
|
|
32960
32913
|
requestContainingDirectory: containingDirectory,
|
|
32961
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
32914
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
32915
|
+
isConfigLookup: false
|
|
32962
32916
|
};
|
|
32963
32917
|
let resolved = primaryLookup();
|
|
32964
32918
|
let primary = true;
|
|
@@ -33008,7 +32962,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
33008
32962
|
}
|
|
33009
32963
|
return resolvedTypeScriptOnly(
|
|
33010
32964
|
loadNodeModuleFromDirectory(
|
|
33011
|
-
4 /*
|
|
32965
|
+
4 /* Declaration */,
|
|
33012
32966
|
candidate,
|
|
33013
32967
|
!directoryExists,
|
|
33014
32968
|
moduleResolutionState
|
|
@@ -33029,11 +32983,11 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
33029
32983
|
}
|
|
33030
32984
|
let result2;
|
|
33031
32985
|
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
33032
|
-
const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /*
|
|
32986
|
+
const searchResult = loadModuleFromNearestNodeModulesDirectory(4 /* Declaration */, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, void 0, void 0);
|
|
33033
32987
|
result2 = searchResult && searchResult.value;
|
|
33034
32988
|
} else {
|
|
33035
32989
|
const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName);
|
|
33036
|
-
result2 = nodeLoadModuleByRelativeName(4 /*
|
|
32990
|
+
result2 = nodeLoadModuleByRelativeName(4 /* Declaration */, candidate, false, moduleResolutionState, true);
|
|
33037
32991
|
}
|
|
33038
32992
|
return resolvedTypeScriptOnly(result2);
|
|
33039
32993
|
} else {
|
|
@@ -33549,38 +33503,42 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
33549
33503
|
resolutionMode
|
|
33550
33504
|
);
|
|
33551
33505
|
}
|
|
33552
|
-
var jsOnlyExtensions = [1 /* JavaScript */];
|
|
33553
|
-
var tsExtensions = [0 /* TypeScript */, 1 /* JavaScript */];
|
|
33554
|
-
var tsPlusJsonExtensions = [...tsExtensions, 2 /* Json */];
|
|
33555
|
-
var tsconfigExtensions = [3 /* TSConfig */];
|
|
33556
33506
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
33557
33507
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
33558
33508
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
33559
|
-
let extensions = compilerOptions.noDtsResolution ?
|
|
33509
|
+
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
33560
33510
|
if (compilerOptions.resolveJsonModule) {
|
|
33561
|
-
extensions
|
|
33511
|
+
extensions |= 8 /* Json */;
|
|
33562
33512
|
}
|
|
33563
|
-
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
|
|
33513
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
|
|
33564
33514
|
}
|
|
33565
33515
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
33566
|
-
return nodeModuleNameResolverWorker(
|
|
33516
|
+
return nodeModuleNameResolverWorker(
|
|
33517
|
+
0 /* None */,
|
|
33518
|
+
moduleName,
|
|
33519
|
+
initialDir,
|
|
33520
|
+
{ moduleResolution: 2 /* NodeJs */, allowJs: true },
|
|
33521
|
+
host,
|
|
33522
|
+
void 0,
|
|
33523
|
+
2 /* JavaScript */,
|
|
33524
|
+
false,
|
|
33525
|
+
void 0
|
|
33526
|
+
);
|
|
33567
33527
|
}
|
|
33568
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference,
|
|
33528
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
33569
33529
|
let extensions;
|
|
33570
|
-
if (
|
|
33571
|
-
extensions =
|
|
33530
|
+
if (isConfigLookup) {
|
|
33531
|
+
extensions = 8 /* Json */;
|
|
33572
33532
|
} else if (compilerOptions.noDtsResolution) {
|
|
33573
|
-
extensions =
|
|
33574
|
-
if (compilerOptions.allowJs)
|
|
33575
|
-
extensions.push(1 /* JavaScript */);
|
|
33533
|
+
extensions = 3 /* ImplementationFiles */;
|
|
33576
33534
|
if (compilerOptions.resolveJsonModule)
|
|
33577
|
-
extensions
|
|
33535
|
+
extensions |= 8 /* Json */;
|
|
33578
33536
|
} else {
|
|
33579
|
-
extensions = compilerOptions.resolveJsonModule ?
|
|
33537
|
+
extensions = compilerOptions.resolveJsonModule ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
33580
33538
|
}
|
|
33581
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference);
|
|
33539
|
+
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
33582
33540
|
}
|
|
33583
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) {
|
|
33541
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
33584
33542
|
var _a2, _b;
|
|
33585
33543
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
33586
33544
|
const failedLookupLocations = [];
|
|
@@ -33600,12 +33558,20 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
33600
33558
|
features,
|
|
33601
33559
|
conditions,
|
|
33602
33560
|
requestContainingDirectory: containingDirectory,
|
|
33603
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
33561
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
33562
|
+
isConfigLookup
|
|
33604
33563
|
};
|
|
33605
33564
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
33606
33565
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
33607
33566
|
}
|
|
33608
|
-
|
|
33567
|
+
let result;
|
|
33568
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* NodeJs */) {
|
|
33569
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
33570
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
33571
|
+
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
33572
|
+
} else {
|
|
33573
|
+
result = tryResolve(extensions);
|
|
33574
|
+
}
|
|
33609
33575
|
return createResolvedModuleWithFailedLookupLocations(
|
|
33610
33576
|
(_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
|
|
33611
33577
|
(_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
|
|
@@ -33630,7 +33596,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
33630
33596
|
}
|
|
33631
33597
|
if (!resolved2) {
|
|
33632
33598
|
if (traceEnabled) {
|
|
33633
|
-
trace(host, Diagnostics.
|
|
33599
|
+
trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
33634
33600
|
}
|
|
33635
33601
|
resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
|
|
33636
33602
|
}
|
|
@@ -33671,7 +33637,7 @@ function realPath(path, host, traceEnabled) {
|
|
|
33671
33637
|
}
|
|
33672
33638
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
33673
33639
|
if (state.traceEnabled) {
|
|
33674
|
-
trace(state.host, Diagnostics.
|
|
33640
|
+
trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions));
|
|
33675
33641
|
}
|
|
33676
33642
|
if (!hasTrailingDirectorySeparator(candidate)) {
|
|
33677
33643
|
if (!onlyRecordFailures) {
|
|
@@ -33729,10 +33695,9 @@ function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures
|
|
|
33729
33695
|
return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state));
|
|
33730
33696
|
}
|
|
33731
33697
|
function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
33732
|
-
|
|
33733
|
-
|
|
33734
|
-
|
|
33735
|
-
return extensionLess === void 0 && extensions === 2 /* Json */ ? void 0 : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state);
|
|
33698
|
+
const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
33699
|
+
if (resolvedByReplacingExtension) {
|
|
33700
|
+
return resolvedByReplacingExtension;
|
|
33736
33701
|
}
|
|
33737
33702
|
if (!(state.features & 32 /* EsmMode */)) {
|
|
33738
33703
|
const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state);
|
|
@@ -33740,10 +33705,9 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
33740
33705
|
return resolvedByAddingExtension;
|
|
33741
33706
|
}
|
|
33742
33707
|
}
|
|
33743
|
-
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
33744
33708
|
}
|
|
33745
33709
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
33746
|
-
if (hasJSFileExtension(candidate) || fileExtensionIs(candidate, ".json" /* Json */)
|
|
33710
|
+
if (hasJSFileExtension(candidate) || extensions & 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
|
|
33747
33711
|
const extensionless = removeFileExtension(candidate);
|
|
33748
33712
|
const extension = candidate.substring(extensionless.length);
|
|
33749
33713
|
if (state.traceEnabled) {
|
|
@@ -33753,7 +33717,7 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
|
|
|
33753
33717
|
}
|
|
33754
33718
|
}
|
|
33755
33719
|
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
33756
|
-
if (
|
|
33720
|
+
if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
|
|
33757
33721
|
const result = tryFile(candidate, onlyRecordFailures, state);
|
|
33758
33722
|
return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate) } : void 0;
|
|
33759
33723
|
}
|
|
@@ -33766,59 +33730,32 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
33766
33730
|
onlyRecordFailures = !directoryProbablyExists(directory, state.host);
|
|
33767
33731
|
}
|
|
33768
33732
|
}
|
|
33769
|
-
switch (
|
|
33770
|
-
case
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
33779
|
-
|
|
33780
|
-
|
|
33781
|
-
|
|
33782
|
-
|
|
33783
|
-
|
|
33784
|
-
return
|
|
33785
|
-
}
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
case ".mts" /* Mts */:
|
|
33792
|
-
case ".d.mts" /* Dmts */:
|
|
33793
|
-
return tryExtension(".mts" /* Mts */) || (useDts ? tryExtension(".d.mts" /* Dmts */) : void 0);
|
|
33794
|
-
case ".cjs" /* Cjs */:
|
|
33795
|
-
case ".cts" /* Cts */:
|
|
33796
|
-
case ".d.cts" /* Dcts */:
|
|
33797
|
-
return tryExtension(".cts" /* Cts */) || (useDts ? tryExtension(".d.cts" /* Dcts */) : void 0);
|
|
33798
|
-
case ".json" /* Json */:
|
|
33799
|
-
candidate += ".json" /* Json */;
|
|
33800
|
-
return useDts ? tryExtension(".d.ts" /* Dts */) : void 0;
|
|
33801
|
-
default:
|
|
33802
|
-
return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || (useDts ? tryExtension(".d.ts" /* Dts */) : void 0);
|
|
33803
|
-
}
|
|
33804
|
-
case 1 /* JavaScript */:
|
|
33805
|
-
switch (originalExtension) {
|
|
33806
|
-
case ".mjs" /* Mjs */:
|
|
33807
|
-
case ".mts" /* Mts */:
|
|
33808
|
-
case ".d.mts" /* Dmts */:
|
|
33809
|
-
return tryExtension(".mjs" /* Mjs */);
|
|
33810
|
-
case ".cjs" /* Cjs */:
|
|
33811
|
-
case ".cts" /* Cts */:
|
|
33812
|
-
case ".d.cts" /* Dcts */:
|
|
33813
|
-
return tryExtension(".cjs" /* Cjs */);
|
|
33814
|
-
case ".json" /* Json */:
|
|
33815
|
-
return tryExtension(".json" /* Json */);
|
|
33816
|
-
default:
|
|
33817
|
-
return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */);
|
|
33733
|
+
switch (originalExtension) {
|
|
33734
|
+
case ".mjs" /* Mjs */:
|
|
33735
|
+
case ".mts" /* Mts */:
|
|
33736
|
+
case ".d.mts" /* Dmts */:
|
|
33737
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".mts" /* Mts */) || extensions & 4 /* Declaration */ && tryExtension(".d.mts" /* Dmts */) || extensions & 2 /* JavaScript */ && tryExtension(".mjs" /* Mjs */) || void 0;
|
|
33738
|
+
case ".cjs" /* Cjs */:
|
|
33739
|
+
case ".cts" /* Cts */:
|
|
33740
|
+
case ".d.cts" /* Dcts */:
|
|
33741
|
+
return extensions & 1 /* TypeScript */ && tryExtension(".cts" /* Cts */) || extensions & 4 /* Declaration */ && tryExtension(".d.cts" /* Dcts */) || extensions & 2 /* JavaScript */ && tryExtension(".cjs" /* Cjs */) || void 0;
|
|
33742
|
+
case ".json" /* Json */:
|
|
33743
|
+
const originalCandidate = candidate;
|
|
33744
|
+
if (extensions & 4 /* Declaration */) {
|
|
33745
|
+
candidate += ".json" /* Json */;
|
|
33746
|
+
const result = tryExtension(".d.ts" /* Dts */);
|
|
33747
|
+
if (result)
|
|
33748
|
+
return result;
|
|
33749
|
+
}
|
|
33750
|
+
if (extensions & 8 /* Json */) {
|
|
33751
|
+
candidate = originalCandidate;
|
|
33752
|
+
const result = tryExtension(".json" /* Json */);
|
|
33753
|
+
if (result)
|
|
33754
|
+
return result;
|
|
33818
33755
|
}
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
return tryExtension(".json" /* Json */);
|
|
33756
|
+
return void 0;
|
|
33757
|
+
default:
|
|
33758
|
+
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;
|
|
33822
33759
|
}
|
|
33823
33760
|
function tryExtension(ext) {
|
|
33824
33761
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
@@ -33867,7 +33804,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
|
|
|
33867
33804
|
features: 0 /* None */,
|
|
33868
33805
|
conditions: emptyArray,
|
|
33869
33806
|
requestContainingDirectory: void 0,
|
|
33870
|
-
reportDiagnostic: noop
|
|
33807
|
+
reportDiagnostic: noop,
|
|
33808
|
+
isConfigLookup: false
|
|
33871
33809
|
};
|
|
33872
33810
|
}
|
|
33873
33811
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -33926,23 +33864,10 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
33926
33864
|
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
|
|
33927
33865
|
let packageFile;
|
|
33928
33866
|
if (jsonContent) {
|
|
33929
|
-
|
|
33930
|
-
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
packageFile = readPackageJsonMainField(jsonContent, candidate, state);
|
|
33934
|
-
break;
|
|
33935
|
-
case 0 /* TypeScript */:
|
|
33936
|
-
packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state);
|
|
33937
|
-
break;
|
|
33938
|
-
case 4 /* DtsOnly */:
|
|
33939
|
-
packageFile = readPackageJsonTypesFields(jsonContent, candidate, state);
|
|
33940
|
-
break;
|
|
33941
|
-
case 3 /* TSConfig */:
|
|
33942
|
-
packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
|
|
33943
|
-
break;
|
|
33944
|
-
default:
|
|
33945
|
-
return Debug.assertNever(extensions);
|
|
33867
|
+
if (state.isConfigLookup) {
|
|
33868
|
+
packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
|
|
33869
|
+
} else {
|
|
33870
|
+
packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
|
|
33946
33871
|
}
|
|
33947
33872
|
}
|
|
33948
33873
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
@@ -33956,18 +33881,18 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
33956
33881
|
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
|
|
33957
33882
|
}
|
|
33958
33883
|
}
|
|
33959
|
-
const
|
|
33884
|
+
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
33960
33885
|
const features = state2.features;
|
|
33961
33886
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
33962
33887
|
state2.features &= ~32 /* EsmMode */;
|
|
33963
33888
|
}
|
|
33964
|
-
const result = nodeLoadModuleByRelativeName(
|
|
33889
|
+
const result = nodeLoadModuleByRelativeName(expandedExtensions, candidate2, onlyRecordFailures2, state2, false);
|
|
33965
33890
|
state2.features = features;
|
|
33966
33891
|
return result;
|
|
33967
33892
|
};
|
|
33968
33893
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
33969
33894
|
const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host);
|
|
33970
|
-
const indexPath = combinePaths(candidate,
|
|
33895
|
+
const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index");
|
|
33971
33896
|
if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) {
|
|
33972
33897
|
const moduleName = getRelativePathFromDirectory(candidate, packageFile || indexPath, false);
|
|
33973
33898
|
if (state.traceEnabled) {
|
|
@@ -33990,19 +33915,7 @@ function resolvedIfExtensionMatches(extensions, path) {
|
|
|
33990
33915
|
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext } : void 0;
|
|
33991
33916
|
}
|
|
33992
33917
|
function extensionIsOk(extensions, extension) {
|
|
33993
|
-
|
|
33994
|
-
case 1 /* JavaScript */:
|
|
33995
|
-
return extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */;
|
|
33996
|
-
case 3 /* TSConfig */:
|
|
33997
|
-
case 2 /* Json */:
|
|
33998
|
-
return extension === ".json" /* Json */;
|
|
33999
|
-
case 0 /* TypeScript */:
|
|
34000
|
-
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 */;
|
|
34001
|
-
case 5 /* TsOnly */:
|
|
34002
|
-
return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */;
|
|
34003
|
-
case 4 /* DtsOnly */:
|
|
34004
|
-
return extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */;
|
|
34005
|
-
}
|
|
33918
|
+
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;
|
|
34006
33919
|
}
|
|
34007
33920
|
function parsePackageName(moduleName) {
|
|
34008
33921
|
let idx = moduleName.indexOf(directorySeparator);
|
|
@@ -34164,7 +34077,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34164
34077
|
const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
|
|
34165
34078
|
traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
|
|
34166
34079
|
traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
|
|
34167
|
-
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache,
|
|
34080
|
+
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, false, redirectedReference);
|
|
34168
34081
|
return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : void 0);
|
|
34169
34082
|
}
|
|
34170
34083
|
if (state.traceEnabled) {
|
|
@@ -34255,7 +34168,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34255
34168
|
}
|
|
34256
34169
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
34257
34170
|
var _a2, _b, _c, _d;
|
|
34258
|
-
if (
|
|
34171
|
+
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)) {
|
|
34259
34172
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
|
34260
34173
|
const commonSourceDirGuesses = [];
|
|
34261
34174
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -34292,10 +34205,9 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
34292
34205
|
if (fileExtensionIs(possibleInputBase, ext)) {
|
|
34293
34206
|
const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase);
|
|
34294
34207
|
for (const possibleExt of inputExts) {
|
|
34295
|
-
|
|
34296
|
-
if (extensions === 0 /* TypeScript */ && hasJSFileExtension(possibleInputWithInputExtension) || extensions === 1 /* JavaScript */ && hasTSFileExtension(possibleInputWithInputExtension)) {
|
|
34208
|
+
if (!extensionIsOk(extensions, possibleExt))
|
|
34297
34209
|
continue;
|
|
34298
|
-
|
|
34210
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
34299
34211
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
34300
34212
|
return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state)));
|
|
34301
34213
|
}
|
|
@@ -34336,19 +34248,31 @@ function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, direc
|
|
|
34336
34248
|
return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference);
|
|
34337
34249
|
}
|
|
34338
34250
|
function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directory, state) {
|
|
34339
|
-
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /*
|
|
34251
|
+
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
34340
34252
|
}
|
|
34341
34253
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34342
34254
|
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */, redirectedReference);
|
|
34343
|
-
|
|
34344
|
-
|
|
34345
|
-
|
|
34346
|
-
|
|
34347
|
-
|
|
34255
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
34256
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
34257
|
+
if (priorityExtensions) {
|
|
34258
|
+
const result = lookup(priorityExtensions);
|
|
34259
|
+
if (result)
|
|
34260
|
+
return result;
|
|
34261
|
+
}
|
|
34262
|
+
if (secondaryExtensions && !typesScopeOnly) {
|
|
34263
|
+
return lookup(secondaryExtensions);
|
|
34264
|
+
}
|
|
34265
|
+
function lookup(extensions2) {
|
|
34266
|
+
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
34267
|
+
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
34268
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state);
|
|
34269
|
+
if (resolutionFromCache) {
|
|
34270
|
+
return resolutionFromCache;
|
|
34271
|
+
}
|
|
34272
|
+
return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
|
|
34348
34273
|
}
|
|
34349
|
-
|
|
34350
|
-
|
|
34351
|
-
});
|
|
34274
|
+
});
|
|
34275
|
+
}
|
|
34352
34276
|
}
|
|
34353
34277
|
function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34354
34278
|
const nodeModulesFolder = combinePaths(directory, "node_modules");
|
|
@@ -34356,11 +34280,13 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
|
|
|
34356
34280
|
if (!nodeModulesFolderExists && state.traceEnabled) {
|
|
34357
34281
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder);
|
|
34358
34282
|
}
|
|
34359
|
-
|
|
34360
|
-
|
|
34361
|
-
|
|
34283
|
+
if (!typesScopeOnly) {
|
|
34284
|
+
const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference);
|
|
34285
|
+
if (packageResult) {
|
|
34286
|
+
return packageResult;
|
|
34287
|
+
}
|
|
34362
34288
|
}
|
|
34363
|
-
if (extensions
|
|
34289
|
+
if (extensions & 4 /* Declaration */) {
|
|
34364
34290
|
const nodeModulesAtTypes2 = combinePaths(nodeModulesFolder, "@types");
|
|
34365
34291
|
let nodeModulesAtTypesExists = nodeModulesFolderExists;
|
|
34366
34292
|
if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes2, state.host)) {
|
|
@@ -34369,7 +34295,7 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, dir
|
|
|
34369
34295
|
}
|
|
34370
34296
|
nodeModulesAtTypesExists = false;
|
|
34371
34297
|
}
|
|
34372
|
-
return loadModuleFromSpecificNodeModulesDirectory(4 /*
|
|
34298
|
+
return loadModuleFromSpecificNodeModulesDirectory(4 /* Declaration */, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference);
|
|
34373
34299
|
}
|
|
34374
34300
|
}
|
|
34375
34301
|
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
@@ -34510,9 +34436,10 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34510
34436
|
features: 0 /* None */,
|
|
34511
34437
|
conditions: [],
|
|
34512
34438
|
requestContainingDirectory: containingDirectory,
|
|
34513
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
34439
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
34440
|
+
isConfigLookup: false
|
|
34514
34441
|
};
|
|
34515
|
-
const resolved = tryResolve(
|
|
34442
|
+
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
34516
34443
|
return createResolvedModuleWithFailedLookupLocations(
|
|
34517
34444
|
resolved && resolved.value,
|
|
34518
34445
|
false,
|
|
@@ -34539,7 +34466,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34539
34466
|
if (resolved2) {
|
|
34540
34467
|
return resolved2;
|
|
34541
34468
|
}
|
|
34542
|
-
if (extensions
|
|
34469
|
+
if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
|
|
34543
34470
|
return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
|
|
34544
34471
|
}
|
|
34545
34472
|
} else {
|
|
@@ -34566,9 +34493,10 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
34566
34493
|
features: 0 /* None */,
|
|
34567
34494
|
conditions: [],
|
|
34568
34495
|
requestContainingDirectory: void 0,
|
|
34569
|
-
reportDiagnostic: (diag2) => void diagnostics.push(diag2)
|
|
34496
|
+
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
34497
|
+
isConfigLookup: false
|
|
34570
34498
|
};
|
|
34571
|
-
const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /*
|
|
34499
|
+
const resolved = loadModuleFromImmediateNodeModulesDirectory(4 /* Declaration */, moduleName, globalCache, state, false, void 0, void 0);
|
|
34572
34500
|
return createResolvedModuleWithFailedLookupLocations(
|
|
34573
34501
|
resolved,
|
|
34574
34502
|
true,
|
|
@@ -37518,6 +37446,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
37518
37446
|
const importedFileIsInNodeModules = some(modulePaths, (p) => p.isInNodeModules);
|
|
37519
37447
|
let nodeModulesSpecifiers;
|
|
37520
37448
|
let pathsSpecifiers;
|
|
37449
|
+
let redirectPathsSpecifiers;
|
|
37521
37450
|
let relativeSpecifiers;
|
|
37522
37451
|
for (const modulePath of modulePaths) {
|
|
37523
37452
|
const specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, void 0, options.overrideImportMode);
|
|
@@ -37525,60 +37454,77 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
37525
37454
|
if (specifier && modulePath.isRedirect) {
|
|
37526
37455
|
return nodeModulesSpecifiers;
|
|
37527
37456
|
}
|
|
37528
|
-
if (!specifier
|
|
37529
|
-
const local = getLocalModuleSpecifier(
|
|
37530
|
-
|
|
37457
|
+
if (!specifier) {
|
|
37458
|
+
const local = getLocalModuleSpecifier(
|
|
37459
|
+
modulePath.path,
|
|
37460
|
+
info,
|
|
37461
|
+
compilerOptions,
|
|
37462
|
+
host,
|
|
37463
|
+
options.overrideImportMode || importingSourceFile.impliedNodeFormat,
|
|
37464
|
+
preferences,
|
|
37465
|
+
modulePath.isRedirect
|
|
37466
|
+
);
|
|
37467
|
+
if (!local) {
|
|
37468
|
+
continue;
|
|
37469
|
+
}
|
|
37470
|
+
if (modulePath.isRedirect) {
|
|
37471
|
+
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
37472
|
+
} else if (pathIsBareSpecifier(local)) {
|
|
37531
37473
|
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
37532
37474
|
} else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
37533
37475
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
37534
37476
|
}
|
|
37535
37477
|
}
|
|
37536
37478
|
}
|
|
37537
|
-
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
|
|
37479
|
+
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);
|
|
37538
37480
|
}
|
|
37539
37481
|
function getInfo(importingSourceFileName, host) {
|
|
37540
37482
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
|
|
37541
37483
|
const sourceDirectory = getDirectoryPath(importingSourceFileName);
|
|
37542
37484
|
return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
|
|
37543
37485
|
}
|
|
37544
|
-
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }) {
|
|
37486
|
+
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { ending, relativePreference }, pathsOnly) {
|
|
37545
37487
|
const { baseUrl, paths, rootDirs } = compilerOptions;
|
|
37488
|
+
if (pathsOnly && !paths) {
|
|
37489
|
+
return void 0;
|
|
37490
|
+
}
|
|
37546
37491
|
const { sourceDirectory, getCanonicalFileName } = info;
|
|
37547
37492
|
const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions);
|
|
37548
37493
|
if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
|
|
37549
|
-
return relativePath;
|
|
37494
|
+
return pathsOnly ? void 0 : relativePath;
|
|
37550
37495
|
}
|
|
37551
37496
|
const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
|
|
37552
37497
|
const relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName);
|
|
37553
37498
|
if (!relativeToBaseUrl) {
|
|
37554
|
-
return relativePath;
|
|
37499
|
+
return pathsOnly ? void 0 : relativePath;
|
|
37555
37500
|
}
|
|
37556
37501
|
const fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
|
|
37557
|
-
|
|
37558
|
-
|
|
37502
|
+
if (pathsOnly) {
|
|
37503
|
+
return fromPaths;
|
|
37504
|
+
}
|
|
37505
|
+
const maybeNonRelative = fromPaths === void 0 && baseUrl !== void 0 ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
|
|
37506
|
+
if (!maybeNonRelative) {
|
|
37559
37507
|
return relativePath;
|
|
37560
37508
|
}
|
|
37561
|
-
if (relativePreference === 1 /* NonRelative */) {
|
|
37562
|
-
return
|
|
37509
|
+
if (relativePreference === 1 /* NonRelative */ && !pathIsRelative(maybeNonRelative)) {
|
|
37510
|
+
return maybeNonRelative;
|
|
37563
37511
|
}
|
|
37564
|
-
if (relativePreference === 3 /* ExternalNonRelative */) {
|
|
37512
|
+
if (relativePreference === 3 /* ExternalNonRelative */ && !pathIsRelative(maybeNonRelative)) {
|
|
37565
37513
|
const projectDirectory = compilerOptions.configFilePath ? toPath(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) : info.getCanonicalFileName(host.getCurrentDirectory());
|
|
37566
37514
|
const modulePath = toPath(moduleFileName, projectDirectory, getCanonicalFileName);
|
|
37567
37515
|
const sourceIsInternal = startsWith(sourceDirectory, projectDirectory);
|
|
37568
37516
|
const targetIsInternal = startsWith(modulePath, projectDirectory);
|
|
37569
37517
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
37570
|
-
return
|
|
37518
|
+
return maybeNonRelative;
|
|
37571
37519
|
}
|
|
37572
37520
|
const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath));
|
|
37573
37521
|
const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory);
|
|
37574
37522
|
if (nearestSourcePackageJson !== nearestTargetPackageJson) {
|
|
37575
|
-
return
|
|
37523
|
+
return maybeNonRelative;
|
|
37576
37524
|
}
|
|
37577
37525
|
return relativePath;
|
|
37578
37526
|
}
|
|
37579
|
-
|
|
37580
|
-
Debug.assertNever(relativePreference);
|
|
37581
|
-
return isPathRelativeToParent(nonRelative) || countPathComponents(relativePath) < countPathComponents(nonRelative) ? relativePath : nonRelative;
|
|
37527
|
+
return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath) < countPathComponents(maybeNonRelative) ? relativePath : maybeNonRelative;
|
|
37582
37528
|
}
|
|
37583
37529
|
function countPathComponents(path) {
|
|
37584
37530
|
let count = 0;
|
|
@@ -38139,6 +38085,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
38139
38085
|
return CheckMode3;
|
|
38140
38086
|
})(CheckMode || {});
|
|
38141
38087
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
38088
|
+
SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None";
|
|
38142
38089
|
SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback";
|
|
38143
38090
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
38144
38091
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
@@ -38156,7 +38103,7 @@ var intrinsicTypeKinds = new Map(getEntries({
|
|
|
38156
38103
|
function SymbolLinks() {
|
|
38157
38104
|
}
|
|
38158
38105
|
function NodeLinks() {
|
|
38159
|
-
this.flags = 0
|
|
38106
|
+
this.flags = 0 /* None */;
|
|
38160
38107
|
}
|
|
38161
38108
|
function getNodeId(node) {
|
|
38162
38109
|
if (!node.id) {
|
|
@@ -39001,7 +38948,7 @@ function createTypeChecker(host) {
|
|
|
39001
38948
|
function createSymbol(flags, name, checkFlags) {
|
|
39002
38949
|
symbolCount++;
|
|
39003
38950
|
const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
|
|
39004
|
-
symbol.checkFlags = checkFlags || 0
|
|
38951
|
+
symbol.checkFlags = checkFlags || 0 /* None */;
|
|
39005
38952
|
return symbol;
|
|
39006
38953
|
}
|
|
39007
38954
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -41312,7 +41259,7 @@ function createTypeChecker(host) {
|
|
|
41312
41259
|
function createOriginType(flags) {
|
|
41313
41260
|
return new Type7(checker, flags);
|
|
41314
41261
|
}
|
|
41315
|
-
function createIntrinsicType(kind, intrinsicName, objectFlags = 0) {
|
|
41262
|
+
function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
|
|
41316
41263
|
const type = createType(kind);
|
|
41317
41264
|
type.intrinsicName = intrinsicName;
|
|
41318
41265
|
type.objectFlags = objectFlags;
|
|
@@ -41807,25 +41754,22 @@ function createTypeChecker(host) {
|
|
|
41807
41754
|
const context = {
|
|
41808
41755
|
enclosingDeclaration,
|
|
41809
41756
|
flags: flags || 0 /* None */,
|
|
41810
|
-
tracker: tracker && tracker.trackSymbol ? tracker : {
|
|
41811
|
-
|
|
41812
|
-
|
|
41813
|
-
|
|
41814
|
-
|
|
41815
|
-
|
|
41816
|
-
getPackageJsonInfoCache: ()
|
|
41817
|
-
|
|
41818
|
-
|
|
41819
|
-
|
|
41820
|
-
|
|
41821
|
-
|
|
41822
|
-
|
|
41823
|
-
|
|
41824
|
-
|
|
41825
|
-
|
|
41826
|
-
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
41827
|
-
} : void 0
|
|
41828
|
-
},
|
|
41757
|
+
tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: () => false, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? {
|
|
41758
|
+
getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "",
|
|
41759
|
+
getCurrentDirectory: () => host.getCurrentDirectory(),
|
|
41760
|
+
getSymlinkCache: maybeBind(host, host.getSymlinkCache),
|
|
41761
|
+
getPackageJsonInfoCache: () => {
|
|
41762
|
+
var _a3;
|
|
41763
|
+
return (_a3 = host.getPackageJsonInfoCache) == null ? void 0 : _a3.call(host);
|
|
41764
|
+
},
|
|
41765
|
+
useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames),
|
|
41766
|
+
redirectTargetsMap: host.redirectTargetsMap,
|
|
41767
|
+
getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName),
|
|
41768
|
+
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
|
41769
|
+
fileExists: (fileName) => host.fileExists(fileName),
|
|
41770
|
+
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
|
41771
|
+
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
41772
|
+
} : void 0 },
|
|
41829
41773
|
encounteredError: false,
|
|
41830
41774
|
reportedDiagnostic: false,
|
|
41831
41775
|
visitedTypes: void 0,
|
|
@@ -48155,7 +48099,7 @@ function createTypeChecker(host) {
|
|
|
48155
48099
|
function containsArgumentsReference(declaration) {
|
|
48156
48100
|
const links = getNodeLinks(declaration);
|
|
48157
48101
|
if (links.containsArgumentsReference === void 0) {
|
|
48158
|
-
if (links.flags &
|
|
48102
|
+
if (links.flags & 512 /* CaptureArguments */) {
|
|
48159
48103
|
links.containsArgumentsReference = true;
|
|
48160
48104
|
} else {
|
|
48161
48105
|
links.containsArgumentsReference = traverse(declaration.body);
|
|
@@ -52055,7 +51999,7 @@ function createTypeChecker(host) {
|
|
|
52055
51999
|
return compareSignaturesRelated(
|
|
52056
52000
|
source,
|
|
52057
52001
|
target,
|
|
52058
|
-
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0
|
|
52002
|
+
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */,
|
|
52059
52003
|
false,
|
|
52060
52004
|
void 0,
|
|
52061
52005
|
void 0,
|
|
@@ -52289,7 +52233,9 @@ function createTypeChecker(host) {
|
|
|
52289
52233
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
52290
52234
|
if (s & 1 /* Any */)
|
|
52291
52235
|
return true;
|
|
52292
|
-
if (s &
|
|
52236
|
+
if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
|
|
52237
|
+
return true;
|
|
52238
|
+
if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value))
|
|
52293
52239
|
return true;
|
|
52294
52240
|
if (isUnknownLikeUnionType(target))
|
|
52295
52241
|
return true;
|
|
@@ -55335,7 +55281,7 @@ function createTypeChecker(host) {
|
|
|
55335
55281
|
pos = p;
|
|
55336
55282
|
}
|
|
55337
55283
|
}
|
|
55338
|
-
function inferTypes(inferences, originalSource, originalTarget, priority = 0
|
|
55284
|
+
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
55339
55285
|
let bivariant = false;
|
|
55340
55286
|
let propagationType;
|
|
55341
55287
|
let inferencePriority = 2048 /* MaxValue */;
|
|
@@ -57777,8 +57723,8 @@ function createTypeChecker(host) {
|
|
|
57777
57723
|
}
|
|
57778
57724
|
const parent = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
57779
57725
|
const links = getNodeLinks(parent);
|
|
57780
|
-
if (!(links.flags &
|
|
57781
|
-
links.flags |=
|
|
57726
|
+
if (!(links.flags & 524288 /* AssignmentsMarked */)) {
|
|
57727
|
+
links.flags |= 524288 /* AssignmentsMarked */;
|
|
57782
57728
|
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
57783
57729
|
markNodeAssignments(parent);
|
|
57784
57730
|
}
|
|
@@ -57786,7 +57732,7 @@ function createTypeChecker(host) {
|
|
|
57786
57732
|
return symbol.isAssigned || false;
|
|
57787
57733
|
}
|
|
57788
57734
|
function hasParentWithAssignmentsMarked(node) {
|
|
57789
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
57735
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
|
|
57790
57736
|
}
|
|
57791
57737
|
function markNodeAssignments(node) {
|
|
57792
57738
|
if (node.kind === 79 /* Identifier */) {
|
|
@@ -57865,11 +57811,11 @@ function createTypeChecker(host) {
|
|
|
57865
57811
|
const parent = declaration.parent.parent;
|
|
57866
57812
|
if (parent.kind === 257 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 166 /* Parameter */) {
|
|
57867
57813
|
const links = getNodeLinks(parent);
|
|
57868
|
-
if (!(links.flags &
|
|
57869
|
-
links.flags |=
|
|
57814
|
+
if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
|
|
57815
|
+
links.flags |= 16777216 /* InCheckIdentifier */;
|
|
57870
57816
|
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
57871
57817
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
57872
|
-
links.flags &= ~
|
|
57818
|
+
links.flags &= ~16777216 /* InCheckIdentifier */;
|
|
57873
57819
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 166 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
57874
57820
|
const pattern = declaration.parent;
|
|
57875
57821
|
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
|
|
@@ -57919,7 +57865,7 @@ function createTypeChecker(host) {
|
|
|
57919
57865
|
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);
|
|
57920
57866
|
}
|
|
57921
57867
|
}
|
|
57922
|
-
getNodeLinks(container).flags |=
|
|
57868
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
57923
57869
|
return getTypeOfSymbol(symbol);
|
|
57924
57870
|
}
|
|
57925
57871
|
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
@@ -57936,8 +57882,8 @@ function createTypeChecker(host) {
|
|
|
57936
57882
|
let container = getContainingClass(node);
|
|
57937
57883
|
while (container !== void 0) {
|
|
57938
57884
|
if (container === declaration && container.name !== node) {
|
|
57939
|
-
getNodeLinks(declaration).flags |=
|
|
57940
|
-
getNodeLinks(node).flags |=
|
|
57885
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57886
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57941
57887
|
break;
|
|
57942
57888
|
}
|
|
57943
57889
|
container = getContainingClass(container);
|
|
@@ -57947,8 +57893,8 @@ function createTypeChecker(host) {
|
|
|
57947
57893
|
while (container.kind !== 308 /* SourceFile */) {
|
|
57948
57894
|
if (container.parent === declaration) {
|
|
57949
57895
|
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
57950
|
-
getNodeLinks(declaration).flags |=
|
|
57951
|
-
getNodeLinks(node).flags |=
|
|
57896
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57897
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57952
57898
|
}
|
|
57953
57899
|
break;
|
|
57954
57900
|
}
|
|
@@ -58062,7 +58008,7 @@ function createTypeChecker(host) {
|
|
|
58062
58008
|
const part = getPartOfForStatementContainingNode(node.parent, container);
|
|
58063
58009
|
if (part) {
|
|
58064
58010
|
const links = getNodeLinks(part);
|
|
58065
|
-
links.flags |=
|
|
58011
|
+
links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */;
|
|
58066
58012
|
const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);
|
|
58067
58013
|
pushIfUnique(capturedBindings, symbol);
|
|
58068
58014
|
if (part === container.initializer) {
|
|
@@ -58072,19 +58018,19 @@ function createTypeChecker(host) {
|
|
|
58072
58018
|
}
|
|
58073
58019
|
}
|
|
58074
58020
|
if (capturesBlockScopeBindingInLoopBody) {
|
|
58075
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
58021
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
58076
58022
|
}
|
|
58077
58023
|
}
|
|
58078
58024
|
if (isForStatement(container)) {
|
|
58079
58025
|
const varDeclList = getAncestor(symbol.valueDeclaration, 258 /* VariableDeclarationList */);
|
|
58080
58026
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
58081
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58027
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
|
|
58082
58028
|
}
|
|
58083
58029
|
}
|
|
58084
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58030
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
58085
58031
|
}
|
|
58086
58032
|
if (isCaptured) {
|
|
58087
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58033
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */;
|
|
58088
58034
|
}
|
|
58089
58035
|
}
|
|
58090
58036
|
function isBindingCapturedByNode(node, decl) {
|
|
@@ -58301,23 +58247,23 @@ function createTypeChecker(host) {
|
|
|
58301
58247
|
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
|
|
58302
58248
|
}
|
|
58303
58249
|
if (isStatic(container) || isCallExpression2) {
|
|
58304
|
-
nodeCheckFlag =
|
|
58250
|
+
nodeCheckFlag = 32 /* SuperStatic */;
|
|
58305
58251
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
58306
58252
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
58307
58253
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
58308
|
-
getNodeLinks(current).flags |=
|
|
58254
|
+
getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
|
|
58309
58255
|
}
|
|
58310
58256
|
});
|
|
58311
58257
|
}
|
|
58312
58258
|
} else {
|
|
58313
|
-
nodeCheckFlag =
|
|
58259
|
+
nodeCheckFlag = 16 /* SuperInstance */;
|
|
58314
58260
|
}
|
|
58315
58261
|
getNodeLinks(node).flags |= nodeCheckFlag;
|
|
58316
58262
|
if (container.kind === 171 /* MethodDeclaration */ && inAsyncFunction) {
|
|
58317
58263
|
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
|
|
58318
|
-
getNodeLinks(container).flags |=
|
|
58264
|
+
getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */;
|
|
58319
58265
|
} else {
|
|
58320
|
-
getNodeLinks(container).flags |=
|
|
58266
|
+
getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */;
|
|
58321
58267
|
}
|
|
58322
58268
|
}
|
|
58323
58269
|
if (needToCaptureLexicalThis) {
|
|
@@ -58345,7 +58291,7 @@ function createTypeChecker(host) {
|
|
|
58345
58291
|
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
|
|
58346
58292
|
return errorType;
|
|
58347
58293
|
}
|
|
58348
|
-
return nodeCheckFlag ===
|
|
58294
|
+
return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
|
|
58349
58295
|
function isLegalUsageOfSuperExpression(container2) {
|
|
58350
58296
|
if (!container2) {
|
|
58351
58297
|
return false;
|
|
@@ -59360,9 +59306,9 @@ function createTypeChecker(host) {
|
|
|
59360
59306
|
const container = getEnclosingBlockScopeContainer(node.parent.parent);
|
|
59361
59307
|
const enclosingIterationStatement = getEnclosingIterationStatement(container);
|
|
59362
59308
|
if (enclosingIterationStatement) {
|
|
59363
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
59364
|
-
getNodeLinks(node).flags |=
|
|
59365
|
-
getNodeLinks(node.parent.parent).flags |=
|
|
59309
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
59310
|
+
getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59311
|
+
getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59366
59312
|
}
|
|
59367
59313
|
}
|
|
59368
59314
|
if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
|
|
@@ -63349,10 +63295,10 @@ function createTypeChecker(host) {
|
|
|
63349
63295
|
}
|
|
63350
63296
|
function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
|
|
63351
63297
|
const links = getNodeLinks(node);
|
|
63352
|
-
if (!(links.flags &
|
|
63298
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63353
63299
|
const contextualSignature = getContextualSignature(node);
|
|
63354
|
-
if (!(links.flags &
|
|
63355
|
-
links.flags |=
|
|
63300
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63301
|
+
links.flags |= 64 /* ContextChecked */;
|
|
63356
63302
|
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));
|
|
63357
63303
|
if (!signature) {
|
|
63358
63304
|
return;
|
|
@@ -65342,13 +65288,13 @@ function createTypeChecker(host) {
|
|
|
65342
65288
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
65343
65289
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
65344
65290
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
65345
|
-
getNodeLinks(lexicalScope).flags |=
|
|
65291
|
+
getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
|
|
65346
65292
|
}
|
|
65347
65293
|
if (isClassExpression(node.parent)) {
|
|
65348
65294
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
65349
65295
|
if (enclosingIterationStatement) {
|
|
65350
|
-
getNodeLinks(node.name).flags |=
|
|
65351
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
65296
|
+
getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
65297
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
65352
65298
|
}
|
|
65353
65299
|
}
|
|
65354
65300
|
}
|
|
@@ -66943,7 +66889,7 @@ function createTypeChecker(host) {
|
|
|
66943
66889
|
}
|
|
66944
66890
|
function checkWeakMapSetCollision(node) {
|
|
66945
66891
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
66946
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
66892
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
|
|
66947
66893
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
66948
66894
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
66949
66895
|
}
|
|
@@ -66957,18 +66903,18 @@ function createTypeChecker(host) {
|
|
|
66957
66903
|
let hasCollision = false;
|
|
66958
66904
|
if (isClassExpression(node)) {
|
|
66959
66905
|
for (const member of node.members) {
|
|
66960
|
-
if (getNodeCheckFlags(member) &
|
|
66906
|
+
if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66961
66907
|
hasCollision = true;
|
|
66962
66908
|
break;
|
|
66963
66909
|
}
|
|
66964
66910
|
}
|
|
66965
66911
|
} else if (isFunctionExpression(node)) {
|
|
66966
|
-
if (getNodeCheckFlags(node) &
|
|
66912
|
+
if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66967
66913
|
hasCollision = true;
|
|
66968
66914
|
}
|
|
66969
66915
|
} else {
|
|
66970
66916
|
const container = getEnclosingBlockScopeContainer(node);
|
|
66971
|
-
if (container && getNodeCheckFlags(container) &
|
|
66917
|
+
if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66972
66918
|
hasCollision = true;
|
|
66973
66919
|
}
|
|
66974
66920
|
}
|
|
@@ -68183,8 +68129,9 @@ function createTypeChecker(host) {
|
|
|
68183
68129
|
});
|
|
68184
68130
|
const containsArguments = containsArgumentsReference(node);
|
|
68185
68131
|
if (containsArguments) {
|
|
68186
|
-
const
|
|
68187
|
-
|
|
68132
|
+
const lastJSDocParamIndex = jsdocParameters.length - 1;
|
|
68133
|
+
const lastJSDocParam = jsdocParameters[lastJSDocParamIndex];
|
|
68134
|
+
if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !excludedParameters.has(lastJSDocParamIndex) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
68188
68135
|
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));
|
|
68189
68136
|
}
|
|
68190
68137
|
} else {
|
|
@@ -68852,8 +68799,8 @@ function createTypeChecker(host) {
|
|
|
68852
68799
|
}
|
|
68853
68800
|
function computeEnumMemberValues(node) {
|
|
68854
68801
|
const nodeLinks2 = getNodeLinks(node);
|
|
68855
|
-
if (!(nodeLinks2.flags &
|
|
68856
|
-
nodeLinks2.flags |=
|
|
68802
|
+
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
68803
|
+
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
68857
68804
|
let autoValue = 0;
|
|
68858
68805
|
for (const member of node.members) {
|
|
68859
68806
|
const value = computeMemberValue(member, autoValue);
|
|
@@ -69129,7 +69076,7 @@ function createTypeChecker(host) {
|
|
|
69129
69076
|
}
|
|
69130
69077
|
const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */);
|
|
69131
69078
|
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
|
|
69132
|
-
getNodeLinks(node).flags |=
|
|
69079
|
+
getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
|
|
69133
69080
|
}
|
|
69134
69081
|
}
|
|
69135
69082
|
if (isAmbientExternalModule) {
|
|
@@ -70760,8 +70707,8 @@ function createTypeChecker(host) {
|
|
|
70760
70707
|
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
70761
70708
|
if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, void 0, void 0, false)) {
|
|
70762
70709
|
links.isDeclarationWithCollidingName = true;
|
|
70763
|
-
} else if (nodeLinks2.flags &
|
|
70764
|
-
const isDeclaredInLoop = nodeLinks2.flags &
|
|
70710
|
+
} else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
|
|
70711
|
+
const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
|
|
70765
70712
|
const inLoopInitializer = isIterationStatement(container, false);
|
|
70766
70713
|
const inLoopBodyBlock = container.kind === 238 /* Block */ && isIterationStatement(container.parent, false);
|
|
70767
70714
|
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
|
|
@@ -74197,10 +74144,10 @@ var visitEachChildTable = {
|
|
|
74197
74144
|
nodeVisitor(node.initializer, visitor, isExpression)
|
|
74198
74145
|
);
|
|
74199
74146
|
},
|
|
74200
|
-
[308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context,
|
|
74147
|
+
[308 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
74201
74148
|
return context.factory.updateSourceFile(
|
|
74202
74149
|
node,
|
|
74203
|
-
visitLexicalEnvironment(node.statements, visitor, context
|
|
74150
|
+
visitLexicalEnvironment(node.statements, visitor, context)
|
|
74204
74151
|
);
|
|
74205
74152
|
},
|
|
74206
74153
|
[353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -77736,12 +77683,12 @@ function transformClassFields(context) {
|
|
|
77736
77683
|
function visitClassExpressionInNewClassLexicalEnvironment(node, facts) {
|
|
77737
77684
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
77738
77685
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
77739
|
-
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) &
|
|
77686
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
|
|
77740
77687
|
let temp;
|
|
77741
77688
|
function createClassTempVar() {
|
|
77742
77689
|
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
77743
|
-
const isClassWithConstructorReference2 = classCheckFlags &
|
|
77744
|
-
const requiresBlockScopedVar = classCheckFlags &
|
|
77690
|
+
const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
|
|
77691
|
+
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
77745
77692
|
return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
|
|
77746
77693
|
}
|
|
77747
77694
|
if (facts & 2 /* NeedsClassConstructorReference */) {
|
|
@@ -78254,7 +78201,7 @@ function transformClassFields(context) {
|
|
|
78254
78201
|
}
|
|
78255
78202
|
function trySubstituteClassAlias(node) {
|
|
78256
78203
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
78257
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78204
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
78258
78205
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
78259
78206
|
if (declaration) {
|
|
78260
78207
|
const classAlias = classAliases[declaration.id];
|
|
@@ -78277,7 +78224,7 @@ function transformClassFields(context) {
|
|
|
78277
78224
|
const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
78278
78225
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
78279
78226
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
78280
|
-
if (resolver.getNodeCheckFlags(name) &
|
|
78227
|
+
if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78281
78228
|
addBlockScopedVariable(generatedName);
|
|
78282
78229
|
} else {
|
|
78283
78230
|
hoistVariableDeclaration(generatedName);
|
|
@@ -78426,7 +78373,7 @@ function transformClassFields(context) {
|
|
|
78426
78373
|
const { className } = getPrivateIdentifierEnvironment();
|
|
78427
78374
|
const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_";
|
|
78428
78375
|
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);
|
|
78429
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78376
|
+
if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78430
78377
|
addBlockScopedVariable(identifier);
|
|
78431
78378
|
} else {
|
|
78432
78379
|
hoistVariableDeclaration(identifier);
|
|
@@ -79291,7 +79238,7 @@ function transformLegacyDecorators(context) {
|
|
|
79291
79238
|
}
|
|
79292
79239
|
}
|
|
79293
79240
|
function getClassAliasIfNeeded(node) {
|
|
79294
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79241
|
+
if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
|
|
79295
79242
|
enableSubstitutionForClassAliases();
|
|
79296
79243
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
79297
79244
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -79325,7 +79272,7 @@ function transformLegacyDecorators(context) {
|
|
|
79325
79272
|
}
|
|
79326
79273
|
function trySubstituteClassAlias(node) {
|
|
79327
79274
|
if (classAliases) {
|
|
79328
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79275
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
79329
79276
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
79330
79277
|
if (declaration) {
|
|
79331
79278
|
const classAlias = classAliases[declaration.id];
|
|
@@ -79360,7 +79307,7 @@ function transformES2017(context) {
|
|
|
79360
79307
|
let capturedSuperProperties;
|
|
79361
79308
|
let hasSuperElementAccess;
|
|
79362
79309
|
const substitutedSuperAccessors = [];
|
|
79363
|
-
let contextFlags = 0
|
|
79310
|
+
let contextFlags = 0 /* None */;
|
|
79364
79311
|
const previousOnEmitNode = context.onEmitNode;
|
|
79365
79312
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
79366
79313
|
context.onEmitNode = onEmitNode;
|
|
@@ -79687,7 +79634,7 @@ function transformES2017(context) {
|
|
|
79687
79634
|
hasSuperElementAccess = false;
|
|
79688
79635
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
79689
79636
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
79690
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79637
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
79691
79638
|
if (emitSuperHelpers) {
|
|
79692
79639
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79693
79640
|
if (capturedSuperProperties.size) {
|
|
@@ -79698,9 +79645,9 @@ function transformES2017(context) {
|
|
|
79698
79645
|
updated = factory2.updateBlock(updated, statements);
|
|
79699
79646
|
}
|
|
79700
79647
|
if (hasSuperElementAccess) {
|
|
79701
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79648
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79702
79649
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
79703
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79650
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79704
79651
|
addEmitHelper(updated, asyncSuperHelper);
|
|
79705
79652
|
}
|
|
79706
79653
|
}
|
|
@@ -79715,7 +79662,7 @@ function transformES2017(context) {
|
|
|
79715
79662
|
const nodeType = original.type;
|
|
79716
79663
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
79717
79664
|
const isArrowFunction2 = node.kind === 216 /* ArrowFunction */;
|
|
79718
|
-
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) &
|
|
79665
|
+
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
79719
79666
|
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
|
|
79720
79667
|
enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
|
|
79721
79668
|
for (const parameter of node.parameters) {
|
|
@@ -79742,7 +79689,7 @@ function transformES2017(context) {
|
|
|
79742
79689
|
)
|
|
79743
79690
|
);
|
|
79744
79691
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
79745
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79692
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
79746
79693
|
if (emitSuperHelpers) {
|
|
79747
79694
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79748
79695
|
if (capturedSuperProperties.size) {
|
|
@@ -79754,9 +79701,9 @@ function transformES2017(context) {
|
|
|
79754
79701
|
const block = factory2.createBlock(statements, true);
|
|
79755
79702
|
setTextRange(block, node.body);
|
|
79756
79703
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
79757
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79704
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79758
79705
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
79759
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79706
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79760
79707
|
addEmitHelper(block, asyncSuperHelper);
|
|
79761
79708
|
}
|
|
79762
79709
|
}
|
|
@@ -79816,7 +79763,7 @@ function transformES2017(context) {
|
|
|
79816
79763
|
}
|
|
79817
79764
|
function onEmitNode(hint, node, emitCallback) {
|
|
79818
79765
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
79819
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
79766
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
79820
79767
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
79821
79768
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
79822
79769
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -79892,7 +79839,7 @@ function transformES2017(context) {
|
|
|
79892
79839
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
79893
79840
|
}
|
|
79894
79841
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
79895
|
-
if (enclosingSuperContainerFlags &
|
|
79842
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79896
79843
|
return setTextRange(
|
|
79897
79844
|
factory2.createPropertyAccessExpression(
|
|
79898
79845
|
factory2.createCallExpression(
|
|
@@ -79917,7 +79864,7 @@ function transformES2017(context) {
|
|
|
79917
79864
|
}
|
|
79918
79865
|
}
|
|
79919
79866
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
79920
|
-
const hasBinding = (resolver.getNodeCheckFlags(node) &
|
|
79867
|
+
const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
79921
79868
|
const accessors = [];
|
|
79922
79869
|
names.forEach((_, key) => {
|
|
79923
79870
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -80855,7 +80802,7 @@ function transformES2018(context) {
|
|
|
80855
80802
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
80856
80803
|
)
|
|
80857
80804
|
);
|
|
80858
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
80805
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
80859
80806
|
if (emitSuperHelpers) {
|
|
80860
80807
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
80861
80808
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -80866,9 +80813,9 @@ function transformES2018(context) {
|
|
|
80866
80813
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
80867
80814
|
const block = factory2.updateBlock(node.body, statements);
|
|
80868
80815
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
80869
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
80816
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
80870
80817
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
80871
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
80818
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
80872
80819
|
addEmitHelper(block, asyncSuperHelper);
|
|
80873
80820
|
}
|
|
80874
80821
|
}
|
|
@@ -80978,7 +80925,7 @@ function transformES2018(context) {
|
|
|
80978
80925
|
}
|
|
80979
80926
|
function onEmitNode(hint, node, emitCallback) {
|
|
80980
80927
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
80981
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
80928
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
80982
80929
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
80983
80930
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
80984
80931
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -81054,7 +81001,7 @@ function transformES2018(context) {
|
|
|
81054
81001
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
81055
81002
|
}
|
|
81056
81003
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
81057
|
-
if (enclosingSuperContainerFlags &
|
|
81004
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
81058
81005
|
return setTextRange(
|
|
81059
81006
|
factory2.createPropertyAccessExpression(
|
|
81060
81007
|
factory2.createCallExpression(
|
|
@@ -83410,8 +83357,8 @@ function transformES2015(context) {
|
|
|
83410
83357
|
}
|
|
83411
83358
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
83412
83359
|
const flags = resolver.getNodeCheckFlags(node);
|
|
83413
|
-
const isCapturedInFunction = flags &
|
|
83414
|
-
const isDeclaredInLoop = flags &
|
|
83360
|
+
const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
|
|
83361
|
+
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
83415
83362
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
83416
83363
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
83417
83364
|
return emitExplicitInitializer;
|
|
@@ -83772,7 +83719,7 @@ function transformES2015(context) {
|
|
|
83772
83719
|
return factory2.inlineExpressions(expressions);
|
|
83773
83720
|
}
|
|
83774
83721
|
function shouldConvertPartOfIterationStatement(node) {
|
|
83775
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83722
|
+
return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
|
|
83776
83723
|
}
|
|
83777
83724
|
function shouldConvertInitializerOfForStatement(node) {
|
|
83778
83725
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -83787,7 +83734,7 @@ function transformES2015(context) {
|
|
|
83787
83734
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
83788
83735
|
}
|
|
83789
83736
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
83790
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83737
|
+
return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
|
|
83791
83738
|
}
|
|
83792
83739
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
83793
83740
|
if (!state.hoistedLocalVariables) {
|
|
@@ -84248,10 +84195,10 @@ function transformES2015(context) {
|
|
|
84248
84195
|
} else {
|
|
84249
84196
|
loopParameters.push(factory2.createParameterDeclaration(void 0, void 0, name));
|
|
84250
84197
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
84251
|
-
if (checkFlags &
|
|
84198
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
84252
84199
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
84253
|
-
let flags = 0
|
|
84254
|
-
if (checkFlags &
|
|
84200
|
+
let flags = 0 /* None */;
|
|
84201
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
|
|
84255
84202
|
flags |= 1 /* Body */;
|
|
84256
84203
|
}
|
|
84257
84204
|
if (isForStatement(container)) {
|
|
@@ -92168,7 +92115,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
92168
92115
|
const sourceMap = sourceMapGenerator.toString();
|
|
92169
92116
|
writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap, false, sourceFiles);
|
|
92170
92117
|
if (printer.bundleFileInfo)
|
|
92171
|
-
printer.bundleFileInfo.mapHash = computeSignature(sourceMap,
|
|
92118
|
+
printer.bundleFileInfo.mapHash = computeSignature(sourceMap, host);
|
|
92172
92119
|
}
|
|
92173
92120
|
} else {
|
|
92174
92121
|
writer.writeLine();
|
|
@@ -92176,7 +92123,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
92176
92123
|
const text = writer.getText();
|
|
92177
92124
|
writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos, diagnostics: transform.diagnostics });
|
|
92178
92125
|
if (printer.bundleFileInfo)
|
|
92179
|
-
printer.bundleFileInfo.hash = computeSignature(text,
|
|
92126
|
+
printer.bundleFileInfo.hash = computeSignature(text, host);
|
|
92180
92127
|
writer.clear();
|
|
92181
92128
|
}
|
|
92182
92129
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
@@ -92322,7 +92269,6 @@ function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
|
|
|
92322
92269
|
return result;
|
|
92323
92270
|
}
|
|
92324
92271
|
function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers) {
|
|
92325
|
-
const createHash = maybeBind(host, host.createHash);
|
|
92326
92272
|
const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, false);
|
|
92327
92273
|
const buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
|
|
92328
92274
|
if (!buildInfo)
|
|
@@ -92332,22 +92278,22 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92332
92278
|
const jsFileText = host.readFile(Debug.checkDefined(jsFilePath));
|
|
92333
92279
|
if (!jsFileText)
|
|
92334
92280
|
return jsFilePath;
|
|
92335
|
-
if (computeSignature(jsFileText,
|
|
92281
|
+
if (computeSignature(jsFileText, host) !== buildInfo.bundle.js.hash)
|
|
92336
92282
|
return jsFilePath;
|
|
92337
92283
|
const sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath);
|
|
92338
92284
|
if (sourceMapFilePath && !sourceMapText || config.options.inlineSourceMap)
|
|
92339
92285
|
return sourceMapFilePath || "inline sourcemap decoding";
|
|
92340
|
-
if (sourceMapFilePath && computeSignature(sourceMapText,
|
|
92286
|
+
if (sourceMapFilePath && computeSignature(sourceMapText, host) !== buildInfo.bundle.js.mapHash)
|
|
92341
92287
|
return sourceMapFilePath;
|
|
92342
92288
|
const declarationText = declarationFilePath && host.readFile(declarationFilePath);
|
|
92343
92289
|
if (declarationFilePath && !declarationText)
|
|
92344
92290
|
return declarationFilePath;
|
|
92345
|
-
if (declarationFilePath && computeSignature(declarationText,
|
|
92291
|
+
if (declarationFilePath && computeSignature(declarationText, host) !== buildInfo.bundle.dts.hash)
|
|
92346
92292
|
return declarationFilePath;
|
|
92347
92293
|
const declarationMapText = declarationMapPath && host.readFile(declarationMapPath);
|
|
92348
92294
|
if (declarationMapPath && !declarationMapText || config.options.inlineSourceMap)
|
|
92349
92295
|
return declarationMapPath || "inline sourcemap decoding";
|
|
92350
|
-
if (declarationMapPath && computeSignature(declarationMapText,
|
|
92296
|
+
if (declarationMapPath && computeSignature(declarationMapText, host) !== buildInfo.bundle.dts.mapHash)
|
|
92351
92297
|
return declarationMapPath;
|
|
92352
92298
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
92353
92299
|
const ownPrependInput = createInputFilesWithFileTexts(
|
|
@@ -92417,7 +92363,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92417
92363
|
getBuildInfo: (bundle) => {
|
|
92418
92364
|
const program = buildInfo.program;
|
|
92419
92365
|
if (program && changedDtsText !== void 0 && config.options.composite) {
|
|
92420
|
-
program.outSignature = computeSignature(changedDtsText,
|
|
92366
|
+
program.outSignature = computeSignature(changedDtsText, host, changedDtsData);
|
|
92421
92367
|
}
|
|
92422
92368
|
const { js, dts, sourceFiles } = buildInfo.bundle;
|
|
92423
92369
|
bundle.js.sources = js.sources;
|
|
@@ -92430,7 +92376,7 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
|
|
|
92430
92376
|
getSourceFileFromReference: returnUndefined,
|
|
92431
92377
|
redirectTargetsMap: createMultiMap(),
|
|
92432
92378
|
getFileIncludeReasons: notImplemented,
|
|
92433
|
-
createHash
|
|
92379
|
+
createHash: maybeBind(host, host.createHash)
|
|
92434
92380
|
};
|
|
92435
92381
|
emitFiles(
|
|
92436
92382
|
notImplementedResolver,
|
|
@@ -100487,7 +100433,7 @@ var BuilderState;
|
|
|
100487
100433
|
return oldState && !oldState.referencedMap === !newReferencedMap;
|
|
100488
100434
|
}
|
|
100489
100435
|
BuilderState2.canReuseOldState = canReuseOldState;
|
|
100490
|
-
function create(newProgram,
|
|
100436
|
+
function create(newProgram, oldState, disableUseFileVersionAsSignature) {
|
|
100491
100437
|
var _a2, _b, _c;
|
|
100492
100438
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
100493
100439
|
const options = newProgram.getCompilerOptions();
|
|
@@ -100495,6 +100441,7 @@ var BuilderState;
|
|
|
100495
100441
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
100496
100442
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
100497
100443
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
100444
|
+
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
100498
100445
|
newProgram.getTypeChecker();
|
|
100499
100446
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
100500
100447
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
@@ -100533,30 +100480,29 @@ var BuilderState;
|
|
|
100533
100480
|
state.allFileNames = void 0;
|
|
100534
100481
|
}
|
|
100535
100482
|
BuilderState2.releaseCache = releaseCache2;
|
|
100536
|
-
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken,
|
|
100483
|
+
function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, host) {
|
|
100537
100484
|
var _a2, _b;
|
|
100538
100485
|
const result = getFilesAffectedByWithOldState(
|
|
100539
100486
|
state,
|
|
100540
100487
|
programOfThisState,
|
|
100541
100488
|
path,
|
|
100542
100489
|
cancellationToken,
|
|
100543
|
-
|
|
100544
|
-
getCanonicalFileName
|
|
100490
|
+
host
|
|
100545
100491
|
);
|
|
100546
100492
|
(_a2 = state.oldSignatures) == null ? void 0 : _a2.clear();
|
|
100547
100493
|
(_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear();
|
|
100548
100494
|
return result;
|
|
100549
100495
|
}
|
|
100550
100496
|
BuilderState2.getFilesAffectedBy = getFilesAffectedBy;
|
|
100551
|
-
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken,
|
|
100497
|
+
function getFilesAffectedByWithOldState(state, programOfThisState, path, cancellationToken, host) {
|
|
100552
100498
|
const sourceFile = programOfThisState.getSourceFileByPath(path);
|
|
100553
100499
|
if (!sourceFile) {
|
|
100554
100500
|
return emptyArray;
|
|
100555
100501
|
}
|
|
100556
|
-
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken,
|
|
100502
|
+
if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host)) {
|
|
100557
100503
|
return [sourceFile];
|
|
100558
100504
|
}
|
|
100559
|
-
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken,
|
|
100505
|
+
return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host);
|
|
100560
100506
|
}
|
|
100561
100507
|
BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState;
|
|
100562
100508
|
function updateSignatureOfFile(state, signature, path) {
|
|
@@ -100564,7 +100510,7 @@ var BuilderState;
|
|
|
100564
100510
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
|
|
100565
100511
|
}
|
|
100566
100512
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
100567
|
-
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken,
|
|
100513
|
+
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
100568
100514
|
var _a2;
|
|
100569
100515
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
100570
100516
|
return false;
|
|
@@ -100577,10 +100523,10 @@ var BuilderState;
|
|
|
100577
100523
|
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
100578
100524
|
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
100579
100525
|
latestSignature = computeSignatureWithDiagnostics(
|
|
100526
|
+
programOfThisState,
|
|
100580
100527
|
sourceFile,
|
|
100581
100528
|
text,
|
|
100582
|
-
|
|
100583
|
-
getCanonicalFileName,
|
|
100529
|
+
host,
|
|
100584
100530
|
data
|
|
100585
100531
|
);
|
|
100586
100532
|
if (latestSignature !== prevSignature) {
|
|
@@ -100719,7 +100665,7 @@ var BuilderState;
|
|
|
100719
100665
|
}
|
|
100720
100666
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100721
100667
|
}
|
|
100722
|
-
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken,
|
|
100668
|
+
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, host) {
|
|
100723
100669
|
if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
|
|
100724
100670
|
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
|
100725
100671
|
}
|
|
@@ -100735,7 +100681,7 @@ var BuilderState;
|
|
|
100735
100681
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
100736
100682
|
const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath);
|
|
100737
100683
|
seenFileNamesMap.set(currentPath, currentSourceFile);
|
|
100738
|
-
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken,
|
|
100684
|
+
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, host)) {
|
|
100739
100685
|
queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
100740
100686
|
}
|
|
100741
100687
|
}
|
|
@@ -100777,9 +100723,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
|
100777
100723
|
function hasSameKeys(map1, map2) {
|
|
100778
100724
|
return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
|
|
100779
100725
|
}
|
|
100780
|
-
function createBuilderProgramState(newProgram,
|
|
100726
|
+
function createBuilderProgramState(newProgram, oldState, disableUseFileVersionAsSignature) {
|
|
100781
100727
|
var _a2, _b;
|
|
100782
|
-
const state = BuilderState.create(newProgram,
|
|
100728
|
+
const state = BuilderState.create(newProgram, oldState, disableUseFileVersionAsSignature);
|
|
100783
100729
|
state.program = newProgram;
|
|
100784
100730
|
const compilerOptions = newProgram.getCompilerOptions();
|
|
100785
100731
|
state.compilerOptions = compilerOptions;
|
|
@@ -100823,7 +100769,7 @@ function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, d
|
|
|
100823
100769
|
return;
|
|
100824
100770
|
const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
|
|
100825
100771
|
if (diagnostics) {
|
|
100826
|
-
state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram
|
|
100772
|
+
state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : diagnostics);
|
|
100827
100773
|
if (!state.semanticDiagnosticsFromOldState) {
|
|
100828
100774
|
state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set();
|
|
100829
100775
|
}
|
|
@@ -100883,10 +100829,11 @@ function addFileToChangeSet(state, path) {
|
|
|
100883
100829
|
function getEmitSignatureFromOldSignature(options, oldOptions, oldEmitSignature) {
|
|
100884
100830
|
return !!options.declarationMap === !!oldOptions.declarationMap ? oldEmitSignature : isString(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0];
|
|
100885
100831
|
}
|
|
100886
|
-
function convertToDiagnostics(diagnostics, newProgram
|
|
100832
|
+
function convertToDiagnostics(diagnostics, newProgram) {
|
|
100887
100833
|
if (!diagnostics.length)
|
|
100888
100834
|
return emptyArray;
|
|
100889
|
-
|
|
100835
|
+
let buildInfoDirectory;
|
|
100836
|
+
let getCanonicalFileName;
|
|
100890
100837
|
return diagnostics.map((diagnostic) => {
|
|
100891
100838
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
100892
100839
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -100898,7 +100845,8 @@ function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) {
|
|
|
100898
100845
|
return result;
|
|
100899
100846
|
});
|
|
100900
100847
|
function toPath3(path) {
|
|
100901
|
-
|
|
100848
|
+
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
100849
|
+
return toPath(path, buildInfoDirectory, getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames()));
|
|
100902
100850
|
}
|
|
100903
100851
|
}
|
|
100904
100852
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -100940,7 +100888,7 @@ function restoreBuilderProgramEmitState(state, savedEmitState) {
|
|
|
100940
100888
|
function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
|
|
100941
100889
|
Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
|
|
100942
100890
|
}
|
|
100943
|
-
function getNextAffectedFile(state, cancellationToken,
|
|
100891
|
+
function getNextAffectedFile(state, cancellationToken, host) {
|
|
100944
100892
|
var _a2, _b;
|
|
100945
100893
|
while (true) {
|
|
100946
100894
|
const { affectedFiles } = state;
|
|
@@ -100956,8 +100904,6 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
|
|
|
100956
100904
|
state,
|
|
100957
100905
|
affectedFile,
|
|
100958
100906
|
cancellationToken,
|
|
100959
|
-
computeHash,
|
|
100960
|
-
getCanonicalFileName,
|
|
100961
100907
|
host
|
|
100962
100908
|
);
|
|
100963
100909
|
return affectedFile;
|
|
@@ -100985,8 +100931,7 @@ function getNextAffectedFile(state, cancellationToken, computeHash, getCanonical
|
|
|
100985
100931
|
program,
|
|
100986
100932
|
nextKey.value,
|
|
100987
100933
|
cancellationToken,
|
|
100988
|
-
|
|
100989
|
-
getCanonicalFileName
|
|
100934
|
+
host
|
|
100990
100935
|
);
|
|
100991
100936
|
state.currentChangedFilePath = nextKey.value;
|
|
100992
100937
|
state.affectedFilesIndex = 0;
|
|
@@ -101038,7 +100983,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
|
|
|
101038
100983
|
);
|
|
101039
100984
|
}
|
|
101040
100985
|
}
|
|
101041
|
-
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken,
|
|
100986
|
+
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
101042
100987
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
101043
100988
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
101044
100989
|
removeDiagnosticsOfLibraryFiles(state);
|
|
@@ -101047,8 +100992,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
101047
100992
|
Debug.checkDefined(state.program),
|
|
101048
100993
|
affectedFile,
|
|
101049
100994
|
cancellationToken,
|
|
101050
|
-
|
|
101051
|
-
getCanonicalFileName
|
|
100995
|
+
host
|
|
101052
100996
|
);
|
|
101053
100997
|
return;
|
|
101054
100998
|
}
|
|
@@ -101058,12 +101002,10 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
101058
101002
|
state,
|
|
101059
101003
|
affectedFile,
|
|
101060
101004
|
cancellationToken,
|
|
101061
|
-
computeHash,
|
|
101062
|
-
getCanonicalFileName,
|
|
101063
101005
|
host
|
|
101064
101006
|
);
|
|
101065
101007
|
}
|
|
101066
|
-
function handleDtsMayChangeOf(state, path, cancellationToken,
|
|
101008
|
+
function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
101067
101009
|
removeSemanticDiagnosticsOf(state, path);
|
|
101068
101010
|
if (!state.changedFilesSet.has(path)) {
|
|
101069
101011
|
const program = Debug.checkDefined(state.program);
|
|
@@ -101074,8 +101016,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, computeHash, getCa
|
|
|
101074
101016
|
program,
|
|
101075
101017
|
sourceFile,
|
|
101076
101018
|
cancellationToken,
|
|
101077
|
-
|
|
101078
|
-
getCanonicalFileName,
|
|
101019
|
+
host,
|
|
101079
101020
|
!host.disableUseFileVersionAsSignature
|
|
101080
101021
|
);
|
|
101081
101022
|
if (getEmitDeclarations(state.compilerOptions)) {
|
|
@@ -101097,7 +101038,7 @@ function isChangedSignature(state, path) {
|
|
|
101097
101038
|
const newSignature = Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
101098
101039
|
return newSignature !== oldSignature;
|
|
101099
101040
|
}
|
|
101100
|
-
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken,
|
|
101041
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host) {
|
|
101101
101042
|
var _a2;
|
|
101102
101043
|
if (!((_a2 = state.fileInfos.get(filePath)) == null ? void 0 : _a2.affectsGlobalScope))
|
|
101103
101044
|
return false;
|
|
@@ -101105,14 +101046,12 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, com
|
|
|
101105
101046
|
state,
|
|
101106
101047
|
file.resolvedPath,
|
|
101107
101048
|
cancellationToken,
|
|
101108
|
-
computeHash,
|
|
101109
|
-
getCanonicalFileName,
|
|
101110
101049
|
host
|
|
101111
101050
|
));
|
|
101112
101051
|
removeDiagnosticsOfLibraryFiles(state);
|
|
101113
101052
|
return true;
|
|
101114
101053
|
}
|
|
101115
|
-
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken,
|
|
101054
|
+
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
101116
101055
|
var _a2;
|
|
101117
101056
|
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
101118
101057
|
return;
|
|
@@ -101126,9 +101065,9 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101126
101065
|
const currentPath = queue.pop();
|
|
101127
101066
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
101128
101067
|
seenFileNamesMap.set(currentPath, true);
|
|
101129
|
-
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken,
|
|
101068
|
+
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, host))
|
|
101130
101069
|
return;
|
|
101131
|
-
handleDtsMayChangeOf(state, currentPath, cancellationToken,
|
|
101070
|
+
handleDtsMayChangeOf(state, currentPath, cancellationToken, host);
|
|
101132
101071
|
if (isChangedSignature(state, currentPath)) {
|
|
101133
101072
|
const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
101134
101073
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -101138,7 +101077,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101138
101077
|
}
|
|
101139
101078
|
const seenFileAndExportsOfFile = /* @__PURE__ */ new Set();
|
|
101140
101079
|
(_a2 = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _a2.forEach((exportedFromPath) => {
|
|
101141
|
-
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken,
|
|
101080
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host))
|
|
101142
101081
|
return true;
|
|
101143
101082
|
const references = state.referencedMap.getKeys(exportedFromPath);
|
|
101144
101083
|
return references && forEachKey(
|
|
@@ -101148,28 +101087,24 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
101148
101087
|
filePath,
|
|
101149
101088
|
seenFileAndExportsOfFile,
|
|
101150
101089
|
cancellationToken,
|
|
101151
|
-
computeHash,
|
|
101152
|
-
getCanonicalFileName,
|
|
101153
101090
|
host
|
|
101154
101091
|
)
|
|
101155
101092
|
);
|
|
101156
101093
|
});
|
|
101157
101094
|
}
|
|
101158
|
-
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken,
|
|
101095
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) {
|
|
101159
101096
|
var _a2, _b;
|
|
101160
101097
|
if (!tryAddToSet(seenFileAndExportsOfFile, filePath))
|
|
101161
101098
|
return void 0;
|
|
101162
|
-
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken,
|
|
101099
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host))
|
|
101163
101100
|
return true;
|
|
101164
|
-
handleDtsMayChangeOf(state, filePath, cancellationToken,
|
|
101101
|
+
handleDtsMayChangeOf(state, filePath, cancellationToken, host);
|
|
101165
101102
|
(_a2 = state.exportedModulesMap.getKeys(filePath)) == null ? void 0 : _a2.forEach(
|
|
101166
101103
|
(exportedFromPath) => handleDtsMayChangeOfFileAndExportsOfFile(
|
|
101167
101104
|
state,
|
|
101168
101105
|
exportedFromPath,
|
|
101169
101106
|
seenFileAndExportsOfFile,
|
|
101170
101107
|
cancellationToken,
|
|
101171
|
-
computeHash,
|
|
101172
|
-
getCanonicalFileName,
|
|
101173
101108
|
host
|
|
101174
101109
|
)
|
|
101175
101110
|
);
|
|
@@ -101178,8 +101113,6 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndEx
|
|
|
101178
101113
|
state,
|
|
101179
101114
|
referencingFilePath,
|
|
101180
101115
|
cancellationToken,
|
|
101181
|
-
computeHash,
|
|
101182
|
-
getCanonicalFileName,
|
|
101183
101116
|
host
|
|
101184
101117
|
)
|
|
101185
101118
|
);
|
|
@@ -101208,9 +101141,10 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
101208
101141
|
function isProgramBundleEmitBuildInfo(info) {
|
|
101209
101142
|
return !!outFile(info.options || {});
|
|
101210
101143
|
}
|
|
101211
|
-
function getBuildInfo2(state,
|
|
101144
|
+
function getBuildInfo2(state, bundle) {
|
|
101212
101145
|
var _a2, _b, _c;
|
|
101213
101146
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
101147
|
+
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
101214
101148
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
101215
101149
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
101216
101150
|
const fileNames = [];
|
|
@@ -101429,8 +101363,9 @@ function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldP
|
|
|
101429
101363
|
function getTextHandlingSourceMapForSignature(text, data) {
|
|
101430
101364
|
return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text;
|
|
101431
101365
|
}
|
|
101432
|
-
function computeSignatureWithDiagnostics(sourceFile, text,
|
|
101433
|
-
var _a2;
|
|
101366
|
+
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
101367
|
+
var _a2, _b;
|
|
101368
|
+
let getCanonicalFileName;
|
|
101434
101369
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
101435
101370
|
let sourceFileDirectory;
|
|
101436
101371
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -101438,7 +101373,7 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
|
|
|
101438
101373
|
(diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`
|
|
101439
101374
|
).join("\n");
|
|
101440
101375
|
}
|
|
101441
|
-
return (
|
|
101376
|
+
return ((_b = host.createHash) != null ? _b : generateDjb2Hash)(text);
|
|
101442
101377
|
function flattenDiagnosticMessageText2(diagnostic) {
|
|
101443
101378
|
return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n");
|
|
101444
101379
|
}
|
|
@@ -101447,11 +101382,16 @@ function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanon
|
|
|
101447
101382
|
return `(${diagnostic.start},${diagnostic.length})`;
|
|
101448
101383
|
if (sourceFileDirectory === void 0)
|
|
101449
101384
|
sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath);
|
|
101450
|
-
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101385
|
+
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101386
|
+
sourceFileDirectory,
|
|
101387
|
+
diagnostic.file.resolvedPath,
|
|
101388
|
+
getCanonicalFileName != null ? getCanonicalFileName : getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames())
|
|
101389
|
+
))}(${diagnostic.start},${diagnostic.length})`;
|
|
101451
101390
|
}
|
|
101452
101391
|
}
|
|
101453
|
-
function computeSignature(text,
|
|
101454
|
-
|
|
101392
|
+
function computeSignature(text, host, data) {
|
|
101393
|
+
var _a2;
|
|
101394
|
+
return ((_a2 = host.createHash) != null ? _a2 : generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
101455
101395
|
}
|
|
101456
101396
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
101457
101397
|
let oldState = oldProgram && oldProgram.getState();
|
|
@@ -101460,10 +101400,8 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101460
101400
|
oldState = void 0;
|
|
101461
101401
|
return oldProgram;
|
|
101462
101402
|
}
|
|
101463
|
-
const
|
|
101464
|
-
|
|
101465
|
-
const state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
|
101466
|
-
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, getCanonicalFileName, bundle);
|
|
101403
|
+
const state = createBuilderProgramState(newProgram, oldState, host.disableUseFileVersionAsSignature);
|
|
101404
|
+
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
|
|
101467
101405
|
newProgram = void 0;
|
|
101468
101406
|
oldProgram = void 0;
|
|
101469
101407
|
oldState = void 0;
|
|
@@ -101497,7 +101435,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101497
101435
|
}
|
|
101498
101436
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
101499
101437
|
var _a2, _b, _c, _d, _e;
|
|
101500
|
-
let affected = getNextAffectedFile(state, cancellationToken,
|
|
101438
|
+
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
101501
101439
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
101502
101440
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
101503
101441
|
if (!affected) {
|
|
@@ -101571,10 +101509,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101571
101509
|
const info = state.fileInfos.get(file.resolvedPath);
|
|
101572
101510
|
if (info.signature === file.version) {
|
|
101573
101511
|
const signature = computeSignatureWithDiagnostics(
|
|
101512
|
+
state.program,
|
|
101574
101513
|
file,
|
|
101575
101514
|
text,
|
|
101576
|
-
|
|
101577
|
-
getCanonicalFileName,
|
|
101515
|
+
host,
|
|
101578
101516
|
data
|
|
101579
101517
|
);
|
|
101580
101518
|
if (!((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length))
|
|
@@ -101618,7 +101556,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101618
101556
|
state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
101619
101557
|
function handleNewSignature(oldSignatureFormat, newSignature) {
|
|
101620
101558
|
const oldSignature = !oldSignatureFormat || isString(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0];
|
|
101621
|
-
newSignature != null ? newSignature : newSignature = computeSignature(text,
|
|
101559
|
+
newSignature != null ? newSignature : newSignature = computeSignature(text, host, data);
|
|
101622
101560
|
if (newSignature === oldSignature) {
|
|
101623
101561
|
if (oldSignatureFormat === oldSignature)
|
|
101624
101562
|
return void 0;
|
|
@@ -101674,7 +101612,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101674
101612
|
}
|
|
101675
101613
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
101676
101614
|
while (true) {
|
|
101677
|
-
const affected = getNextAffectedFile(state, cancellationToken,
|
|
101615
|
+
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
101678
101616
|
let result;
|
|
101679
101617
|
if (!affected)
|
|
101680
101618
|
return void 0;
|
|
@@ -102159,12 +102097,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102159
102097
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102160
102098
|
trace(
|
|
102161
102099
|
host,
|
|
102162
|
-
loader === resolveModuleName2 ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.
|
|
102100
|
+
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,
|
|
102163
102101
|
name,
|
|
102164
102102
|
containingFile,
|
|
102165
102103
|
getDirectoryPath(containingFile),
|
|
102166
102104
|
resolved == null ? void 0 : resolved.resolvedFileName,
|
|
102167
|
-
(resolved == null ? void 0 : resolved.
|
|
102105
|
+
(resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId)
|
|
102168
102106
|
);
|
|
102169
102107
|
}
|
|
102170
102108
|
} else {
|
|
@@ -102189,11 +102127,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102189
102127
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102190
102128
|
trace(
|
|
102191
102129
|
host,
|
|
102192
|
-
loader === resolveModuleName2 ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.
|
|
102130
|
+
loader === resolveModuleName2 ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,
|
|
102193
102131
|
name,
|
|
102194
102132
|
containingFile,
|
|
102195
102133
|
resolved == null ? void 0 : resolved.resolvedFileName,
|
|
102196
|
-
(resolved == null ? void 0 : resolved.
|
|
102134
|
+
(resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId)
|
|
102197
102135
|
);
|
|
102198
102136
|
}
|
|
102199
102137
|
}
|