Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[parser] enable dynamic import by default #10843

Merged
merged 2 commits into from Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/babel-core/test/api.js
Expand Up @@ -760,11 +760,11 @@ describe("api", function() {
options,
function(err) {
expect(err.message).toMatch(
"Support for the experimental syntax 'dynamicImport' isn't currently enabled (1:9)",
"Support for the experimental syntax 'pipelineOperator' isn't currently enabled (1:3):",
);
expect(err.message).toMatch(
"Add @babel/plugin-syntax-dynamic-import (https://git.io/vb4Sv) to the " +
"'plugins' section of your Babel config to enable parsing.",
"Add @babel/plugin-proposal-pipeline-operator (https://git.io/vb4SU) to the " +
"'plugins' section of your Babel config to enable transformation.",
);
done();
},
Expand Down
@@ -1 +1 @@
var $ = import("jquery");
a |> b
2 changes: 0 additions & 2 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -923,8 +923,6 @@ export default class ExpressionParser extends LValParser {
return this.parseImportMetaProperty(node);
}

this.expectPlugin("dynamicImport", node.start);

if (!this.match(tt.parenL)) {
this.unexpected(null, tt.parenL);
}
Expand Down

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.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,4 +1,4 @@
{
"plugins": ["dynamicImport", "importMeta"],
"plugins": ["importMeta"],
"sourceType": "script"
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}
@@ -1,4 +1,4 @@
{
"sourceType": "module",
"plugins": ["dynamicImport", "importMeta"]
"plugins": ["importMeta"]
}