fix trailing comma should not allowed in dynamic import argument

This commit is contained in:
xiaofa
2019-01-24 18:16:34 +08:00
parent 2f6c65e691
commit d7601b755f
6 changed files with 36 additions and 1 deletions

View File

@@ -31178,7 +31178,7 @@ namespace ts {
if (nodeArguments.length !== 1) {
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_must_have_one_specifier_as_an_argument);
}
checkGrammarForDisallowedTrailingComma(nodeArguments);
// see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import.
// parseArgumentOrArrayLiteralElement allows spread element to be in an argument list which is not allowed as specifier in dynamic import.
if (isSpreadElement(nodeArguments[0])) {