mirror of
https://github.com/github/codeql.git
synced 2026-01-05 18:50:23 +01:00
JS: Drive-by allow trailing commas in dynamic imports
This commit is contained in:
@@ -439,7 +439,10 @@ public class ESNextParser extends JSXParser {
|
||||
Expression source = parseMaybeAssign(false, null, null);
|
||||
Expression attributes = null;
|
||||
if (this.eat(TokenType.comma)) {
|
||||
attributes = this.parseMaybeAssign(false, null, null);
|
||||
if (this.type != TokenType.parenR) { // Skip if the comma was a trailing comma
|
||||
attributes = this.parseMaybeAssign(false, null, null);
|
||||
this.eat(TokenType.comma); // Allow trailing comma
|
||||
}
|
||||
}
|
||||
this.expect(TokenType.parenR);
|
||||
DynamicImport di = this.finishNode(new DynamicImport(new SourceLocation(startLoc), source, attributes));
|
||||
|
||||
Reference in New Issue
Block a user