[parser] enable dynamic import by default (#10843)
* [parser] enable dynamic import by default * chore: add back babel-core api test
This commit is contained in:
parent
7bc22e42f5
commit
5b907e9bb7
@ -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();
|
||||
},
|
||||
|
||||
@ -1 +1 @@
|
||||
var $ = import("jquery");
|
||||
a |> b
|
||||
@ -922,8 +922,6 @@ export default class ExpressionParser extends LValParser {
|
||||
return this.parseImportMetaProperty(node);
|
||||
}
|
||||
|
||||
this.expectPlugin("dynamicImport", node.start);
|
||||
|
||||
if (!this.match(tt.parenL)) {
|
||||
this.raise(
|
||||
this.state.lastTokStart,
|
||||
|
||||
@ -1 +0,0 @@
|
||||
var $ = import("jquery");
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'dynamicImport' (1:8)",
|
||||
"plugins": []
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"throws": "This experimental syntax requires enabling the parser plugin: 'dynamicImport' (1:0)",
|
||||
"plugins": []
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["dynamicImport"]
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
import('test.js');
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user