Add plugin for import.meta proposal (#544)
* Add plugin for import.meta proposal Fixes https://github.com/babel/babylon/issues/539 * Tests for assignment/mutation of import.meta * Use correct identifier in failure message * Simpler & more consistent script errors for import.meta
This commit is contained in:
committed by
Henry Zhu
parent
2f5d146d54
commit
d4e842d4eb
@@ -106,7 +106,8 @@ export default class StatementParser extends ExpressionParser {
|
||||
case tt.semi: return this.parseEmptyStatement(node);
|
||||
case tt._export:
|
||||
case tt._import:
|
||||
if (this.hasPlugin("dynamicImport") && this.lookahead().type === tt.parenL) break;
|
||||
if ((this.hasPlugin("dynamicImport") && this.lookahead().type === tt.parenL) ||
|
||||
(this.hasPlugin("importMeta") && this.lookahead().type === tt.dot)) break;
|
||||
|
||||
if (!this.options.allowImportExportEverywhere) {
|
||||
if (!topLevel) {
|
||||
|
||||
Reference in New Issue
Block a user