js-on-sx: js-loose-eq unwraps Number and Boolean wrappers
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 31s

js-loose-eq only had a __js_string_value__ unwrap clause, so
Object(1.1) == 1.1 returned false. Added parallel clauses for
__js_number_value__ and __js_boolean_value__ in both directions.
Now new Number(5) == 5, Object(true) == true, etc.
built-ins/Object: 26/50 → 37/50. conformance.sh: 148/148.
This commit is contained in:
2026-05-07 22:25:01 +00:00
parent 27bfceb1aa
commit 2490c901bf
4 changed files with 21 additions and 21 deletions

View File

@@ -1551,6 +1551,14 @@
(js-loose-eq (get a "__js_string_value__") b))
((and (dict? b) (contains? (keys b) "__js_string_value__"))
(js-loose-eq a (get b "__js_string_value__")))
((and (dict? a) (contains? (keys a) "__js_number_value__"))
(js-loose-eq (get a "__js_number_value__") b))
((and (dict? b) (contains? (keys b) "__js_number_value__"))
(js-loose-eq a (get b "__js_number_value__")))
((and (dict? a) (contains? (keys a) "__js_boolean_value__"))
(js-loose-eq (get a "__js_boolean_value__") b))
((and (dict? b) (contains? (keys b) "__js_boolean_value__"))
(js-loose-eq a (get b "__js_boolean_value__")))
(else false))))
(define js-loose-neq (fn (a b) (not (js-loose-eq a b))))