fix(javascript): avoid positive-zero evidence for signed zero

This commit is contained in:
Rudy Celekli
2026-10-09 12:14:53 -04:00
committed by morluto
parent 2bd7de6f8c
commit 9055bd695b
4 changed files with 70 additions and 1 deletions
@@ -171,7 +171,10 @@ const evaluateExpression = (
if (context.expressionDepth > SEMANTIC_EXPRESSION_DEPTH_LIMIT)
return semanticResourceLimitUnknown("expression-depth");
const literal = readExactJavaScriptLiteral(node);
if (literal.found) return { status: "literal", value: literal.value };
if (literal.found)
return typeof literal.value === "number"
? primitiveSet([literal.value])
: { status: "literal", value: literal.value };
if (t.isIdentifier(node)) {
const binding = resolveSemanticBindingState(context.state, node, node.name);
return binding === undefined