Cleanup for meriyah parser (#16677)

This commit is contained in:
fisker Cheung authored and GitHub committed 2024-09-27 17:57:44 +08:00
1 parent f027ddbac2
commit 1bb69dfd13
3 files changed
+1 -35

No files matched your search

@@ -119,15 +119,13 @@ export default function esbuildPluginThrowWarnings({
warning.location.file.startsWith("node_modules/") &&
(warning.text ===
'The condition "default" here will never be used as it comes after both "import" and "require"' ||
// meriyah
// `lines-and-columns`
warning.text ===
'The condition "types" here will never be used as it comes after both "import" and "require"')
) {
continue;
}
console.log(warning);
console.log(warning);
throw new Error(warning.text);
}
@@ -97,22 +97,6 @@ function postprocess(ast, options) {
ast.extra = { ...ast.extra, __isUsingHackPipeline: true };
break;
case "ExportAllDeclaration":
// TODO: Remove this when https://github.com/meriyah/meriyah/issues/200 get fixed
if (parser === "meriyah" && node.exported?.type === "Identifier") {
const { exported } = node;
const raw = text.slice(locStart(exported), locEnd(exported));
if (raw.startsWith('"') || raw.startsWith("'")) {
node.exported = {
...node.exported,
type: "Literal",
value: node.exported.name,
raw,
};
}
}
break;
// In Flow parser, it doesn't generate union/intersection types for single type
case "TSUnionType":
case "TSIntersectionType":
-16
View File
@@ -69,22 +69,6 @@ const acornDisabledTests = espreeDisabledTests;
const meriyahDisabledTests = new Set([
...espreeDisabledTests,
...[
// Meriyah does not support decorator auto accessors syntax.
// But meriyah can parse it as an ordinary class property.
// So meriyah does not throw parsing error for it.
...[
"basic.js",
"computed.js",
"private.js",
"static-computed.js",
"static-private.js",
"static.js",
"with-semicolon-1.js",
"with-semicolon-2.js",
"comments.js",
].map((filename) => `js/decorator-auto-accessors/${filename}`),
// https://github.com/meriyah/meriyah/issues/233
"js/babel-plugins/decorator-auto-accessors.js",
// Parsing to different ASTs
"js/decorators/member-expression.js",
// Meriyah parse RegExp relay on runtime behavior