Support import defer and import source in meriyah (#19721)
This commit is contained in:
1 parent
2c700bc611
commit
9df49a5516
18 files changed
+55
-160
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
approvedGitRepositories: null
|
approvedGitRepositories: "**"
|
||||||
|
|
||||||
compressionLevel: mixed
|
compressionLevel: mixed
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@
|
|||||||
"mdast-util-from-markdown": "2.0.3",
|
"mdast-util-from-markdown": "2.0.3",
|
||||||
"mdast-util-gfm": "3.1.0",
|
"mdast-util-gfm": "3.1.0",
|
||||||
"mdast-util-math": "3.0.0",
|
"mdast-util-math": "3.0.0",
|
||||||
"meriyah": "7.2.0",
|
"meriyah": "7.3.0",
|
||||||
"micromark-extension-gfm": "3.0.0",
|
"micromark-extension-gfm": "3.0.0",
|
||||||
"micromark-extension-math": "3.1.0",
|
"micromark-extension-math": "3.1.0",
|
||||||
"micromark-util-character": "2.1.1",
|
"micromark-util-character": "2.1.1",
|
||||||
|
|||||||
@@ -532,11 +532,34 @@ const pluginFiles = [
|
|||||||
{
|
{
|
||||||
input: "src/plugins/meriyah.js",
|
input: "src/plugins/meriyah.js",
|
||||||
replaceModule: [
|
replaceModule: [
|
||||||
// We don't use value of JSXText
|
|
||||||
{
|
{
|
||||||
module: resolveEsmModulePath("meriyah"),
|
module: resolveEsmModulePath("meriyah"),
|
||||||
find: "parser.tokenValue = decodeHTMLStrict(raw);",
|
process(text) {
|
||||||
replacement: "parser.tokenValue = raw;",
|
// `structuredClone` is used to clone node
|
||||||
|
text = outdent`
|
||||||
|
const structuredClone =
|
||||||
|
globalThis.structuredClone ??
|
||||||
|
((node) => ({ ...node, range: [...node.range] }));
|
||||||
|
|
||||||
|
${text}
|
||||||
|
`;
|
||||||
|
|
||||||
|
// We don't use value of JSXText
|
||||||
|
text = text.replace(
|
||||||
|
"const decodeMap = ",
|
||||||
|
"const decodeMap = undefined &&",
|
||||||
|
);
|
||||||
|
text = text.replace(
|
||||||
|
"const entities = ",
|
||||||
|
"const entities = undefined &&",
|
||||||
|
);
|
||||||
|
text = text.replaceAll(
|
||||||
|
"parser.tokenValue = decodeHTMLStrict(raw);",
|
||||||
|
"parser.tokenValue = raw;",
|
||||||
|
);
|
||||||
|
|
||||||
|
return text;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const packageTransforms = new Map([
|
|||||||
transforms["method-at"],
|
transforms["method-at"],
|
||||||
["@glimmer/syntax", "angular-estree-parser", "espree"],
|
["@glimmer/syntax", "angular-estree-parser", "espree"],
|
||||||
],
|
],
|
||||||
[transforms["object-has-own"], ["@babel/parser", "meriyah", "graphql"]],
|
[transforms["object-has-own"], ["@babel/parser", "graphql"]],
|
||||||
[transforms["string-raw"], ["camelcase", "@angular/compiler", "js-yaml"]],
|
[transforms["string-raw"], ["camelcase", "@angular/compiler", "js-yaml"]],
|
||||||
[transforms["method-is-well-formed"], ["meriyah"]],
|
[transforms["method-is-well-formed"], ["meriyah"]],
|
||||||
/* spell-checker: enable */
|
/* spell-checker: enable */
|
||||||
|
|||||||
@@ -58,10 +58,7 @@ const disabledTests = new Map(
|
|||||||
acorn: [
|
acorn: [
|
||||||
"js/explicit-resource-management/valid-await-using-asi-assignment.js",
|
"js/explicit-resource-management/valid-await-using-asi-assignment.js",
|
||||||
],
|
],
|
||||||
meriyah: [
|
meriyah: [],
|
||||||
// Parsing to different ASTs
|
|
||||||
"js/decorators/member-expression.js",
|
|
||||||
],
|
|
||||||
"babel-ts": [
|
"babel-ts": [
|
||||||
"typescript/conformance/types/moduleDeclaration/kind-detection.ts",
|
"typescript/conformance/types/moduleDeclaration/kind-detection.ts",
|
||||||
// https://github.com/babel/babel/pull/17659
|
// https://github.com/babel/babel/pull/17659
|
||||||
|
|||||||
@@ -119,6 +119,13 @@ function installPrettier(packageDirectory) {
|
|||||||
runNpmClient(["install", packed, "--engine-strict"]);
|
runNpmClient(["install", packed, "--engine-strict"]);
|
||||||
break;
|
break;
|
||||||
case "pnpm":
|
case "pnpm":
|
||||||
|
runNpmClient([
|
||||||
|
"config",
|
||||||
|
"set",
|
||||||
|
"blockExoticSubdeps",
|
||||||
|
"false",
|
||||||
|
"--location=project",
|
||||||
|
]);
|
||||||
// fails engine mismatch
|
// fails engine mismatch
|
||||||
runNpmClient(["add", packed, "--engine-strict"]);
|
runNpmClient(["add", packed, "--engine-strict"]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
+8
-8
@@ -51,11 +51,11 @@ import defer x from "x";
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-default.js format[meriyah] 1`] = `
|
exports[`no-default.js format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:14)
|
"'import defer' must be followed by a namespace import (1:14)
|
||||||
> 1 | import defer x from "x";
|
> 1 | import defer x from "x";
|
||||||
| ^
|
| ^
|
||||||
2 |
|
2 |
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
Cause: [1:13-1:14]: 'import defer' must be followed by a namespace import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-default.js format[oxc] 1`] = `
|
exports[`no-default.js format[oxc] 1`] = `
|
||||||
@@ -145,11 +145,11 @@ import defer { x } from "x";
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-named.js format[meriyah] 1`] = `
|
exports[`no-named.js format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:14)
|
"'import defer' must be followed by a namespace import (1:14)
|
||||||
> 1 | import defer { x } from "x";
|
> 1 | import defer { x } from "x";
|
||||||
| ^
|
| ^
|
||||||
2 |
|
2 |
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
Cause: [1:13-1:14]: 'import defer' must be followed by a namespace import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-named.js format[oxc] 1`] = `
|
exports[`no-named.js format[oxc] 1`] = `
|
||||||
@@ -233,10 +233,10 @@ import defer { x } from "x";
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`snippet: #0 format[meriyah] 1`] = `
|
exports[`snippet: #0 format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:14)
|
"'import defer' must be followed by a namespace import (1:14)
|
||||||
> 1 | import defer { x } from "x";
|
> 1 | import defer { x } from "x";
|
||||||
| ^
|
| ^
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
Cause: [1:13-1:14]: 'import defer' must be followed by a namespace import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`snippet: #0 format[oxc] 1`] = `
|
exports[`snippet: #0 format[oxc] 1`] = `
|
||||||
@@ -315,10 +315,10 @@ import defer x from "x";
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`snippet: #1 format[meriyah] 1`] = `
|
exports[`snippet: #1 format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:14)
|
"'import defer' must be followed by a namespace import (1:14)
|
||||||
> 1 | import defer x from "x";
|
> 1 | import defer x from "x";
|
||||||
| ^
|
| ^
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
Cause: [1:13-1:14]: 'import defer' must be followed by a namespace import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`snippet: #1 format[oxc] 1`] = `
|
exports[`snippet: #1 format[oxc] 1`] = `
|
||||||
|
|||||||
@@ -598,14 +598,6 @@ exports[`deferred-import-evaluation.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token *"
|
Cause: Unexpected token *"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`deferred-import-evaluation.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:14)
|
|
||||||
> 1 | import defer * as ns from "x";
|
|
||||||
| ^
|
|
||||||
2 |
|
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`destructuring-private.js format 1`] = `
|
exports[`destructuring-private.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "babel-ts", "babel-flow"]
|
parsers: ["babel", "babel-ts", "babel-flow"]
|
||||||
@@ -2481,15 +2473,6 @@ exports[`source-phase-imports.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token fooSource"
|
Cause: Unexpected token fooSource"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`source-phase-imports.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:15)
|
|
||||||
> 1 | import source fooSource from "foo";
|
|
||||||
| ^^^^^^^^^
|
|
||||||
2 | import.source("x");
|
|
||||||
3 |
|
|
||||||
Cause: [1:14-1:23]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`throw-expressions.js format 1`] = `
|
exports[`throw-expressions.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "babel-ts", "babel-flow"]
|
parsers: ["babel", "babel-ts", "babel-flow"]
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ runFormatTest(import.meta, ["babel", "babel-ts", "babel-flow"], {
|
|||||||
"v8intrinsic.js",
|
"v8intrinsic.js",
|
||||||
"module-blocks.js",
|
"module-blocks.js",
|
||||||
"async-do-expressions.js",
|
"async-do-expressions.js",
|
||||||
"source-phase-imports.js",
|
|
||||||
"deferred-import-evaluation.js",
|
|
||||||
"optional-chaining-assignment.js",
|
"optional-chaining-assignment.js",
|
||||||
"discard-binding.js",
|
"discard-binding.js",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -50,14 +50,6 @@ import.defer("foo");
|
|||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`dynamic-import.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.defer("foo");
|
|
||||||
| ^^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:7-1:12]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`dynamic-import-attributes-expression.js format 1`] = `
|
exports[`dynamic-import-attributes-expression.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "typescript", "flow"]
|
parsers: ["babel", "typescript", "flow"]
|
||||||
@@ -108,14 +100,6 @@ import.defer("x", { with: { attr: "val" } });
|
|||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`dynamic-import-attributes-expression.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.defer("x", { with: { attr: "val" } });
|
|
||||||
| ^^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:7-1:12]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-defer.js format 1`] = `
|
exports[`import-defer.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "typescript", "flow"]
|
parsers: ["babel", "typescript", "flow"]
|
||||||
@@ -163,14 +147,6 @@ import defer * as ns from "x";
|
|||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-defer.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:14)
|
|
||||||
> 1 | import defer * as ns from "x";
|
|
||||||
| ^
|
|
||||||
2 |
|
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-defer-attributes-declaration.js format 1`] = `
|
exports[`import-defer-attributes-declaration.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "typescript", "flow"]
|
parsers: ["babel", "typescript", "flow"]
|
||||||
@@ -217,11 +193,3 @@ Cause: 'from' expected (1:13)
|
|||||||
import defer * as ns from "x" with { attr: "val" };
|
import defer * as ns from "x" with { attr: "val" };
|
||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-defer-attributes-declaration.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:14)
|
|
||||||
> 1 | import defer * as ns from "x" with { attr: "val" };
|
|
||||||
| ^
|
|
||||||
2 |
|
|
||||||
Cause: [1:13-1:14]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
@@ -9,7 +9,6 @@ runFormatTest(import.meta, ["babel", "typescript", "flow"], {
|
|||||||
errors: {
|
errors: {
|
||||||
acorn: importDeferTests,
|
acorn: importDeferTests,
|
||||||
espree: importDeferTests,
|
espree: importDeferTests,
|
||||||
meriyah: importDeferTests,
|
|
||||||
flow: importDeferTests,
|
flow: importDeferTests,
|
||||||
hermes: importDeferTests,
|
hermes: importDeferTests,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,16 +83,6 @@ import.source(\`data:text/javascript,
|
|||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-phase.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.source(\`data:text/javascript,
|
|
||||||
| ^^^^^^
|
|
||||||
2 | console.log("RUN");
|
|
||||||
3 | \`)
|
|
||||||
4 |
|
|
||||||
Cause: [1:7-1:13]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`template-literal.js format 1`] = `
|
exports[`template-literal.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "flow", "typescript"]
|
parsers: ["babel", "flow", "typescript"]
|
||||||
|
|||||||
@@ -4,6 +4,5 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], {
|
|||||||
hermes: ["template-literal.js", "import-phase.js"],
|
hermes: ["template-literal.js", "import-phase.js"],
|
||||||
acorn: ["import-phase.js"],
|
acorn: ["import-phase.js"],
|
||||||
espree: ["import-phase.js"],
|
espree: ["import-phase.js"],
|
||||||
meriyah: ["import-phase.js"],
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -66,16 +66,6 @@ import.defer("./a/long/long/long/long/long/long/long/long/long/long/long/long/pa
|
|||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-defer.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.defer("./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module");
|
|
||||||
| ^^^^^
|
|
||||||
2 | import.defer(
|
|
||||||
3 | // Comment
|
|
||||||
4 | "./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module"
|
|
||||||
Cause: [1:7-1:12]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-expression.js format 1`] = `
|
exports[`import-expression.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel", "flow", "typescript"]
|
parsers: ["babel", "flow", "typescript"]
|
||||||
@@ -165,13 +155,3 @@ note: start of member expression (1:0)
|
|||||||
import.source("./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module");
|
import.source("./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module");
|
||||||
^"
|
^"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.source("./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module");
|
|
||||||
| ^^^^^^
|
|
||||||
2 | import.source(
|
|
||||||
3 | // Comment
|
|
||||||
4 | "./a/long/long/long/long/long/long/long/long/long/long/long/long/path/to/module"
|
|
||||||
Cause: [1:7-1:13]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
@@ -2,7 +2,6 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], {
|
|||||||
errors: {
|
errors: {
|
||||||
acorn: ["import-defer.js", "import-source.js"],
|
acorn: ["import-defer.js", "import-source.js"],
|
||||||
espree: ["import-defer.js", "import-source.js"],
|
espree: ["import-defer.js", "import-source.js"],
|
||||||
meriyah: ["import-defer.js", "import-source.js"],
|
|
||||||
flow: ["import-defer.js", "import-source.js"],
|
flow: ["import-defer.js", "import-source.js"],
|
||||||
hermes: ["import-defer.js", "import-source.js"],
|
hermes: ["import-defer.js", "import-source.js"],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,14 +42,6 @@ exports[`import-source.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token x"
|
Cause: Unexpected token x"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:15)
|
|
||||||
> 1 | import source x from "x";
|
|
||||||
| ^
|
|
||||||
2 |
|
|
||||||
Cause: [1:14-1:15]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-source-attributes-declaration.js format 1`] = `
|
exports[`import-source-attributes-declaration.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel"]
|
parsers: ["babel"]
|
||||||
@@ -79,14 +71,6 @@ exports[`import-source-attributes-declaration.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token s"
|
Cause: Unexpected token s"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source-attributes-declaration.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:15)
|
|
||||||
> 1 | import source s from "x" with { attr: "val" };
|
|
||||||
| ^
|
|
||||||
2 |
|
|
||||||
Cause: [1:14-1:15]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-source-attributes-expression.js format 1`] = `
|
exports[`import-source-attributes-expression.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel"]
|
parsers: ["babel"]
|
||||||
@@ -116,14 +100,6 @@ exports[`import-source-attributes-expression.js format[espree] 1`] = `
|
|||||||
Cause: The only valid meta property for import is 'import.meta'"
|
Cause: The only valid meta property for import is 'import.meta'"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source-attributes-expression.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.source("x", { with: { attr: "val" } });
|
|
||||||
| ^^^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:7-1:13]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-source-binding-from.js format 1`] = `
|
exports[`import-source-binding-from.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel"]
|
parsers: ["babel"]
|
||||||
@@ -153,14 +129,6 @@ exports[`import-source-binding-from.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token from"
|
Cause: Unexpected token from"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source-binding-from.js format[meriyah] 1`] = `
|
|
||||||
"Import source must be string (1:20)
|
|
||||||
> 1 | import source from from "x";
|
|
||||||
| ^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:19-1:23]: Import source must be string"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-source-binding-source.js format 1`] = `
|
exports[`import-source-binding-source.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel"]
|
parsers: ["babel"]
|
||||||
@@ -190,14 +158,6 @@ exports[`import-source-binding-source.js format[espree] 1`] = `
|
|||||||
Cause: Unexpected token source"
|
Cause: Unexpected token source"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source-binding-source.js format[meriyah] 1`] = `
|
|
||||||
"Expected 'from' (1:15)
|
|
||||||
> 1 | import source source from "x";
|
|
||||||
| ^^^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:14-1:20]: Expected 'from'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`import-source-dynamic-import.js format 1`] = `
|
exports[`import-source-dynamic-import.js format 1`] = `
|
||||||
====================================options=====================================
|
====================================options=====================================
|
||||||
parsers: ["babel"]
|
parsers: ["babel"]
|
||||||
@@ -227,14 +187,6 @@ exports[`import-source-dynamic-import.js format[espree] 1`] = `
|
|||||||
Cause: The only valid meta property for import is 'import.meta'"
|
Cause: The only valid meta property for import is 'import.meta'"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`import-source-dynamic-import.js format[meriyah] 1`] = `
|
|
||||||
"The only valid meta property for import is 'import.meta' (1:8)
|
|
||||||
> 1 | import.source("foo");
|
|
||||||
| ^^^^^^
|
|
||||||
2 |
|
|
||||||
Cause: [1:7-1:13]: The only valid meta property for import is 'import.meta'"
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`no-named.js format[__babel_estree] 1`] = `
|
exports[`no-named.js format[__babel_estree] 1`] = `
|
||||||
"Only \`import source x from "./module"\` is valid. (1:17)
|
"Only \`import source x from "./module"\` is valid. (1:17)
|
||||||
> 1 | import source { x } from "x";
|
> 1 | import source { x } from "x";
|
||||||
@@ -268,11 +220,11 @@ Cause: Unexpected token {"
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-named.js format[meriyah] 1`] = `
|
exports[`no-named.js format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:15)
|
"'import source' must be followed by a default import (1:15)
|
||||||
> 1 | import source { x } from "x";
|
> 1 | import source { x } from "x";
|
||||||
| ^
|
| ^
|
||||||
2 |
|
2 |
|
||||||
Cause: [1:14-1:15]: Expected 'from'"
|
Cause: [1:14-1:15]: 'import source' must be followed by a default import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-named.js format[oxc] 1`] = `
|
exports[`no-named.js format[oxc] 1`] = `
|
||||||
@@ -322,11 +274,11 @@ Cause: Unexpected token *"
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-namespace.js format[meriyah] 1`] = `
|
exports[`no-namespace.js format[meriyah] 1`] = `
|
||||||
"Expected 'from' (1:15)
|
"'import source' must be followed by a default import (1:15)
|
||||||
> 1 | import source * as x from "x";
|
> 1 | import source * as x from "x";
|
||||||
| ^
|
| ^
|
||||||
2 |
|
2 |
|
||||||
Cause: [1:14-1:15]: Expected 'from'"
|
Cause: [1:14-1:15]: 'import source' must be followed by a default import"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`no-namespace.js format[oxc] 1`] = `
|
exports[`no-namespace.js format[oxc] 1`] = `
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ runFormatTest(import.meta, ["babel"], {
|
|||||||
errors: {
|
errors: {
|
||||||
acorn: [...importSourceTests, ...invalidSyntaxTests],
|
acorn: [...importSourceTests, ...invalidSyntaxTests],
|
||||||
espree: [...importSourceTests, ...invalidSyntaxTests],
|
espree: [...importSourceTests, ...invalidSyntaxTests],
|
||||||
meriyah: [...importSourceTests, ...invalidSyntaxTests],
|
meriyah: invalidSyntaxTests,
|
||||||
oxc: invalidSyntaxTests,
|
oxc: invalidSyntaxTests,
|
||||||
"oxc-ts": invalidSyntaxTests,
|
"oxc-ts": invalidSyntaxTests,
|
||||||
yuku: invalidSyntaxTests,
|
yuku: invalidSyntaxTests,
|
||||||
|
|||||||
@@ -6990,10 +6990,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"meriyah@npm:7.2.0":
|
"meriyah@npm:7.3.0":
|
||||||
version: 7.2.0
|
version: 7.3.0
|
||||||
resolution: "meriyah@npm:7.2.0"
|
resolution: "meriyah@npm:7.3.0"
|
||||||
checksum: 10/27730efc5524ef0dca0419b73b503b5486cf1535fb689a9c16224367e45df7c9f1dea0d6d354dbc002185feba642f95fae4e0ee8f2912b06a0a6a36686122a1c
|
checksum: 10/fbaafd1cd1fcb7bec62d275e00617a768bdec0694e761848f194ff4850dbbab10663dd69d107821268bb898db6a395c593de6e18d37e967a50444e0978be79f6
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -8297,7 +8297,7 @@ __metadata:
|
|||||||
mdast-util-from-markdown: "npm:2.0.3"
|
mdast-util-from-markdown: "npm:2.0.3"
|
||||||
mdast-util-gfm: "npm:3.1.0"
|
mdast-util-gfm: "npm:3.1.0"
|
||||||
mdast-util-math: "npm:3.0.0"
|
mdast-util-math: "npm:3.0.0"
|
||||||
meriyah: "npm:7.2.0"
|
meriyah: "npm:7.3.0"
|
||||||
micromark-extension-gfm: "npm:3.0.0"
|
micromark-extension-gfm: "npm:3.0.0"
|
||||||
micromark-extension-math: "npm:3.1.0"
|
micromark-extension-math: "npm:3.1.0"
|
||||||
micromark-util-character: "npm:2.1.1"
|
micromark-util-character: "npm:2.1.1"
|
||||||
|
|||||||
Reference in new issue
Block a user