We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d9060f commit 3af085aCopy full SHA for 3af085a
javascript/extractor/src/com/semmle/jcorn/ESNextParser.java
@@ -439,7 +439,10 @@ private DynamicImport parseDynamicImport(Position startLoc) {
439
Expression source = parseMaybeAssign(false, null, null);
440
Expression attributes = null;
441
if (this.eat(TokenType.comma)) {
442
- attributes = this.parseMaybeAssign(false, null, null);
+ if (this.type != TokenType.parenR) { // Skip if the comma was a trailing comma
443
+ attributes = this.parseMaybeAssign(false, null, null);
444
+ this.eat(TokenType.comma); // Allow trailing comma
445
+ }
446
}
447
this.expect(TokenType.parenR);
448
DynamicImport di = this.finishNode(new DynamicImport(new SourceLocation(startLoc), source, attributes));
0 commit comments