js-on-sx: native prototypes carry wrapped primitive marker
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s

Per ES, Boolean.prototype is a Boolean wrapper around false,
Number.prototype wraps 0, String.prototype wraps "". So
Boolean.prototype == false (loose-eq unwraps), and
Object.prototype.toString.call(Number.prototype) ===
"[object Number]". Set __js_*_value__ on each in post-init.
built-ins/Boolean: 23/27 → 24/27, String: 80/99 → 84/99.
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 11:27:18 +00:00
parent f03aa3056d
commit e97bdc4602
4 changed files with 57 additions and 32 deletions

View File

@@ -4651,6 +4651,9 @@
(dict-set! (get Number "prototype") "__proto__" (get Object "prototype"))
(dict-set! (get String "prototype") "__proto__" (get Object "prototype"))
(dict-set! (get Boolean "prototype") "__proto__" (get Object "prototype"))
(dict-set! (get js-function-global "prototype") "__proto__" (get Object "prototype")))
(dict-set! (get js-function-global "prototype") "__proto__" (get Object "prototype"))
(dict-set! (get Number "prototype") "__js_number_value__" 0)
(dict-set! (get String "prototype") "__js_string_value__" "")
(dict-set! (get Boolean "prototype") "__js_boolean_value__" false))
(define js-global {:undefined js-undefined :JSON JSON :parseInt parseInt :Object Object :isNaN js-global-is-nan :Infinity inf :NaN 0 :String String :Boolean Boolean :Array Array :Math Math :parseFloat parseFloat :Number Number :console console :isFinite js-global-is-finite})