js-on-sx: bail out of array set/length at 2^32-1 instead of padding
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s

arr[4294967295] = 'x' and arr.length = 4294967295 were padding
the SX list with js-undefined for ~4 billion entries — instant
timeout. Per ES spec, indices >= 2^32-1 aren't array indices
anyway (regular properties, which we can't store on lists).
Added (>= i 4294967295) bail clauses to js-list-set! and the
length setter.
built-ins/Array: 21/45 → 23/45 (5 timeouts → 2).
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 05:31:50 +00:00
parent 0cfaeb9136
commit 16f7a14506
4 changed files with 31 additions and 27 deletions

View File

@@ -2866,6 +2866,7 @@
((i (js-num-to-int key)) (n (len lst)))
(cond
((< i 0) nil)
((>= i 4294967295) nil)
((< i n) (set-nth! lst i val))
((= i n) (append! lst val))
(else (do (js-pad-list! lst n i) (append! lst val))))))
@@ -2876,6 +2877,7 @@
((target (js-num-to-int (js-to-number val))) (n (len lst)))
(cond
((< target 0) nil)
((>= target 4294967295) nil)
((> target n) (js-pad-list! lst n target))
(else nil))))
(else nil))))

View File

@@ -1,35 +1,35 @@
{
"totals": {
"pass": 21,
"fail": 17,
"pass": 23,
"fail": 20,
"skip": 5,
"timeout": 7,
"timeout": 2,
"total": 50,
"runnable": 45,
"pass_rate": 46.7
"pass_rate": 51.1
},
"categories": [
{
"category": "built-ins/Array",
"total": 50,
"pass": 21,
"fail": 17,
"pass": 23,
"fail": 20,
"skip": 5,
"timeout": 7,
"pass_rate": 46.7,
"timeout": 2,
"pass_rate": 51.1,
"top_failures": [
[
"Test262Error (assertion failed)",
14
],
[
"Timeout",
7
17
],
[
"TypeError: not a function",
2
],
[
"Timeout",
2
],
[
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
1
@@ -40,22 +40,22 @@
"top_failure_modes": [
[
"Test262Error (assertion failed)",
14
],
[
"Timeout",
7
17
],
[
"TypeError: not a function",
2
],
[
"Timeout",
2
],
[
"Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\\",
1
]
],
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
"elapsed_seconds": 123.5,
"elapsed_seconds": 51.3,
"workers": 1
}

View File

@@ -1,28 +1,28 @@
# test262 scoreboard
Pinned commit: `d5e73fc8d2c663554fb72e2380a8c2bc1a318a33`
Wall time: 123.5s
Wall time: 51.3s
**Total:** 21/45 runnable passed (46.7%). Raw: pass=21 fail=17 skip=5 timeout=7 total=50.
**Total:** 23/45 runnable passed (51.1%). Raw: pass=23 fail=20 skip=5 timeout=2 total=50.
## Top failure modes
- **14x** Test262Error (assertion failed)
- **7x** Timeout
- **17x** Test262Error (assertion failed)
- **2x** TypeError: not a function
- **2x** Timeout
- **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/Array | 21 | 17 | 5 | 7 | 50 | 46.7% |
| built-ins/Array | 23 | 20 | 5 | 2 | 50 | 51.1% |
## Per-category top failures (min 10 runnable, worst first)
### built-ins/Array (21/45 — 46.7%)
### built-ins/Array (23/45 — 51.1%)
- **14x** Test262Error (assertion failed)
- **7x** Timeout
- **17x** Test262Error (assertion failed)
- **2x** TypeError: not a function
- **2x** Timeout
- **1x** Unhandled: Not callable: {:2 43 :1 42 :0 41 :length 3}\