js-on-sx: number/boolean method dispatch falls back to Number/Boolean.prototype
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s

This commit is contained in:
2026-05-10 04:18:20 +00:00
parent 8a06c2d72b
commit df5e36aa5e
2 changed files with 22 additions and 10 deletions

View File

@@ -442,11 +442,16 @@
((= key "toPrecision") (js-to-string recv))
((= key "toExponential") (js-to-string recv))
(else
(error
(str
"TypeError: "
(js-to-string key)
" is not a function (on number)"))))))
(let
((m (js-dict-get-walk (get Number "prototype") (js-to-string key))))
(cond
((js-undefined? m)
(error
(str
"TypeError: "
(js-to-string key)
" is not a function (on number)")))
(else (js-call-with-this recv m args))))))))
(define
js-invoke-function-objproto
@@ -472,11 +477,16 @@
((= key "toString") (if recv "true" "false"))
((= key "valueOf") recv)
(else
(error
(str
"TypeError: "
(js-to-string key)
" is not a function (on boolean)"))))))
(let
((m (js-dict-get-walk (get Boolean "prototype") (js-to-string key))))
(cond
((js-undefined? m)
(error
(str
"TypeError: "
(js-to-string key)
" is not a function (on boolean)")))
(else (js-call-with-this recv m args))))))))
(define
js-num-to-str-radix