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
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 21s
This commit is contained in:
@@ -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__")
|
||||
|
||||
Reference in New Issue
Block a user