File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -24641,24 +24641,24 @@ namespace ts {
24641
24641
}
24642
24642
24643
24643
function checkGrammarImportCallExpression(node: ImportCall): boolean {
24644
- const arguments = node.arguments;
24645
- if (arguments.length !== 1) {
24646
- return grammarErrorOnNode(node, Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);
24644
+ if (modulekind === ModuleKind.ES2015) {
24645
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules);
24647
24646
}
24648
24647
24649
24648
if (node.typeArguments) {
24650
24649
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_have_type_arguments);
24651
24650
}
24652
24651
24652
+ const arguments = node.arguments;
24653
+ if (arguments.length !== 1) {
24654
+ return grammarErrorOnNode(node, Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);
24655
+ }
24656
+
24653
24657
// see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import.
24654
24658
// parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import.
24655
24659
if (isSpreadExpression(arguments[0])) {
24656
24660
return grammarErrorOnNode(arguments[0], Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);
24657
24661
}
24658
-
24659
- if (modulekind === ModuleKind.ES2015) {
24660
- grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules);
24661
- }
24662
24662
}
24663
24663
}
24664
24664
You can’t perform that action at this time.
0 commit comments