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

This commit is contained in:
Rudy Celekli authored and morluto committed 2026-10-10 01:45:00 +08:00
1 parent 2bd7de6f8c
commit 9055bd695b
4 files changed
+70 -1

No files matched your search

@@ -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