test: add invalid-lone-import test (#10950)
* test: add lone import test * polish: raise recoverable error
This commit is contained in:
committed by
Nicolò Ribaudo
parent
a28353703f
commit
455d782ef0
@@ -919,7 +919,10 @@ export default class ExpressionParser extends LValParser {
|
||||
this.expectPlugin("dynamicImport", node.start);
|
||||
|
||||
if (!this.match(tt.parenL)) {
|
||||
this.unexpected(null, tt.parenL);
|
||||
this.raise(
|
||||
this.state.lastTokStart,
|
||||
"import can only be used in import() or import.meta",
|
||||
);
|
||||
}
|
||||
return this.finishNode(node, "Import");
|
||||
case tt._this:
|
||||
|
||||
Reference in New Issue
Block a user