typescript 5.0.0-dev.20221215 → 5.0.0-dev.20221217
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 +365 -288
- package/lib/tsserver.js +437 -320
- package/lib/tsserverlibrary.d.ts +2 -3
- package/lib/tsserverlibrary.js +438 -322
- package/lib/typescript.d.ts +2 -3
- package/lib/typescript.js +436 -321
- package/lib/typingsInstaller.js +68 -47
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
|
|
|
50
50
|
|
|
51
51
|
// src/compiler/corePublic.ts
|
|
52
52
|
var versionMajorMinor = "5.0";
|
|
53
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
53
|
+
var version = `${versionMajorMinor}.0-dev.20221217`;
|
|
54
54
|
|
|
55
55
|
// src/compiler/core.ts
|
|
56
56
|
var emptyArray = [];
|
|
@@ -3196,7 +3196,7 @@ var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => {
|
|
|
3196
3196
|
})(DiagnosticCategory || {});
|
|
3197
3197
|
var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
3198
3198
|
ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
|
|
3199
|
-
ModuleResolutionKind2[ModuleResolutionKind2["
|
|
3199
|
+
ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
|
|
3200
3200
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
3201
3201
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
3202
3202
|
ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler";
|
|
@@ -5250,6 +5250,7 @@ var Diagnostics = {
|
|
|
5250
5250
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
5251
5251
|
accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."),
|
|
5252
5252
|
An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."),
|
|
5253
|
+
_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"),
|
|
5253
5254
|
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."),
|
|
5254
5255
|
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."),
|
|
5255
5256
|
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."),
|
|
@@ -5868,7 +5869,7 @@ var Diagnostics = {
|
|
|
5868
5869
|
Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, 1 /* Error */, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."),
|
|
5869
5870
|
The_operand_of_a_delete_operator_must_be_optional: diag(2790, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."),
|
|
5870
5871
|
Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, 1 /* Error */, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),
|
|
5871
|
-
|
|
5872
|
+
Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option: diag(2792, 1 /* Error */, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),
|
|
5872
5873
|
The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, 1 /* Error */, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),
|
|
5873
5874
|
Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, 1 /* Error */, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),
|
|
5874
5875
|
The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1 /* Error */, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),
|
|
@@ -6050,7 +6051,7 @@ var Diagnostics = {
|
|
|
6050
6051
|
Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, 1 /* Error */, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),
|
|
6051
6052
|
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
|
6052
6053
|
Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
|
|
6053
|
-
|
|
6054
|
+
Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
|
|
6054
6055
|
Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, 1 /* Error */, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),
|
|
6055
6056
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
6056
6057
|
Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
|
|
@@ -6081,6 +6082,9 @@ var Diagnostics = {
|
|
|
6081
6082
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
6082
6083
|
Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
|
|
6083
6084
|
Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."),
|
|
6085
|
+
Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`),
|
|
6086
|
+
Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."),
|
|
6087
|
+
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
6084
6088
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
|
6085
6089
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
|
6086
6090
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -9257,10 +9261,10 @@ function isAssertionKey(node) {
|
|
|
9257
9261
|
return isStringLiteral(node) || isIdentifier(node);
|
|
9258
9262
|
}
|
|
9259
9263
|
function isGeneratedIdentifier(node) {
|
|
9260
|
-
return isIdentifier(node) &&
|
|
9264
|
+
return isIdentifier(node) && node.autoGenerate !== void 0;
|
|
9261
9265
|
}
|
|
9262
9266
|
function isGeneratedPrivateIdentifier(node) {
|
|
9263
|
-
return isPrivateIdentifier(node) &&
|
|
9267
|
+
return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
|
|
9264
9268
|
}
|
|
9265
9269
|
function isPrivateIdentifierClassElementDeclaration(node) {
|
|
9266
9270
|
return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
|
|
@@ -9909,7 +9913,7 @@ function tryGetTextOfPropertyName(name) {
|
|
|
9909
9913
|
switch (name.kind) {
|
|
9910
9914
|
case 79 /* Identifier */:
|
|
9911
9915
|
case 80 /* PrivateIdentifier */:
|
|
9912
|
-
return name.
|
|
9916
|
+
return name.autoGenerate ? void 0 : name.escapedText;
|
|
9913
9917
|
case 10 /* StringLiteral */:
|
|
9914
9918
|
case 8 /* NumericLiteral */:
|
|
9915
9919
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -11158,9 +11162,16 @@ function Symbol4(flags, name) {
|
|
|
11158
11162
|
this.escapedName = name;
|
|
11159
11163
|
this.declarations = void 0;
|
|
11160
11164
|
this.valueDeclaration = void 0;
|
|
11161
|
-
this.id =
|
|
11162
|
-
this.mergeId =
|
|
11165
|
+
this.id = 0;
|
|
11166
|
+
this.mergeId = 0;
|
|
11163
11167
|
this.parent = void 0;
|
|
11168
|
+
this.members = void 0;
|
|
11169
|
+
this.exports = void 0;
|
|
11170
|
+
this.exportSymbol = void 0;
|
|
11171
|
+
this.constEnumOnlyModule = void 0;
|
|
11172
|
+
this.isReferenced = void 0;
|
|
11173
|
+
this.isAssigned = void 0;
|
|
11174
|
+
this.links = void 0;
|
|
11164
11175
|
}
|
|
11165
11176
|
function Type3(checker, flags) {
|
|
11166
11177
|
this.flags = flags;
|
|
@@ -11342,7 +11353,7 @@ function getEmitModuleResolutionKind(compilerOptions) {
|
|
|
11342
11353
|
if (moduleResolution === void 0) {
|
|
11343
11354
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
11344
11355
|
case 1 /* CommonJS */:
|
|
11345
|
-
moduleResolution = 2 /*
|
|
11356
|
+
moduleResolution = 2 /* Node10 */;
|
|
11346
11357
|
break;
|
|
11347
11358
|
case 100 /* Node16 */:
|
|
11348
11359
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -13019,15 +13030,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13019
13030
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
13020
13031
|
node.originalKeywordKind = originalKeywordKind;
|
|
13021
13032
|
node.escapedText = escapedText;
|
|
13022
|
-
node.
|
|
13033
|
+
node.autoGenerate = void 0;
|
|
13034
|
+
node.typeArguments = void 0;
|
|
13035
|
+
node.hasExtendedUnicodeEscape = void 0;
|
|
13036
|
+
node.jsDoc = void 0;
|
|
13037
|
+
node.jsDocCache = void 0;
|
|
13038
|
+
node.flowNode = void 0;
|
|
13039
|
+
node.symbol = void 0;
|
|
13023
13040
|
return node;
|
|
13024
13041
|
}
|
|
13025
13042
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
13026
13043
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
|
|
13027
|
-
node.
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13044
|
+
node.autoGenerate = {
|
|
13045
|
+
flags: autoGenerateFlags,
|
|
13046
|
+
id: nextAutoGenerateId,
|
|
13047
|
+
prefix,
|
|
13048
|
+
suffix
|
|
13049
|
+
};
|
|
13031
13050
|
nextAutoGenerateId++;
|
|
13032
13051
|
return node;
|
|
13033
13052
|
}
|
|
@@ -13041,10 +13060,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13041
13060
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
|
|
13042
13061
|
node.typeArguments = asNodeArray(typeArguments);
|
|
13043
13062
|
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
13044
|
-
node.jsDoc = void 0;
|
|
13045
|
-
node.jsDocCache = void 0;
|
|
13046
|
-
node.flowNode = void 0;
|
|
13047
|
-
node.symbol = void 0;
|
|
13048
13063
|
if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
13049
13064
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
13050
13065
|
}
|
|
@@ -13089,7 +13104,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13089
13104
|
function createBasePrivateIdentifier(escapedText) {
|
|
13090
13105
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
13091
13106
|
node.escapedText = escapedText;
|
|
13092
|
-
node.
|
|
13107
|
+
node.autoGenerate = void 0;
|
|
13093
13108
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
13094
13109
|
return node;
|
|
13095
13110
|
}
|
|
@@ -13100,10 +13115,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13100
13115
|
}
|
|
13101
13116
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
13102
13117
|
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
13103
|
-
node.
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13118
|
+
node.autoGenerate = {
|
|
13119
|
+
flags: autoGenerateFlags,
|
|
13120
|
+
id: nextAutoGenerateId,
|
|
13121
|
+
prefix,
|
|
13122
|
+
suffix
|
|
13123
|
+
};
|
|
13107
13124
|
nextAutoGenerateId++;
|
|
13108
13125
|
return node;
|
|
13109
13126
|
}
|
|
@@ -15896,10 +15913,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15896
15913
|
function cloneGeneratedIdentifier(node) {
|
|
15897
15914
|
const clone2 = createBaseIdentifier(node.escapedText, void 0);
|
|
15898
15915
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
15899
|
-
clone2.
|
|
15900
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
15901
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
15902
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
15916
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
15903
15917
|
clone2.transformFlags = node.transformFlags;
|
|
15904
15918
|
setOriginalNode(clone2, node);
|
|
15905
15919
|
return clone2;
|
|
@@ -15920,10 +15934,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15920
15934
|
function cloneGeneratedPrivateIdentifier(node) {
|
|
15921
15935
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
15922
15936
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
15923
|
-
clone2.
|
|
15924
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
15925
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
15926
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
15937
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
15927
15938
|
clone2.transformFlags = node.transformFlags;
|
|
15928
15939
|
setOriginalNode(clone2, node);
|
|
15929
15940
|
return clone2;
|
|
@@ -17939,6 +17950,7 @@ var forEachChildTable = {
|
|
|
17939
17950
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17940
17951
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17941
17952
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17953
|
+
[342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17942
17954
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
17943
17955
|
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
|
|
17944
17956
|
},
|
|
@@ -19009,7 +19021,7 @@ var Parser;
|
|
|
19009
19021
|
case ParsingContext.ArrayBindingElements:
|
|
19010
19022
|
return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern();
|
|
19011
19023
|
case ParsingContext.TypeParameters:
|
|
19012
|
-
return token() === 101 /* InKeyword */ || isIdentifier2();
|
|
19024
|
+
return token() === 101 /* InKeyword */ || token() === 85 /* ConstKeyword */ || isIdentifier2();
|
|
19013
19025
|
case ParsingContext.ArrayLiteralMembers:
|
|
19014
19026
|
switch (token()) {
|
|
19015
19027
|
case 27 /* CommaToken */:
|
|
@@ -19714,7 +19726,7 @@ var Parser;
|
|
|
19714
19726
|
}
|
|
19715
19727
|
function parseTypeParameter() {
|
|
19716
19728
|
const pos = getNodePos();
|
|
19717
|
-
const modifiers = parseModifiers();
|
|
19729
|
+
const modifiers = parseModifiers(true);
|
|
19718
19730
|
const name = parseIdentifier();
|
|
19719
19731
|
let constraint;
|
|
19720
19732
|
let expression;
|
|
@@ -20677,11 +20689,12 @@ var Parser;
|
|
|
20677
20689
|
return Tristate.False;
|
|
20678
20690
|
} else {
|
|
20679
20691
|
Debug.assert(first2 === 29 /* LessThanToken */);
|
|
20680
|
-
if (!isIdentifier2()) {
|
|
20692
|
+
if (!isIdentifier2() && token() !== 85 /* ConstKeyword */) {
|
|
20681
20693
|
return Tristate.False;
|
|
20682
20694
|
}
|
|
20683
20695
|
if (languageVariant === 1 /* JSX */) {
|
|
20684
20696
|
const isArrowFunctionInJsx = lookAhead(() => {
|
|
20697
|
+
parseOptional(85 /* ConstKeyword */);
|
|
20685
20698
|
const third = nextToken();
|
|
20686
20699
|
if (third === 94 /* ExtendsKeyword */) {
|
|
20687
20700
|
const fourth = nextToken();
|
|
@@ -22404,10 +22417,10 @@ var Parser;
|
|
|
22404
22417
|
}
|
|
22405
22418
|
return list && createNodeArray(list, pos);
|
|
22406
22419
|
}
|
|
22407
|
-
function tryParseModifier(
|
|
22420
|
+
function tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
|
|
22408
22421
|
const pos = getNodePos();
|
|
22409
22422
|
const kind = token();
|
|
22410
|
-
if (token() === 85 /* ConstKeyword */ &&
|
|
22423
|
+
if (token() === 85 /* ConstKeyword */ && permitConstAsModifier) {
|
|
22411
22424
|
if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) {
|
|
22412
22425
|
return void 0;
|
|
22413
22426
|
}
|
|
@@ -22431,10 +22444,10 @@ var Parser;
|
|
|
22431
22444
|
setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end);
|
|
22432
22445
|
return decoratorsAndModifiers;
|
|
22433
22446
|
}
|
|
22434
|
-
function parseModifiers(
|
|
22447
|
+
function parseModifiers(permitConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
22435
22448
|
const pos = getNodePos();
|
|
22436
22449
|
let list, modifier, hasSeenStatic = false;
|
|
22437
|
-
while (modifier = tryParseModifier(
|
|
22450
|
+
while (modifier = tryParseModifier(permitConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
|
|
22438
22451
|
if (modifier.kind === 124 /* StaticKeyword */)
|
|
22439
22452
|
hasSeenStatic = true;
|
|
22440
22453
|
list = append(list, modifier);
|
|
@@ -25172,12 +25185,14 @@ var commandOptionsWithoutBuild = [
|
|
|
25172
25185
|
{
|
|
25173
25186
|
name: "moduleResolution",
|
|
25174
25187
|
type: new Map(getEntries({
|
|
25175
|
-
|
|
25188
|
+
node10: 2 /* Node10 */,
|
|
25189
|
+
node: 2 /* Node10 */,
|
|
25176
25190
|
classic: 1 /* Classic */,
|
|
25177
25191
|
node16: 3 /* Node16 */,
|
|
25178
25192
|
nodenext: 99 /* NodeNext */,
|
|
25179
25193
|
bundler: 100 /* Bundler */
|
|
25180
25194
|
})),
|
|
25195
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
25181
25196
|
affectsModuleResolution: true,
|
|
25182
25197
|
paramType: Diagnostics.STRATEGY,
|
|
25183
25198
|
category: Diagnostics.Modules,
|
|
@@ -25697,6 +25712,11 @@ var commandOptionsWithoutBuild = [
|
|
|
25697
25712
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
25698
25713
|
category: Diagnostics.Language_and_Environment,
|
|
25699
25714
|
defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules
|
|
25715
|
+
},
|
|
25716
|
+
{
|
|
25717
|
+
name: "ignoreDeprecations",
|
|
25718
|
+
type: "string",
|
|
25719
|
+
defaultValueDescription: void 0
|
|
25700
25720
|
}
|
|
25701
25721
|
];
|
|
25702
25722
|
var optionDeclarations = [
|
|
@@ -25808,8 +25828,9 @@ var defaultInitCompilerOptions = {
|
|
|
25808
25828
|
skipLibCheck: true
|
|
25809
25829
|
};
|
|
25810
25830
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
25811
|
-
const namesOfType = arrayFrom(opt.type.keys())
|
|
25812
|
-
|
|
25831
|
+
const namesOfType = arrayFrom(opt.type.keys());
|
|
25832
|
+
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
25833
|
+
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
25813
25834
|
}
|
|
25814
25835
|
function getOptionName(option) {
|
|
25815
25836
|
return option.name;
|
|
@@ -26447,7 +26468,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
26447
26468
|
if (moduleResolution === void 0) {
|
|
26448
26469
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
26449
26470
|
case 1 /* CommonJS */:
|
|
26450
|
-
moduleResolution = 2 /*
|
|
26471
|
+
moduleResolution = 2 /* Node10 */;
|
|
26451
26472
|
break;
|
|
26452
26473
|
case 100 /* Node16 */:
|
|
26453
26474
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -26475,7 +26496,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
26475
26496
|
case 99 /* NodeNext */:
|
|
26476
26497
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
26477
26498
|
break;
|
|
26478
|
-
case 2 /*
|
|
26499
|
+
case 2 /* Node10 */:
|
|
26479
26500
|
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
26480
26501
|
break;
|
|
26481
26502
|
case 1 /* Classic */:
|
|
@@ -26664,7 +26685,7 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
26664
26685
|
0 /* None */,
|
|
26665
26686
|
moduleName,
|
|
26666
26687
|
initialDir,
|
|
26667
|
-
{ moduleResolution: 2 /*
|
|
26688
|
+
{ moduleResolution: 2 /* Node10 */, allowJs: true },
|
|
26668
26689
|
host,
|
|
26669
26690
|
void 0,
|
|
26670
26691
|
2 /* JavaScript */,
|
|
@@ -26717,7 +26738,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
26717
26738
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
26718
26739
|
}
|
|
26719
26740
|
let result;
|
|
26720
|
-
if (getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
26741
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
|
|
26721
26742
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
26722
26743
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
26723
26744
|
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
@@ -32966,7 +32987,7 @@ var nullLog = {
|
|
|
32966
32987
|
};
|
|
32967
32988
|
function typingToFileName(cachePath, packageName, installTypingHost, log2) {
|
|
32968
32989
|
try {
|
|
32969
|
-
const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: 2 /*
|
|
32990
|
+
const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: 2 /* Node10 */ }, installTypingHost);
|
|
32970
32991
|
return result.resolvedModule && result.resolvedModule.resolvedFileName;
|
|
32971
32992
|
} catch (e) {
|
|
32972
32993
|
if (log2.isEnabled()) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-dev.
|
|
5
|
+
"version": "5.0.0-dev.20221217",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|