Environment specific test failure#48
Conversation
Trunc(NaN) raises EInvalidOp on Linux x86_64 but silently returns 0 on macOS ARM64. Per ES2026 §7.1.6, ToInt32(NaN/Infinity) must return 0. Guard the Trunc call with IsNaN/IsInfinite checks so the radix correctly defaults to 0 (then 10) when undefined is passed. Co-authored-by: Johannes Stein <frostney@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Benchmark Results254 benchmarks · 🔴 27 regressed · 227 unchanged · avg -2.9% arraybuffer.js — 14 unchanged · avg -0.7%
arrays.js — 19 unchanged · avg -1.4%
async-await.js — 6 unchanged · avg -1.2%
classes.js — 🔴 1 regressed, 30 unchanged · avg -2.9%
closures.js — 11 unchanged · avg -2.1%
collections.js — 12 unchanged · avg -1.4%
destructuring.js — 🔴 3 regressed, 19 unchanged · avg -4.9%
fibonacci.js — 8 unchanged · avg -3.1%
for-of.js — 🔴 3 regressed, 4 unchanged · avg -6.9%
iterators.js — 🔴 12 regressed, 8 unchanged · avg -7.4%
json.js — 🔴 4 regressed, 16 unchanged · avg -4.8%
jsx.jsx — 🔴 1 regressed, 20 unchanged · avg -3.6%
numbers.js — 🔴 1 regressed, 10 unchanged · avg -4.9%
objects.js — 🔴 1 regressed, 6 unchanged · avg -2.0%
promises.js — 12 unchanged · avg +0.9%
strings.js — 🔴 1 regressed, 10 unchanged · avg -0.0%
typed-arrays.js — 22 unchanged · avg +0.0%
Measured on ubuntu-latest x64. Changes within ±7% are considered insignificant. |
Fix
Number.parseIntcrashing on Linux when radix isNaNorundefined.Trunc(NaN)raises anEInvalidOpexception on Linux x86_64, whereas it silently returns0on macOS ARM64. This causedNumber.parseInt("10", undefined)to crash on Linux, violating the ES spec which requiresToInt32(NaN)to return+0. The fix adds checks forNaNandInfinitybefore callingTrunc, defaulting the radix to0as per spec.