js-on-sx: scope var defines + js-args for call args
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s

JS top-level var was emitting (define <name> X) at SX top level,
permanently rebinding any SX primitive of that name (e.g. var list
= X broke (list ...) globally). Two-part fix:
1. wrap transpiled program in (let () ...) in js-eval so defines
   scope to the eval and don't leak.
2. rename call-args constructor in js-transpile-args from list to
   js-args (a variadic alias) so even within the eval's own scope,
   JS vars named list don't shadow arg construction.
Array-literal transpile keeps list (arrays must be mutable).
built-ins/Object: 41/50 → 42/50. conformance.sh: 148/148.
This commit is contained in:
2026-05-07 23:55:07 +00:00
parent 06a5b5b07c
commit 82100603f0
5 changed files with 51 additions and 47 deletions

View File

@@ -1153,6 +1153,8 @@
false
0))))))))
(define js-args (fn (&rest args) args))
(define js-trim (fn (s) (js-trim-left (js-trim-right s))))
(define