Enable import.meta by default in @babel/parser (#11406)
This commit is contained in:
@@ -1227,8 +1227,6 @@ export default class ExpressionParser extends LValParser {
|
||||
this.expect(tt.dot);
|
||||
|
||||
if (this.isContextual("meta")) {
|
||||
this.expectPlugin("importMeta");
|
||||
|
||||
if (!this.inModule) {
|
||||
this.raiseWithData(
|
||||
id.start,
|
||||
@@ -1237,8 +1235,6 @@ export default class ExpressionParser extends LValParser {
|
||||
);
|
||||
}
|
||||
this.sawUnambiguousESM = true;
|
||||
} else if (!this.hasPlugin("importMeta")) {
|
||||
this.raise(id.start, Errors.ImportCallArityLtOne);
|
||||
}
|
||||
|
||||
return this.parseMetaProperty(node, id, "meta");
|
||||
|
||||
@@ -68,7 +68,6 @@ export const Errors = Object.freeze({
|
||||
ImportCallArgumentTrailingComma:
|
||||
"Trailing comma is disallowed inside import(...) arguments",
|
||||
ImportCallArity: "import() requires exactly one argument",
|
||||
ImportCallArityLtOne: "Dynamic imports require a parameter: import('a.js')",
|
||||
ImportCallNotNewExpression: "Cannot use new with import(...)",
|
||||
ImportCallSpreadArgument: "... is not allowed in import()",
|
||||
ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
|
||||
|
||||
Reference in New Issue
Block a user