Skip to content

Commit

Permalink
❌ Enable import.meta by default in @babel/parser (babel#11364)
Browse files Browse the repository at this point in the history
* move files, remove hasPlugin() & expectPlugin()
  • Loading branch information
kik-o committed Apr 11, 2020
1 parent 070ec20 commit 69b0fd0
Show file tree
Hide file tree
Showing 28 changed files with 12 additions and 90 deletions.
4 changes: 0 additions & 4 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -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,
Expand All @@ -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");
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -2,7 +2,6 @@
"type": "File",
"start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"errors": [
"SyntaxError: Dynamic imports require a parameter: import('a.js') (2:9)",
"SyntaxError: The only valid meta property for import is import.meta (2:16)"
],
"program": {
Expand Down
@@ -1,4 +1,3 @@
{
"plugins": ["importMeta"],
"sourceType": "script"
}
@@ -0,0 +1,3 @@
{
"sourceType": "module"
}
@@ -0,0 +1,3 @@
{
"sourceType": "module"
}
@@ -0,0 +1,3 @@
{
"sourceType": "module"
}
@@ -0,0 +1,3 @@
{
"sourceType": "module"
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 69b0fd0

Please sign in to comment.