typescript 4.6.0-dev.20211208 → 4.6.0-dev.20211212
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 +104 -32
- package/lib/tsserver.js +112 -32
- package/lib/tsserverlibrary.js +112 -32
- package/lib/typescript.js +112 -32
- package/lib/typescriptServices.js +112 -32
- package/lib/typingsInstaller.js +109 -32
- package/package.json +2 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211212";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -19678,7 +19678,7 @@ var ts;
|
|
|
19678
19678
|
}
|
|
19679
19679
|
function createAssertClause(elements, multiLine) {
|
|
19680
19680
|
var node = createBaseNode(292);
|
|
19681
|
-
node.elements = elements;
|
|
19681
|
+
node.elements = createNodeArray(elements);
|
|
19682
19682
|
node.multiLine = multiLine;
|
|
19683
19683
|
node.transformFlags |= 4;
|
|
19684
19684
|
return node;
|
|
@@ -44584,7 +44584,24 @@ var ts;
|
|
|
44584
44584
|
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
|
|
44585
44585
|
}
|
|
44586
44586
|
var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
|
|
44587
|
+
var spreadableProperties = [];
|
|
44588
|
+
var unspreadableToRestKeys = [];
|
|
44589
|
+
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
|
|
44590
|
+
var prop = _a[_i];
|
|
44591
|
+
var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576);
|
|
44592
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
|
|
44593
|
+
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44594
|
+
&& isSpreadableProperty(prop)) {
|
|
44595
|
+
spreadableProperties.push(prop);
|
|
44596
|
+
}
|
|
44597
|
+
else {
|
|
44598
|
+
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
44599
|
+
}
|
|
44600
|
+
}
|
|
44587
44601
|
if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
|
|
44602
|
+
if (unspreadableToRestKeys.length) {
|
|
44603
|
+
omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
|
|
44604
|
+
}
|
|
44588
44605
|
if (omitKeyType.flags & 131072) {
|
|
44589
44606
|
return source;
|
|
44590
44607
|
}
|
|
@@ -44595,13 +44612,9 @@ var ts;
|
|
|
44595
44612
|
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
44596
44613
|
}
|
|
44597
44614
|
var members = ts.createSymbolTable();
|
|
44598
|
-
for (var
|
|
44599
|
-
var prop =
|
|
44600
|
-
|
|
44601
|
-
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44602
|
-
&& isSpreadableProperty(prop)) {
|
|
44603
|
-
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44604
|
-
}
|
|
44615
|
+
for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
|
|
44616
|
+
var prop = spreadableProperties_1[_b];
|
|
44617
|
+
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44605
44618
|
}
|
|
44606
44619
|
var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
|
|
44607
44620
|
result.objectFlags |= 8388608;
|
|
@@ -62133,7 +62146,7 @@ var ts;
|
|
|
62133
62146
|
typeArguments.pop();
|
|
62134
62147
|
}
|
|
62135
62148
|
while (typeArguments.length < typeParameters.length) {
|
|
62136
|
-
typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62149
|
+
typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62137
62150
|
}
|
|
62138
62151
|
return typeArguments;
|
|
62139
62152
|
}
|
|
@@ -62679,8 +62692,7 @@ var ts;
|
|
|
62679
62692
|
}
|
|
62680
62693
|
function checkCallExpression(node, checkMode) {
|
|
62681
62694
|
var _a;
|
|
62682
|
-
|
|
62683
|
-
checkGrammarArguments(node.arguments);
|
|
62695
|
+
checkGrammarTypeArguments(node, node.typeArguments);
|
|
62684
62696
|
var signature = getResolvedSignature(node, undefined, checkMode);
|
|
62685
62697
|
if (signature === resolvingSignature) {
|
|
62686
62698
|
return nonInferrableType;
|
|
@@ -62777,8 +62789,7 @@ var ts;
|
|
|
62777
62789
|
return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
|
|
62778
62790
|
}
|
|
62779
62791
|
function checkImportCallExpression(node) {
|
|
62780
|
-
|
|
62781
|
-
checkGrammarImportCallExpression(node);
|
|
62792
|
+
checkGrammarImportCallExpression(node);
|
|
62782
62793
|
if (node.arguments.length === 0) {
|
|
62783
62794
|
return createPromiseReturnType(node, anyType);
|
|
62784
62795
|
}
|
|
@@ -68828,7 +68839,7 @@ var ts;
|
|
|
68828
68839
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
68829
68840
|
var prop = properties_4[_a];
|
|
68830
68841
|
var existing = seen.get(prop.escapedName);
|
|
68831
|
-
if (existing &&
|
|
68842
|
+
if (existing && prop.parent === existing.parent) {
|
|
68832
68843
|
seen.delete(prop.escapedName);
|
|
68833
68844
|
}
|
|
68834
68845
|
}
|
|
@@ -72061,20 +72072,6 @@ var ts;
|
|
|
72061
72072
|
}
|
|
72062
72073
|
return false;
|
|
72063
72074
|
}
|
|
72064
|
-
function checkGrammarForOmittedArgument(args) {
|
|
72065
|
-
if (args) {
|
|
72066
|
-
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
|
|
72067
|
-
var arg = args_4[_i];
|
|
72068
|
-
if (arg.kind === 226) {
|
|
72069
|
-
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
|
|
72070
|
-
}
|
|
72071
|
-
}
|
|
72072
|
-
}
|
|
72073
|
-
return false;
|
|
72074
|
-
}
|
|
72075
|
-
function checkGrammarArguments(args) {
|
|
72076
|
-
return checkGrammarForOmittedArgument(args);
|
|
72077
|
-
}
|
|
72078
72075
|
function checkGrammarHeritageClause(node) {
|
|
72079
72076
|
var types = node.types;
|
|
72080
72077
|
if (checkGrammarForDisallowedTrailingComma(types)) {
|
|
@@ -84645,7 +84642,7 @@ var ts;
|
|
|
84645
84642
|
if (ts.isIdentifier(node.expression)) {
|
|
84646
84643
|
var expression = substituteExpressionIdentifier(node.expression);
|
|
84647
84644
|
noSubstitution[ts.getNodeId(expression)] = true;
|
|
84648
|
-
if (!ts.isIdentifier(expression)) {
|
|
84645
|
+
if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
|
|
84649
84646
|
return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
|
|
84650
84647
|
}
|
|
84651
84648
|
}
|
|
@@ -84655,7 +84652,7 @@ var ts;
|
|
|
84655
84652
|
if (ts.isIdentifier(node.tag)) {
|
|
84656
84653
|
var tag = substituteExpressionIdentifier(node.tag);
|
|
84657
84654
|
noSubstitution[ts.getNodeId(tag)] = true;
|
|
84658
|
-
if (!ts.isIdentifier(tag)) {
|
|
84655
|
+
if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
|
|
84659
84656
|
return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
|
|
84660
84657
|
}
|
|
84661
84658
|
}
|
|
@@ -93750,6 +93747,80 @@ var ts;
|
|
|
93750
93747
|
ts.Diagnostics.A_label_is_not_allowed_here.code,
|
|
93751
93748
|
ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
|
|
93752
93749
|
ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
|
|
93750
|
+
ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
|
|
93751
|
+
ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
|
|
93752
|
+
ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
|
|
93753
|
+
ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
|
|
93754
|
+
ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
|
|
93755
|
+
ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
|
|
93756
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93757
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93758
|
+
ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
|
|
93759
|
+
ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
|
|
93760
|
+
ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
|
|
93761
|
+
ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
|
|
93762
|
+
ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
|
|
93763
|
+
ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
|
|
93764
|
+
ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
|
|
93765
|
+
ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
|
|
93766
|
+
ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
|
|
93767
|
+
ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
|
|
93768
|
+
ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
|
|
93769
|
+
ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
|
|
93770
|
+
ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
|
|
93771
|
+
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
93772
|
+
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
93773
|
+
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
93774
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
|
|
93775
|
+
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
93776
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
|
|
93777
|
+
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
93778
|
+
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
93779
|
+
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
93780
|
+
ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
|
|
93781
|
+
ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
|
|
93782
|
+
ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
|
|
93783
|
+
ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
|
|
93784
|
+
ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
|
|
93785
|
+
ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
93786
|
+
ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
|
|
93787
|
+
ts.Diagnostics.Duplicate_label_0.code,
|
|
93788
|
+
ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
|
|
93789
|
+
ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
93790
|
+
ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
93791
|
+
ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
93792
|
+
ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
|
|
93793
|
+
ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
|
|
93794
|
+
ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
|
|
93795
|
+
ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
|
|
93796
|
+
ts.Diagnostics.Modifiers_cannot_appear_here.code,
|
|
93797
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
|
|
93798
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
|
|
93799
|
+
ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
|
|
93800
|
+
ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
|
|
93801
|
+
ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
|
|
93802
|
+
ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
|
|
93803
|
+
ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
|
|
93804
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
|
|
93805
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
|
|
93806
|
+
ts.Diagnostics.Trailing_comma_not_allowed.code,
|
|
93807
|
+
ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
|
|
93808
|
+
ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
|
|
93809
|
+
ts.Diagnostics._0_expected.code,
|
|
93810
|
+
ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
|
|
93811
|
+
ts.Diagnostics._0_list_cannot_be_empty.code,
|
|
93812
|
+
ts.Diagnostics._0_modifier_already_seen.code,
|
|
93813
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
|
|
93814
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
|
|
93815
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
|
|
93816
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
|
|
93817
|
+
ts.Diagnostics._0_modifier_cannot_be_used_here.code,
|
|
93818
|
+
ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
|
|
93819
|
+
ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
|
|
93820
|
+
ts.Diagnostics.const_declarations_must_be_initialized.code,
|
|
93821
|
+
ts.Diagnostics.extends_clause_already_seen.code,
|
|
93822
|
+
ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
|
|
93823
|
+
ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
|
|
93753
93824
|
]);
|
|
93754
93825
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
93755
93826
|
if (!program)
|
|
@@ -94605,9 +94676,10 @@ var ts;
|
|
|
94605
94676
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
|
|
94606
94677
|
|| sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
|
|
94607
94678
|
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
|
94608
|
-
var checkDiagnostics = includeBindAndCheckDiagnostics
|
|
94679
|
+
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
|
94609
94680
|
if (isPlainJs) {
|
|
94610
94681
|
bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94682
|
+
checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94611
94683
|
}
|
|
94612
94684
|
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|
|
94613
94685
|
});
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211212";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -24438,7 +24438,7 @@ var ts;
|
|
|
24438
24438
|
// @api
|
|
24439
24439
|
function createAssertClause(elements, multiLine) {
|
|
24440
24440
|
var node = createBaseNode(292 /* AssertClause */);
|
|
24441
|
-
node.elements = elements;
|
|
24441
|
+
node.elements = createNodeArray(elements);
|
|
24442
24442
|
node.multiLine = multiLine;
|
|
24443
24443
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
24444
24444
|
return node;
|
|
@@ -54059,7 +54059,27 @@ var ts;
|
|
|
54059
54059
|
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
|
|
54060
54060
|
}
|
|
54061
54061
|
var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
|
|
54062
|
+
var spreadableProperties = [];
|
|
54063
|
+
var unspreadableToRestKeys = [];
|
|
54064
|
+
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
|
|
54065
|
+
var prop = _a[_i];
|
|
54066
|
+
var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
|
|
54067
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
|
|
54068
|
+
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
|
|
54069
|
+
&& isSpreadableProperty(prop)) {
|
|
54070
|
+
spreadableProperties.push(prop);
|
|
54071
|
+
}
|
|
54072
|
+
else {
|
|
54073
|
+
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
54074
|
+
}
|
|
54075
|
+
}
|
|
54062
54076
|
if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
|
|
54077
|
+
if (unspreadableToRestKeys.length) {
|
|
54078
|
+
// If the type we're spreading from has properties that cannot
|
|
54079
|
+
// be spread into the rest type (e.g. getters, methods), ensure
|
|
54080
|
+
// they are explicitly omitted, as they would in the non-generic case.
|
|
54081
|
+
omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
|
|
54082
|
+
}
|
|
54063
54083
|
if (omitKeyType.flags & 131072 /* Never */) {
|
|
54064
54084
|
return source;
|
|
54065
54085
|
}
|
|
@@ -54070,13 +54090,9 @@ var ts;
|
|
|
54070
54090
|
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
54071
54091
|
}
|
|
54072
54092
|
var members = ts.createSymbolTable();
|
|
54073
|
-
for (var
|
|
54074
|
-
var prop =
|
|
54075
|
-
|
|
54076
|
-
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
|
|
54077
|
-
&& isSpreadableProperty(prop)) {
|
|
54078
|
-
members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
|
|
54079
|
-
}
|
|
54093
|
+
for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
|
|
54094
|
+
var prop = spreadableProperties_1[_b];
|
|
54095
|
+
members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
|
|
54080
54096
|
}
|
|
54081
54097
|
var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
|
|
54082
54098
|
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
@@ -74343,7 +74359,7 @@ var ts;
|
|
|
74343
74359
|
typeArguments.pop();
|
|
74344
74360
|
}
|
|
74345
74361
|
while (typeArguments.length < typeParameters.length) {
|
|
74346
|
-
typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
74362
|
+
typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
74347
74363
|
}
|
|
74348
74364
|
return typeArguments;
|
|
74349
74365
|
}
|
|
@@ -74999,8 +75015,7 @@ var ts;
|
|
|
74999
75015
|
*/
|
|
75000
75016
|
function checkCallExpression(node, checkMode) {
|
|
75001
75017
|
var _a;
|
|
75002
|
-
|
|
75003
|
-
checkGrammarArguments(node.arguments);
|
|
75018
|
+
checkGrammarTypeArguments(node, node.typeArguments);
|
|
75004
75019
|
var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
|
|
75005
75020
|
if (signature === resolvingSignature) {
|
|
75006
75021
|
// CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
|
|
@@ -75105,8 +75120,7 @@ var ts;
|
|
|
75105
75120
|
}
|
|
75106
75121
|
function checkImportCallExpression(node) {
|
|
75107
75122
|
// Check grammar of dynamic import
|
|
75108
|
-
|
|
75109
|
-
checkGrammarImportCallExpression(node);
|
|
75123
|
+
checkGrammarImportCallExpression(node);
|
|
75110
75124
|
if (node.arguments.length === 0) {
|
|
75111
75125
|
return createPromiseReturnType(node, anyType);
|
|
75112
75126
|
}
|
|
@@ -82214,7 +82228,7 @@ var ts;
|
|
|
82214
82228
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
82215
82229
|
var prop = properties_4[_a];
|
|
82216
82230
|
var existing = seen.get(prop.escapedName);
|
|
82217
|
-
if (existing &&
|
|
82231
|
+
if (existing && prop.parent === existing.parent) {
|
|
82218
82232
|
seen.delete(prop.escapedName);
|
|
82219
82233
|
}
|
|
82220
82234
|
}
|
|
@@ -85767,20 +85781,6 @@ var ts;
|
|
|
85767
85781
|
}
|
|
85768
85782
|
return false;
|
|
85769
85783
|
}
|
|
85770
|
-
function checkGrammarForOmittedArgument(args) {
|
|
85771
|
-
if (args) {
|
|
85772
|
-
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
|
|
85773
|
-
var arg = args_4[_i];
|
|
85774
|
-
if (arg.kind === 226 /* OmittedExpression */) {
|
|
85775
|
-
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
|
|
85776
|
-
}
|
|
85777
|
-
}
|
|
85778
|
-
}
|
|
85779
|
-
return false;
|
|
85780
|
-
}
|
|
85781
|
-
function checkGrammarArguments(args) {
|
|
85782
|
-
return checkGrammarForOmittedArgument(args);
|
|
85783
|
-
}
|
|
85784
85784
|
function checkGrammarHeritageClause(node) {
|
|
85785
85785
|
var types = node.types;
|
|
85786
85786
|
if (checkGrammarForDisallowedTrailingComma(types)) {
|
|
@@ -103028,7 +103028,7 @@ var ts;
|
|
|
103028
103028
|
if (ts.isIdentifier(node.expression)) {
|
|
103029
103029
|
var expression = substituteExpressionIdentifier(node.expression);
|
|
103030
103030
|
noSubstitution[ts.getNodeId(expression)] = true;
|
|
103031
|
-
if (!ts.isIdentifier(expression)) {
|
|
103031
|
+
if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
|
|
103032
103032
|
return ts.addEmitFlags(factory.updateCallExpression(node, expression,
|
|
103033
103033
|
/*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
|
|
103034
103034
|
}
|
|
@@ -103039,7 +103039,7 @@ var ts;
|
|
|
103039
103039
|
if (ts.isIdentifier(node.tag)) {
|
|
103040
103040
|
var tag = substituteExpressionIdentifier(node.tag);
|
|
103041
103041
|
noSubstitution[ts.getNodeId(tag)] = true;
|
|
103042
|
-
if (!ts.isIdentifier(tag)) {
|
|
103042
|
+
if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
|
|
103043
103043
|
return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
|
|
103044
103044
|
/*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
|
|
103045
103045
|
}
|
|
@@ -113665,6 +113665,7 @@ var ts;
|
|
|
113665
113665
|
ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
|
|
113666
113666
|
/** @internal */
|
|
113667
113667
|
ts.plainJSErrors = new ts.Set([
|
|
113668
|
+
// binder errors
|
|
113668
113669
|
ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
|
|
113669
113670
|
ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
|
|
113670
113671
|
ts.Diagnostics.Another_export_default_is_here.code,
|
|
@@ -113680,6 +113681,81 @@ var ts;
|
|
|
113680
113681
|
ts.Diagnostics.A_label_is_not_allowed_here.code,
|
|
113681
113682
|
ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
|
|
113682
113683
|
ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
|
|
113684
|
+
// grammar errors
|
|
113685
|
+
ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
|
|
113686
|
+
ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
|
|
113687
|
+
ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
|
|
113688
|
+
ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
|
|
113689
|
+
ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
|
|
113690
|
+
ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
|
|
113691
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
113692
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
113693
|
+
ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
|
|
113694
|
+
ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
|
|
113695
|
+
ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
|
|
113696
|
+
ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
|
|
113697
|
+
ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
|
|
113698
|
+
ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
|
|
113699
|
+
ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
|
|
113700
|
+
ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
|
|
113701
|
+
ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
|
|
113702
|
+
ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
|
|
113703
|
+
ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
|
|
113704
|
+
ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
|
|
113705
|
+
ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
|
|
113706
|
+
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
113707
|
+
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
113708
|
+
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
113709
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
|
|
113710
|
+
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
113711
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
|
|
113712
|
+
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
113713
|
+
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
113714
|
+
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
113715
|
+
ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
|
|
113716
|
+
ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
|
|
113717
|
+
ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
|
|
113718
|
+
ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
|
|
113719
|
+
ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
|
|
113720
|
+
ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
113721
|
+
ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
|
|
113722
|
+
ts.Diagnostics.Duplicate_label_0.code,
|
|
113723
|
+
ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
|
|
113724
|
+
ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
113725
|
+
ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
113726
|
+
ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
113727
|
+
ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
|
|
113728
|
+
ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
|
|
113729
|
+
ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
|
|
113730
|
+
ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
|
|
113731
|
+
ts.Diagnostics.Modifiers_cannot_appear_here.code,
|
|
113732
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
|
|
113733
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
|
|
113734
|
+
ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
|
|
113735
|
+
ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
|
|
113736
|
+
ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
|
|
113737
|
+
ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
|
|
113738
|
+
ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
|
|
113739
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
|
|
113740
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
|
|
113741
|
+
ts.Diagnostics.Trailing_comma_not_allowed.code,
|
|
113742
|
+
ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
|
|
113743
|
+
ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
|
|
113744
|
+
ts.Diagnostics._0_expected.code,
|
|
113745
|
+
ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
|
|
113746
|
+
ts.Diagnostics._0_list_cannot_be_empty.code,
|
|
113747
|
+
ts.Diagnostics._0_modifier_already_seen.code,
|
|
113748
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
|
|
113749
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
|
|
113750
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
|
|
113751
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
|
|
113752
|
+
ts.Diagnostics._0_modifier_cannot_be_used_here.code,
|
|
113753
|
+
ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
|
|
113754
|
+
ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
|
|
113755
|
+
ts.Diagnostics.const_declarations_must_be_initialized.code,
|
|
113756
|
+
ts.Diagnostics.extends_clause_already_seen.code,
|
|
113757
|
+
ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
|
|
113758
|
+
ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
|
|
113683
113759
|
]);
|
|
113684
113760
|
/**
|
|
113685
113761
|
* Determine if source file needs to be re-created even if its text hasn't changed
|
|
@@ -114709,9 +114785,10 @@ var ts;
|
|
|
114709
114785
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
|
|
114710
114786
|
|| sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
|
|
114711
114787
|
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
|
114712
|
-
var checkDiagnostics = includeBindAndCheckDiagnostics
|
|
114788
|
+
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
|
114713
114789
|
if (isPlainJs) {
|
|
114714
114790
|
bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
114791
|
+
checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
114715
114792
|
}
|
|
114716
114793
|
// skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
|
|
114717
114794
|
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|
|
@@ -127399,6 +127476,9 @@ var ts;
|
|
|
127399
127476
|
}
|
|
127400
127477
|
return;
|
|
127401
127478
|
}
|
|
127479
|
+
if (ts.isConstTypeReference(token.parent)) {
|
|
127480
|
+
return 3 /* keyword */;
|
|
127481
|
+
}
|
|
127402
127482
|
}
|
|
127403
127483
|
return 2 /* identifier */;
|
|
127404
127484
|
}
|