js-on-sx: arrays accept numeric-string property keys
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s

JS arrays must treat string indices that look like numbers ("0",
"42") as the corresponding integer slot. js-get-prop and js-list-set!
only handled numeric key, falling through to undefined / no-op for
string keys. Added a (and (string-typed key) (numeric? key)) clause
that converts via js-string-to-number and recurses with the integer
key. built-ins/Array: 13/45 → 14/45. conformance.sh: 148/148.
This commit is contained in:
2026-05-08 00:28:36 +00:00
parent 82100603f0
commit c8f9b8be06
4 changed files with 56 additions and 35 deletions

View File

@@ -2639,6 +2639,13 @@
(and (>= key 0) (< key (len obj)))
(nth obj (js-num-to-int key))
js-undefined))
((and (= (type-of key) "string") (js-is-numeric-string? key))
(let
((idx (js-num-to-int (js-string-to-number key))))
(if
(and (>= idx 0) (< idx (len obj)))
(nth obj idx)
js-undefined)))
((= key "push") (js-array-method obj "push"))
((= key "pop") (js-array-method obj "pop"))
((= key "shift") (js-array-method obj "shift"))
@@ -2791,6 +2798,8 @@
((< i n) (set-nth! lst i val))
((= i n) (append! lst val))
(else (do (js-pad-list! lst n i) (append! lst val))))))
((and (= (type-of key) "string") (js-is-numeric-string? key))
(js-list-set! lst (js-string-to-number key) val))
((= key "length") nil)
(else nil))))
(define

View File

@@ -1,37 +1,41 @@
{
"totals": {
"pass": 77,
"fail": 15,
"skip": 1,
"timeout": 7,
"total": 100,
"runnable": 99,
"pass_rate": 77.8
"pass": 14,
"fail": 25,
"skip": 5,
"timeout": 6,
"total": 50,
"runnable": 45,
"pass_rate": 31.1
},
"categories": [
{
"category": "built-ins/String",
"total": 100,
"pass": 77,
"fail": 15,
"skip": 1,
"timeout": 7,
"pass_rate": 77.8,
"category": "built-ins/Array",
"total": 50,
"pass": 14,
"fail": 25,
"skip": 5,
"timeout": 6,
"pass_rate": 31.1,
"top_failures": [
[
"Test262Error (assertion failed)",
13
20
],
[
"Timeout",
7
6
],
[
"TypeError: not a function",
2
],
[
"ReferenceError (undefined symbol)",
1
2
],
[
"SyntaxError (parse/unsupported syntax)",
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
1
]
]
@@ -40,22 +44,26 @@
"top_failure_modes": [
[
"Test262Error (assertion failed)",
13
20
],
[
"Timeout",
7
6
],
[
"TypeError: not a function",
2
],
[
"ReferenceError (undefined symbol)",
1
2
],
[
"SyntaxError (parse/unsupported syntax)",
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
1
]
],
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
"elapsed_seconds": 486.8,
"elapsed_seconds": 132.0,
"workers": 1
}

View File

@@ -1,28 +1,30 @@
# test262 scoreboard
Pinned commit: `d5e73fc8d2c663554fb72e2380a8c2bc1a318a33`
Wall time: 486.8s
Wall time: 132.0s
**Total:** 77/99 runnable passed (77.8%). Raw: pass=77 fail=15 skip=1 timeout=7 total=100.
**Total:** 14/45 runnable passed (31.1%). Raw: pass=14 fail=25 skip=5 timeout=6 total=50.
## Top failure modes
- **13x** Test262Error (assertion failed)
- **7x** Timeout
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)
- **20x** Test262Error (assertion failed)
- **6x** Timeout
- **2x** TypeError: not a function
- **2x** ReferenceError (undefined symbol)
- **1x** Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\
## Categories (worst pass-rate first, min 10 runnable)
| Category | Pass | Fail | Skip | Timeout | Total | Pass % |
|---|---:|---:|---:|---:|---:|---:|
| built-ins/String | 77 | 15 | 1 | 7 | 100 | 77.8% |
| built-ins/Array | 14 | 25 | 5 | 6 | 50 | 31.1% |
## Per-category top failures (min 10 runnable, worst first)
### built-ins/String (77/99 — 77.8%)
### built-ins/Array (14/45 — 31.1%)
- **13x** Test262Error (assertion failed)
- **7x** Timeout
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)
- **20x** Test262Error (assertion failed)
- **6x** Timeout
- **2x** TypeError: not a function
- **2x** ReferenceError (undefined symbol)
- **1x** Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\