js-on-sx: built-in .length returns spec-defined values
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s

String.fromCharCode.length, Math.max.length, Array.from.length
were returning 0 because their SX lambdas use &rest args with no
required params — but spec assigns each a specific length.
Added js-builtin-fn-length mapping JS name to spec length (12
entries). js-fn-length consults the table first and falls back to
counting real params.
built-ins/String: 79/99 → 80/99, built-ins/Array: 20/45 → 21/45.
conformance.sh: 148/148.
This commit is contained in:
2026-05-08 05:01:12 +00:00
parent 8d9ce7838d
commit 0cfaeb9136
4 changed files with 74 additions and 30 deletions

View File

@@ -113,13 +113,35 @@
(let
((t (type-of f)))
(cond
((= t "lambda") (js-count-real-params (lambda-params f)))
((= t "lambda")
(let
((mapped (js-builtin-fn-length (js-unmap-fn-name (js-extract-fn-name f)))))
(if (>= mapped 0) mapped (js-count-real-params (lambda-params f)))))
((= t "function") 0)
((= t "component") 0)
((and (= t "dict") (contains? (keys f) "__callable__"))
(js-fn-length (get f "__callable__")))
(else 0)))))
(define
js-builtin-fn-length
(fn
(name)
(cond
((= name "fromCharCode") 1)
((= name "fromCodePoint") 1)
((= name "raw") 1)
((= name "of") 0)
((= name "from") 1)
((= name "isArray") 1)
((= name "max") 2)
((= name "min") 2)
((= name "hypot") 2)
((= name "atan2") 2)
((= name "imul") 2)
((= name "pow") 2)
(else -1))))
(define
js-extract-fn-name
(fn

View File

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

View File

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