typescript 5.8.0-dev.20250122 → 5.8.0-dev.20250124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_tsc.js +84 -16
- package/lib/lib.dom.d.ts +722 -123
- package/lib/lib.dom.iterable.d.ts +9 -7
- package/lib/lib.webworker.d.ts +254 -47
- package/lib/lib.webworker.iterable.d.ts +6 -7
- package/lib/typescript.d.ts +3 -0
- package/lib/typescript.js +104 -30
- package/package.json +2 -2
package/lib/_tsc.js
CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
18
18
|
|
19
19
|
// src/compiler/corePublic.ts
|
20
20
|
var versionMajorMinor = "5.8";
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20250124`;
|
22
22
|
|
23
23
|
// src/compiler/core.ts
|
24
24
|
var emptyArray = [];
|
@@ -6021,6 +6021,7 @@ var Diagnostics = {
|
|
6021
6021
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
6022
6022
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
6023
6023
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
|
6024
|
+
This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
|
6024
6025
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
6025
6026
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
6026
6027
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
@@ -6824,6 +6825,7 @@ var Diagnostics = {
|
|
6824
6825
|
This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
|
6825
6826
|
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
6826
6827
|
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
6828
|
+
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'."),
|
6827
6829
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
6828
6830
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
6829
6831
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
@@ -7507,11 +7509,13 @@ var Diagnostics = {
|
|
7507
7509
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
7508
7510
|
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
|
7509
7511
|
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
|
7512
|
+
Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3 /* Message */, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
|
7510
7513
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
7511
7514
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
7512
7515
|
Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
|
7513
7516
|
Check_side_effect_imports: diag(6806, 3 /* Message */, "Check_side_effect_imports_6806", "Check side effect imports."),
|
7514
7517
|
This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1 /* Error */, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
|
7518
|
+
Enable_lib_replacement: diag(6808, 3 /* Message */, "Enable_lib_replacement_6808", "Enable lib replacement."),
|
7515
7519
|
one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
|
7516
7520
|
one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
|
7517
7521
|
type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
|
@@ -36846,6 +36850,23 @@ var commandOptionsWithoutBuild = [
|
|
36846
36850
|
affectsBuildInfo: true,
|
36847
36851
|
affectsSemanticDiagnostics: true
|
36848
36852
|
},
|
36853
|
+
{
|
36854
|
+
name: "erasableSyntaxOnly",
|
36855
|
+
type: "boolean",
|
36856
|
+
category: Diagnostics.Interop_Constraints,
|
36857
|
+
description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
|
36858
|
+
defaultValueDescription: false,
|
36859
|
+
affectsBuildInfo: true,
|
36860
|
+
affectsSemanticDiagnostics: true
|
36861
|
+
},
|
36862
|
+
{
|
36863
|
+
name: "libReplacement",
|
36864
|
+
type: "boolean",
|
36865
|
+
affectsProgramStructure: true,
|
36866
|
+
category: Diagnostics.Language_and_Environment,
|
36867
|
+
description: Diagnostics.Enable_lib_replacement,
|
36868
|
+
defaultValueDescription: true
|
36869
|
+
},
|
36849
36870
|
// Strict Type Checks
|
36850
36871
|
{
|
36851
36872
|
name: "strict",
|
@@ -41302,6 +41323,7 @@ function hasOneAsterisk(patternKey) {
|
|
41302
41323
|
function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
|
41303
41324
|
return loadModuleFromTargetExportOrImport;
|
41304
41325
|
function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
|
41326
|
+
var _a, _b;
|
41305
41327
|
if (typeof target === "string") {
|
41306
41328
|
if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
|
41307
41329
|
if (state.traceEnabled) {
|
@@ -41330,6 +41352,8 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
|
|
41330
41352
|
redirectedReference,
|
41331
41353
|
state.conditions
|
41332
41354
|
);
|
41355
|
+
(_a = state.failedLookupLocations) == null ? void 0 : _a.push(...result.failedLookupLocations ?? emptyArray);
|
41356
|
+
(_b = state.affectingLocations) == null ? void 0 : _b.push(...result.affectingLocations ?? emptyArray);
|
41333
41357
|
return toSearchResult(
|
41334
41358
|
result.resolvedModule ? {
|
41335
41359
|
path: result.resolvedModule.resolvedFileName,
|
@@ -41439,20 +41463,20 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
|
|
41439
41463
|
void 0
|
41440
41464
|
);
|
41441
41465
|
function toAbsolutePath(path) {
|
41442
|
-
var
|
41466
|
+
var _a2, _b2;
|
41443
41467
|
if (path === void 0) return path;
|
41444
|
-
return getNormalizedAbsolutePath(path, (
|
41468
|
+
return getNormalizedAbsolutePath(path, (_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2));
|
41445
41469
|
}
|
41446
41470
|
function combineDirectoryPath(root, dir) {
|
41447
41471
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
41448
41472
|
}
|
41449
41473
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
41450
|
-
var
|
41474
|
+
var _a2, _b2, _c, _d;
|
41451
41475
|
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
41452
41476
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
41453
41477
|
const commonSourceDirGuesses = [];
|
41454
41478
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
41455
|
-
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((
|
41479
|
+
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "", getCanonicalFileName));
|
41456
41480
|
commonSourceDirGuesses.push(commonDir);
|
41457
41481
|
} else if (state.requestContainingDirectory) {
|
41458
41482
|
const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
|
@@ -41508,8 +41532,8 @@ function getLoadModuleFromTargetExportOrImport(extensions, state, cache, redirec
|
|
41508
41532
|
}
|
41509
41533
|
return void 0;
|
41510
41534
|
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
|
41511
|
-
var
|
41512
|
-
const currentDir = state.compilerOptions.configFile ? ((
|
41535
|
+
var _a3, _b3;
|
41536
|
+
const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
|
41513
41537
|
const candidateDirectories = [];
|
41514
41538
|
if (state.compilerOptions.declarationDir) {
|
41515
41539
|
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
|
@@ -42877,13 +42901,16 @@ function createBinder() {
|
|
42877
42901
|
function bindForStatement(node) {
|
42878
42902
|
const preLoopLabel = setContinueTarget(node, createLoopLabel());
|
42879
42903
|
const preBodyLabel = createBranchLabel();
|
42904
|
+
const preIncrementorLabel = createBranchLabel();
|
42880
42905
|
const postLoopLabel = createBranchLabel();
|
42881
42906
|
bind(node.initializer);
|
42882
42907
|
addAntecedent(preLoopLabel, currentFlow);
|
42883
42908
|
currentFlow = preLoopLabel;
|
42884
42909
|
bindCondition(node.condition, preBodyLabel, postLoopLabel);
|
42885
42910
|
currentFlow = finishFlowLabel(preBodyLabel);
|
42886
|
-
bindIterativeStatement(node.statement, postLoopLabel,
|
42911
|
+
bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
|
42912
|
+
addAntecedent(preIncrementorLabel, currentFlow);
|
42913
|
+
currentFlow = finishFlowLabel(preIncrementorLabel);
|
42887
42914
|
bind(node.incrementor);
|
42888
42915
|
addAntecedent(preLoopLabel, currentFlow);
|
42889
42916
|
currentFlow = finishFlowLabel(postLoopLabel);
|
@@ -46584,8 +46611,13 @@ function createTypeChecker(host) {
|
|
46584
46611
|
getMemberOverrideModifierStatus,
|
46585
46612
|
isTypeParameterPossiblyReferenced,
|
46586
46613
|
typeHasCallOrConstructSignatures,
|
46587
|
-
getSymbolFlags
|
46614
|
+
getSymbolFlags,
|
46615
|
+
getTypeArgumentsForResolvedSignature
|
46588
46616
|
};
|
46617
|
+
function getTypeArgumentsForResolvedSignature(signature) {
|
46618
|
+
if (signature.mapper === void 0) return void 0;
|
46619
|
+
return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
|
46620
|
+
}
|
46589
46621
|
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
46590
46622
|
const candidatesSet = /* @__PURE__ */ new Set();
|
46591
46623
|
const candidates = [];
|
@@ -49186,7 +49218,7 @@ function createTypeChecker(host) {
|
|
49186
49218
|
moduleReference
|
49187
49219
|
);
|
49188
49220
|
}
|
49189
|
-
if (errorNode && (
|
49221
|
+
if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) {
|
49190
49222
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
49191
49223
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
|
49192
49224
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
@@ -59585,6 +59617,9 @@ function createTypeChecker(host) {
|
|
59585
59617
|
case "Number":
|
59586
59618
|
checkNoTypeArguments(node);
|
59587
59619
|
return numberType;
|
59620
|
+
case "BigInt":
|
59621
|
+
checkNoTypeArguments(node);
|
59622
|
+
return bigintType;
|
59588
59623
|
case "Boolean":
|
59589
59624
|
checkNoTypeArguments(node);
|
59590
59625
|
return booleanType;
|
@@ -68504,6 +68539,7 @@ function createTypeChecker(host) {
|
|
68504
68539
|
return target.kind === 108 /* SuperKeyword */;
|
68505
68540
|
case 235 /* NonNullExpression */:
|
68506
68541
|
case 217 /* ParenthesizedExpression */:
|
68542
|
+
case 238 /* SatisfiesExpression */:
|
68507
68543
|
return isMatchingReference(source.expression, target);
|
68508
68544
|
case 211 /* PropertyAccessExpression */:
|
68509
68545
|
case 212 /* ElementAccessExpression */:
|
@@ -70473,6 +70509,7 @@ function createTypeChecker(host) {
|
|
70473
70509
|
return narrowTypeByCallExpression(type, expr, assumeTrue);
|
70474
70510
|
case 217 /* ParenthesizedExpression */:
|
70475
70511
|
case 235 /* NonNullExpression */:
|
70512
|
+
case 238 /* SatisfiesExpression */:
|
70476
70513
|
return narrowType(type, expr.expression, assumeTrue);
|
70477
70514
|
case 226 /* BinaryExpression */:
|
70478
70515
|
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
|
@@ -73654,6 +73691,9 @@ function createTypeChecker(host) {
|
|
73654
73691
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
|
73655
73692
|
}
|
73656
73693
|
function getJsxElementChildrenPropertyName(jsxNamespace) {
|
73694
|
+
if (compilerOptions.jsx === 4 /* ReactJSX */ || compilerOptions.jsx === 5 /* ReactJSXDev */) {
|
73695
|
+
return "children";
|
73696
|
+
}
|
73657
73697
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
|
73658
73698
|
}
|
73659
73699
|
function getUninstantiatedJsxSignaturesOfType(elementType, caller) {
|
@@ -80165,6 +80205,9 @@ function createTypeChecker(host) {
|
|
80165
80205
|
checkVariableLikeDeclaration(node);
|
80166
80206
|
const func = getContainingFunction(node);
|
80167
80207
|
if (hasSyntacticModifier(node, 31 /* ParameterPropertyModifier */)) {
|
80208
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
80209
|
+
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
80210
|
+
}
|
80168
80211
|
if (!(func.kind === 176 /* Constructor */ && nodeIsPresent(func.body))) {
|
80169
80212
|
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
80170
80213
|
}
|
@@ -84869,6 +84912,9 @@ function createTypeChecker(host) {
|
|
84869
84912
|
checkCollisionsForDeclarationName(node, node.name);
|
84870
84913
|
checkExportsOnMergedDeclarations(node);
|
84871
84914
|
node.members.forEach(checkEnumMember);
|
84915
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
84916
|
+
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
84917
|
+
}
|
84872
84918
|
computeEnumMemberValues(node);
|
84873
84919
|
const enumSymbol = getSymbolOfDeclaration(node);
|
84874
84920
|
const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);
|
@@ -84970,6 +85016,9 @@ function createTypeChecker(host) {
|
|
84970
85016
|
checkExportsOnMergedDeclarations(node);
|
84971
85017
|
const symbol = getSymbolOfDeclaration(node);
|
84972
85018
|
if (symbol.flags & 512 /* ValueModule */ && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) {
|
85019
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
85020
|
+
error(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
85021
|
+
}
|
84973
85022
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
84974
85023
|
error(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
|
84975
85024
|
}
|
@@ -85289,6 +85338,9 @@ function createTypeChecker(host) {
|
|
85289
85338
|
isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
|
85290
85339
|
);
|
85291
85340
|
}
|
85341
|
+
if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
|
85342
|
+
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
|
85343
|
+
}
|
85292
85344
|
if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
|
85293
85345
|
return grammarErrorOnNode(
|
85294
85346
|
node,
|
@@ -85354,7 +85406,11 @@ function createTypeChecker(host) {
|
|
85354
85406
|
return;
|
85355
85407
|
}
|
85356
85408
|
checkGrammarModifiers(node);
|
85357
|
-
|
85409
|
+
const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
|
85410
|
+
if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
|
85411
|
+
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
85412
|
+
}
|
85413
|
+
if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
|
85358
85414
|
checkImportBinding(node);
|
85359
85415
|
markLinkedReferences(node, 6 /* ExportImportEquals */);
|
85360
85416
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
@@ -121255,11 +121311,13 @@ function createCreateProgramOptions(rootNames, options, host, oldProgram, config
|
|
121255
121311
|
typeScriptVersion: typeScriptVersion2
|
121256
121312
|
};
|
121257
121313
|
}
|
121258
|
-
function createProgram(
|
121314
|
+
function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
121259
121315
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
121260
|
-
|
121261
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2 } =
|
121262
|
-
let { oldProgram } =
|
121316
|
+
let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions;
|
121317
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2, host: createProgramOptionsHost } = _createProgramOptions;
|
121318
|
+
let { oldProgram } = _createProgramOptions;
|
121319
|
+
_createProgramOptions = void 0;
|
121320
|
+
_rootNamesOrOptions = void 0;
|
121263
121321
|
for (const option of commandLineOptionOfCustomType) {
|
121264
121322
|
if (hasProperty(options, option.name)) {
|
121265
121323
|
if (typeof options[option.name] === "string") {
|
@@ -121299,7 +121357,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
121299
121357
|
true
|
121300
121358
|
);
|
121301
121359
|
mark("beforeProgram");
|
121302
|
-
const host =
|
121360
|
+
const host = createProgramOptionsHost || createCompilerHost(options);
|
121303
121361
|
const configParsingHost = parseConfigHostFromCompilerHostLike(host);
|
121304
121362
|
let skipDefaultLib = options.noLib;
|
121305
121363
|
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
@@ -123240,6 +123298,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
123240
123298
|
var _a2, _b2, _c2, _d2, _e2;
|
123241
123299
|
const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName);
|
123242
123300
|
if (existing) return existing;
|
123301
|
+
if (options.libReplacement === false) {
|
123302
|
+
const result2 = {
|
123303
|
+
resolution: {
|
123304
|
+
resolvedModule: void 0
|
123305
|
+
},
|
123306
|
+
actual: combinePaths(defaultLibraryPath, libFileName)
|
123307
|
+
};
|
123308
|
+
(resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2);
|
123309
|
+
return result2;
|
123310
|
+
}
|
123243
123311
|
if (structureIsReused !== 0 /* Not */ && oldProgram && !hasInvalidatedLibResolutions(libFileName)) {
|
123244
123312
|
const oldResolution = (_a2 = oldProgram.resolvedLibReferences) == null ? void 0 : _a2.get(libFileName);
|
123245
123313
|
if (oldResolution) {
|