[dynamic-import] Implementing import() syntax (#163)
This commit is contained in:
committed by
Henry Zhu
parent
4c445fd5f8
commit
c63c1bc728
@@ -98,6 +98,8 @@ pp.parseStatement = function (declaration, topLevel) {
|
||||
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.options.allowImportExportEverywhere) {
|
||||
if (!topLevel) {
|
||||
this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
|
||||
|
||||
Reference in New Issue
Block a user