js-on-sx: Function.prototype.{call,apply,bind,toString} expose spec length/name
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s

This commit is contained in:
2026-05-09 13:09:11 +00:00
parent cd014cdb29
commit 16e21ef6fa
2 changed files with 3 additions and 1 deletions

View File

@@ -23,7 +23,7 @@
;; ── Boolean coercion (ToBoolean) ──────────────────────────────────
(define js-function-global {:__callable__ (fn (&rest args) (js-function-ctor args)) :prototype {:call (fn (&rest args) (js-invoke-function-method (js-this) "call" args)) :length 0 :bind (fn (&rest args) (js-invoke-function-method (js-this) "bind" args)) :toString (fn () (js-invoke-function-method (js-this) "toString" (list))) :apply (fn (&rest args) (js-invoke-function-method (js-this) "apply" args)) :name ""}})
(define js-function-global {:__callable__ (fn (&rest args) (js-function-ctor args)) :prototype {:call {:__callable__ (fn (&rest args) (js-invoke-function-method (js-this) "call" args)) :length 1 :name "call"} :length 0 :bind {:__callable__ (fn (&rest args) (js-invoke-function-method (js-this) "bind" args)) :length 1 :name "bind"} :toString {:__callable__ (fn () (js-invoke-function-method (js-this) "toString" (list))) :length 0 :name "toString"} :apply {:__callable__ (fn (&rest args) (js-invoke-function-method (js-this) "apply" args)) :length 2 :name "apply"} :name ""}})
(define
js-function-ctor