Skip to content

Commit 76d4db2

Browse files
committed
changes based on review
1 parent 807664e commit 76d4db2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

javascript/extractor/src/com/semmle/jcorn/ESNextParser.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ protected Expression parseExprAtom(DestructuringErrors refDestructuringErrors) {
240240
if (this.type == TokenType._import) {
241241
Position startLoc = this.startLoc;
242242
this.next();
243-
if (this.type == TokenType.dot) {
243+
if (this.eat(TokenType.dot)) {
244244
return parseImportMeta(startLoc);
245245
}
246246
this.expect(TokenType.parenL);
@@ -417,17 +417,16 @@ protected Statement parseImport(Position startLoc) {
417417
}
418418

419419
/**
420-
* Parses an import.meta expression, assuming that the initial "import" has been consumed.
420+
* Parses an import.meta expression, assuming that the initial "import" and "." has been consumed.
421421
*/
422422
private MetaProperty parseImportMeta(Position loc) {
423-
Identifier meta = new Identifier(new SourceLocation(loc), "import");
424-
this.next();
423+
Identifier importIdentifier = new Identifier(new SourceLocation(loc), "import");
425424
Position propertyLoc = this.startLoc;
426425
Identifier property = this.parseIdent(true);
427426
if (!property.getName().equals("meta")) {
428427
this.unexpected(propertyLoc);
429428
}
430-
return this.finishNode(new MetaProperty(new SourceLocation(loc), meta, property));
429+
return this.finishNode(new MetaProperty(new SourceLocation(loc), importIdentifier, property));
431430
}
432431

433432
/**

0 commit comments

Comments
 (0)