mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 18:35:53 +00:00
fix(javascript): avoid positive-zero evidence for signed zero
This commit is contained in:
1 parent
2bd7de6f8c
commit
9055bd695b
4 files changed
+70
-1
No files matched your search
@@ -21,6 +21,11 @@ export const semanticPrimitiveSet = (
|
||||
status: "unknown",
|
||||
reason: "Nonfinite numbers are outside the JSON primitive lattice.",
|
||||
};
|
||||
if (typeof value === "number" && Object.is(value, -0))
|
||||
return {
|
||||
status: "unknown",
|
||||
reason: "Negative zero cannot be preserved by JSON primitive evidence.",
|
||||
};
|
||||
uniqueValues.add(value);
|
||||
if (uniqueValues.size > SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT)
|
||||
return semanticResourceLimitUnknown("primitive-candidates");
|
||||
|
||||
Reference in new issue
Block a user