HS Bucket F: array literal arg to JS fn fix (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 18s
Generator emit_eval translates arr.reduce/map/filter to SX primitives so SX list args work. host-call-fn sxToJs converts SX lists to native JS arrays for native JS function calls. Fixes functionCalls "can pass an array literal as an argument". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5315,7 +5315,7 @@
|
||||
(deftest "can invoke global function w/ async arg"
|
||||
(error "SKIP (untranslated): can invoke global function w/ async arg"))
|
||||
(deftest "can pass an array literal as an argument"
|
||||
(assert= (eval-hs-locals "sum([1, 2, 3, 4])" (list (list (quote sum) (fn (arr) (host-call arr "reduce" (fn (a b) (+ a b)) 0))))) 10)
|
||||
(assert= (eval-hs-locals "sum([1, 2, 3, 4])" (list (list (quote sum) (fn (arr) (reduce (fn (a b) (+ a b)) 0 arr))))) 10)
|
||||
)
|
||||
(deftest "can pass an expression as an argument"
|
||||
(assert= (eval-hs-locals "double(3 + 4)" (list (list (quote double) (fn (n) (* n 2))))) 14)
|
||||
|
||||
Reference in New Issue
Block a user