feat(javascript): discover semantic call literals in feature traces (#7840)

* feat(javascript): discover semantic call literals in feature traces

* fix(javascript): bound retained call literals by transfer capacity

* test(javascript): align feature no-match diagnostic
This commit is contained in:
morluto authored and GitHub committed 2026-10-29 01:25:23 +08:00
1 parent 685f6db960
commit f9e7571a3d
20 files changed
+681 -15

No files matched your search

@@ -71,6 +71,17 @@ export const readExactJavaScriptLiteral = (
return { found: true, value: node.value };
if (t.isBooleanLiteral(node)) return { found: true, value: node.value };
if (t.isNullLiteral(node)) return { found: true, value: null };
if (
t.isUnaryExpression(node) &&
(node.operator === "+" || node.operator === "-")
) {
const operand = unwrapJavaScriptExpression(node.argument).node;
if (t.isNumericLiteral(operand)) {
const value = node.operator === "-" ? -operand.value : operand.value;
if (Number.isFinite(value) && !Object.is(value, -0))
return { found: true, value };
}
}
if (
t.isTemplateLiteral(node) &&
node.expressions.length === 0 &&