mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
changes based on review
This commit is contained in:
@@ -240,7 +240,7 @@ public class ESNextParser extends JSXParser {
|
||||
if (this.type == TokenType._import) {
|
||||
Position startLoc = this.startLoc;
|
||||
this.next();
|
||||
if (this.type == TokenType.dot) {
|
||||
if (this.eat(TokenType.dot)) {
|
||||
return parseImportMeta(startLoc);
|
||||
}
|
||||
this.expect(TokenType.parenL);
|
||||
@@ -417,17 +417,16 @@ public class ESNextParser extends JSXParser {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses an import.meta expression, assuming that the initial "import" has been consumed.
|
||||
* Parses an import.meta expression, assuming that the initial "import" and "." has been consumed.
|
||||
*/
|
||||
private MetaProperty parseImportMeta(Position loc) {
|
||||
Identifier meta = new Identifier(new SourceLocation(loc), "import");
|
||||
this.next();
|
||||
Identifier importIdentifier = new Identifier(new SourceLocation(loc), "import");
|
||||
Position propertyLoc = this.startLoc;
|
||||
Identifier property = this.parseIdent(true);
|
||||
if (!property.getName().equals("meta")) {
|
||||
this.unexpected(propertyLoc);
|
||||
}
|
||||
return this.finishNode(new MetaProperty(new SourceLocation(loc), meta, property));
|
||||
return this.finishNode(new MetaProperty(new SourceLocation(loc), importIdentifier, property));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user