js-on-sx: js-to-number returns NaN for functions, coerces lists
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s

This commit is contained in:
2026-05-09 06:29:06 +00:00
parent 013ce15357
commit cb272317bc
2 changed files with 5 additions and 0 deletions

View File

@@ -1369,6 +1369,9 @@
((= (type-of v) "number") v)
((= (type-of v) "rational") (exact->inexact v))
((= (type-of v) "string") (js-string-to-number v))
((or (= (type-of v) "lambda") (= (type-of v) "function") (= (type-of v) "component"))
(js-nan-value))
((= (type-of v) "list") (if (= (len v) 0) 0 (if (= (len v) 1) (js-to-number (nth v 0)) (js-nan-value))))
((= (type-of v) "dict")
(cond
((contains? (keys v) "__js_number_value__")