js-on-sx: array elision, list-instanceof-Array, array toString identity
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 41s

This commit is contained in:
2026-05-10 01:27:33 +00:00
parent ce067e32a4
commit ad897122d7
3 changed files with 17 additions and 1 deletions

View File

@@ -537,6 +537,11 @@
(st elems)
(cond
((jp-at? st "punct" "]") nil)
((jp-at? st "punct" ",")
(begin
(append! elems (list (quote js-undef)))
(jp-advance! st)
(jp-array-loop st elems)))
(else
(begin
(cond

View File

@@ -809,6 +809,15 @@
((and (= (type-of obj) "dict") (contains? (keys obj) "__proto__"))
(js-instanceof-walk obj proto))
(else false))))
((list? obj)
(let
((proto (js-get-ctor-proto ctor))
(arrproto (get Array "prototype"))
(objproto (get Object "prototype")))
(cond
((= proto arrproto) true)
((= proto objproto) true)
(else false))))
((not (= (type-of obj) "dict")) false)
(else
(let
@@ -3327,7 +3336,7 @@
((= key "findLast") (js-array-method obj "findLast"))
((= key "findLastIndex") (js-array-method obj "findLastIndex"))
((= key "reduceRight") (js-array-method obj "reduceRight"))
((= key "toString") (js-array-method obj "toString"))
((= key "toString") (js-dict-get-walk (get Array "prototype") "toString"))
((= key "toLocaleString") (js-array-method obj "toLocaleString"))
((= key "keys") (js-array-method obj "keys"))
((= key "values") (js-array-method obj "values"))