js-on-sx: js-div coerces divisor to inexact
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 55s

(js-div 1 0) with rational integer literals throws "rational: division
by zero" instead of producing Infinity. Wrapped the divisor in
(exact->inexact ...) so integer-by-zero now returns inf/-inf/nan
matching JS semantics. Hit by the harness's _isSameValue +0/-0 check
which calls (js-div 1 a) on JS literal arguments.
built-ins/Number: 37/50 → 41/50. built-ins/String: 77/99.
conformance.sh: 148/148.
This commit is contained in:
2026-05-07 18:35:29 +00:00
parent f4b0ebf353
commit 5f97e78d5f
4 changed files with 11 additions and 17 deletions

View File

@@ -1436,7 +1436,9 @@
(define js-mul (fn (a b) (* (js-to-number a) (js-to-number b))))
(define js-div (fn (a b) (/ (js-to-number a) (js-to-number b))))
(define
js-div
(fn (a b) (/ (js-to-number a) (exact->inexact (js-to-number b)))))
(define js-mod (fn (a b) (mod (js-to-number a) (js-to-number b))))

View File

@@ -20,16 +20,12 @@
"top_failures": [
[
"Test262Error (assertion failed)",
12
14
],
[
"Timeout",
6
],
[
"TypeError: not a function",
2
],
[
"ReferenceError (undefined symbol)",
1
@@ -44,16 +40,12 @@
"top_failure_modes": [
[
"Test262Error (assertion failed)",
12
14
],
[
"Timeout",
6
],
[
"TypeError: not a function",
2
],
[
"ReferenceError (undefined symbol)",
1
@@ -64,6 +56,6 @@
]
],
"pinned_commit": "d5e73fc8d2c663554fb72e2380a8c2bc1a318a33",
"elapsed_seconds": 361.8,
"elapsed_seconds": 420.7,
"workers": 1
}

View File

@@ -1,15 +1,14 @@
# test262 scoreboard
Pinned commit: `d5e73fc8d2c663554fb72e2380a8c2bc1a318a33`
Wall time: 361.8s
Wall time: 420.7s
**Total:** 77/99 runnable passed (77.8%). Raw: pass=77 fail=16 skip=1 timeout=6 total=100.
## Top failure modes
- **12x** Test262Error (assertion failed)
- **14x** Test262Error (assertion failed)
- **6x** Timeout
- **2x** TypeError: not a function
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)
@@ -23,8 +22,7 @@ Wall time: 361.8s
### built-ins/String (77/99 — 77.8%)
- **12x** Test262Error (assertion failed)
- **14x** Test262Error (assertion failed)
- **6x** Timeout
- **2x** TypeError: not a function
- **1x** ReferenceError (undefined symbol)
- **1x** SyntaxError (parse/unsupported syntax)