fix(javascript): preserve lexical open and exact template semantics

This commit is contained in:
morluto committed 2026-10-09 01:55:12 +08:00
1 parent fe297e56e8
commit d6cc9ca3a6
8 files changed
+106 -20

No files matched your search

@@ -148,11 +148,6 @@ const literalValue = (
if (node === null || node === undefined) return { found: false };
const literal = readExactJavaScriptLiteral(node);
if (literal.found) return literal;
if (t.isTemplateLiteral(node) && node.expressions.length === 0)
return {
found: true,
value: node.quasis[0]?.value.cooked ?? node.quasis[0]?.value.raw ?? "",
};
if (
t.isUnaryExpression(node, { operator: "-" }) &&
t.isNumericLiteral(node.argument)