mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
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:
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 &&
|
||||
|
||||
Reference in new issue
Block a user