js-on-sx: Function global stub (constructor throws, prototype has stubs)
Several tests check 'new Function("return 1")' — we can't actually
implement that (would need runtime JS eval). Now Function is a dict with
__callable__ that throws TypeError, and a prototype containing call/apply/
bind/toString/length/name stubs so code that probes Function.prototype
doesn't crash with 'Undefined symbol: Function'.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -161,6 +161,7 @@
|
||||
((= name "Infinity") (list (js-sym "js-infinity-value")))
|
||||
((= name "eval") (js-sym "js-global-eval"))
|
||||
((= name "globalThis") (js-sym "js-global"))
|
||||
((= name "Function") (js-sym "js-function-global"))
|
||||
(else (js-sym name)))))
|
||||
|
||||
;; ── Unary ops ─────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user