Skip to content

Environment specific test failure#48

Merged
frostney merged 1 commit into
mainfrom
cursor/environment-specific-test-failure-d434
Mar 8, 2026
Merged

Environment specific test failure#48
frostney merged 1 commit into
mainfrom
cursor/environment-specific-test-failure-d434

Conversation

@frostney
Copy link
Copy Markdown
Owner

@frostney frostney commented Mar 8, 2026

Fix Number.parseInt crashing on Linux when radix is NaN or undefined.

Trunc(NaN) raises an EInvalidOp exception on Linux x86_64, whereas it silently returns 0 on macOS ARM64. This caused Number.parseInt("10", undefined) to crash on Linux, violating the ES spec which requires ToInt32(NaN) to return +0. The fix adds checks for NaN and Infinity before calling Trunc, defaulting the radix to 0 as per spec.


Open in Web Open in Cursor 

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
Copy link
Copy Markdown

cursor Bot commented Mar 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 8, 2026

Warning

Rate limit exceeded

@frostney has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f04a2c60-8b8a-4beb-84a4-56164fb38ffd

📥 Commits

Reviewing files that changed from the base of the PR and between 34d54dd and c936bd2.

📒 Files selected for processing (1)
  • units/Goccia.Builtins.GlobalNumber.pas
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/environment-specific-test-failure-d434

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

Benchmark Results

254 benchmarks · 🔴 27 regressed · 227 unchanged · avg -2.9%

arraybuffer.js — 14 unchanged · avg -0.7%
Benchmark Base (ops/sec) PR (ops/sec) Change
create ArrayBuffer(0) 367,210 367,566 +0.1%
create ArrayBuffer(64) 361,285 358,882 -0.7%
create ArrayBuffer(1024) 284,371 284,735 +0.1%
create ArrayBuffer(8192) 132,101 132,363 +0.2%
slice full buffer (64 bytes) 444,702 443,053 -0.4%
slice half buffer (512 of 1024 bytes) 384,321 379,214 -1.3%
slice with negative indices 374,591 372,451 -0.6%
slice empty range 432,920 432,240 -0.2%
byteLength access 1,097,207 1,088,372 -0.8%
Symbol.toStringTag access 787,342 770,630 -2.1%
ArrayBuffer.isView 604,854 616,288 +1.9%
clone ArrayBuffer(64) 340,447 329,435 -3.2%
clone ArrayBuffer(1024) 265,593 264,288 -0.5%
clone ArrayBuffer inside object 236,935 231,305 -2.4%
arrays.js — 19 unchanged · avg -1.4%
Benchmark Base (ops/sec) PR (ops/sec) Change
Array.from length 100 12,872 12,674 -1.5%
Array.from 10 elements 206,606 205,714 -0.4%
Array.of 10 elements 280,066 278,733 -0.5%
spread into new array 276,482 276,108 -0.1%
map over 50 elements 23,675 23,561 -0.5%
filter over 50 elements 19,506 19,442 -0.3%
reduce sum 50 elements 22,394 22,365 -0.1%
forEach over 50 elements 17,169 17,256 +0.5%
find in 50 elements 29,536 29,636 +0.3%
sort 20 elements 9,764 10,049 +2.9%
flat nested array 100,947 100,607 -0.3%
flatMap 61,113 58,411 -4.4%
map inside map (5x5) 17,829 17,748 -0.5%
filter inside map (5x10) 13,038 12,433 -4.6%
reduce inside map (5x10) 15,662 14,853 -5.2%
forEach inside forEach (5x10) 12,652 12,027 -4.9%
find inside some (10x10) 11,763 11,057 -6.0%
map+filter chain nested (5x20) 4,547 4,547 -0.0%
reduce flatten (10x5) 33,342 33,127 -0.6%
async-await.js — 6 unchanged · avg -1.2%
Benchmark Base (ops/sec) PR (ops/sec) Change
single await 292,495 288,854 -1.2%
multiple awaits 127,315 126,390 -0.7%
await non-Promise value 606,550 600,071 -1.1%
await with try/catch 273,771 267,740 -2.2%
await Promise.all 45,204 45,099 -0.2%
nested async function call 146,128 143,267 -2.0%
classes.js — 🔴 1 regressed, 30 unchanged · avg -2.9%
Benchmark Base (ops/sec) PR (ops/sec) Change
simple class new 97,298 96,574 -0.7%
class with defaults 74,450 73,628 -1.1%
50 instances via Array.from 4,206 4,199 -0.2%
instance method call 46,297 45,674 -1.3%
static method call 82,341 81,640 -0.9%
single-level inheritance 38,512 37,877 -1.6%
two-level inheritance 33,216 32,883 -1.0%
private field access 46,546 46,274 -0.6%
private methods 53,840 53,241 -1.1%
getter/setter access 55,526 54,827 -1.3%
class decorator (identity) 73,807 70,398 -4.6%
class decorator (wrapping) 41,044 40,412 -1.5%
identity method decorator 52,622 48,971 -6.9%
wrapping method decorator 43,037 41,906 -2.6%
stacked method decorators (x3) 30,420 29,480 -3.1%
identity field decorator 59,793 56,836 -4.9%
field initializer decorator 50,014 47,724 -4.6%
getter decorator (identity) 49,634 47,087 -5.1%
setter decorator (identity) 40,954 39,428 -3.7%
static method decorator 56,105 53,521 -4.6%
static field decorator 65,678 62,516 -4.8%
private method decorator 41,795 41,638 -0.4%
private field decorator 44,949 43,708 -2.8%
plain auto-accessor (no decorator) 78,115 74,587 -4.5%
auto-accessor with decorator 46,797 43,455 🔴 -7.1%
decorator writing metadata 35,743 34,080 -4.7%
static getter read 87,203 84,436 -3.2%
static getter/setter pair 63,846 62,011 -2.9%
inherited static getter 49,908 48,169 -3.5%
inherited static setter 53,306 51,971 -2.5%
inherited static getter with this binding 42,491 41,101 -3.3%
closures.js — 11 unchanged · avg -2.1%
Benchmark Base (ops/sec) PR (ops/sec) Change
closure over single variable 80,089 79,059 -1.3%
closure over multiple variables 95,200 91,720 -3.7%
nested closures 94,499 93,869 -0.7%
function as argument 74,165 72,212 -2.6%
function returning function 89,691 88,027 -1.9%
compose two functions 55,187 53,002 -4.0%
fn.call 122,922 117,186 -4.7%
fn.apply 90,642 89,709 -1.0%
fn.bind 112,947 110,624 -2.1%
recursive sum to 50 8,522 8,722 +2.3%
recursive tree traversal 13,812 13,244 -4.1%
collections.js — 12 unchanged · avg -1.4%
Benchmark Base (ops/sec) PR (ops/sec) Change
add 50 elements 6,607 6,682 +1.1%
has lookup (50 elements) 87,458 86,240 -1.4%
delete elements 46,952 45,502 -3.1%
forEach iteration 12,740 12,948 +1.6%
spread to array 27,749 26,517 -4.4%
deduplicate array 38,005 36,452 -4.1%
set 50 entries 4,807 4,759 -1.0%
get lookup (50 entries) 86,879 84,992 -2.2%
has check 124,641 124,631 -0.0%
delete entries 44,592 43,979 -1.4%
forEach iteration 12,610 12,537 -0.6%
keys/values/entries 7,491 7,389 -1.4%
destructuring.js — 🔴 3 regressed, 19 unchanged · avg -4.9%
Benchmark Base (ops/sec) PR (ops/sec) Change
simple array destructuring 329,679 317,477 -3.7%
with rest element 226,452 218,939 -3.3%
with defaults 333,397 319,402 -4.2%
skip elements 342,984 330,787 -3.6%
nested array destructuring 138,817 134,113 -3.4%
swap variables 346,137 336,997 -2.6%
simple object destructuring 245,361 239,864 -2.2%
with defaults 306,434 284,177 🔴 -7.3%
with renaming 263,249 249,861 -5.1%
nested object destructuring 124,458 117,241 -5.8%
rest properties 163,169 152,344 -6.6%
object parameter 75,975 71,896 -5.4%
array parameter 99,342 92,228 🔴 -7.2%
mixed destructuring in map 30,484 29,034 -4.8%
forEach with array destructuring 52,515 48,951 -6.8%
map with array destructuring 55,096 51,339 -6.8%
filter with array destructuring 57,103 54,791 -4.0%
reduce with array destructuring 59,710 55,920 -6.3%
map with object destructuring 67,054 64,604 -3.7%
map with nested destructuring 60,077 55,335 🔴 -7.9%
map with rest in destructuring 32,005 30,010 -6.2%
map with defaults in destructuring 50,534 49,605 -1.8%
fibonacci.js — 8 unchanged · avg -3.1%
Benchmark Base (ops/sec) PR (ops/sec) Change
recursive fib(15) 244 234 -4.1%
recursive fib(20) 21 21 +0.4%
recursive fib(15) typed 241 234 -3.2%
recursive fib(20) typed 21 21 -0.3%
iterative fib(20) via reduce 9,422 8,838 -6.2%
iterator fib(20) 6,643 6,463 -2.7%
iterator fib(20) via Iterator.from + take 6,886 6,654 -3.4%
iterator fib(20) last value via reduce 6,076 5,728 -5.7%
for-of.js — 🔴 3 regressed, 4 unchanged · avg -6.9%
Benchmark Base (ops/sec) PR (ops/sec) Change
for...of with 10-element array 37,635 35,219 -6.4%
for...of with 100-element array 4,211 4,030 -4.3%
for...of with string (10 chars) 28,092 26,359 -6.2%
for...of with Set (10 elements) 37,357 35,055 -6.2%
for...of with Map entries (10 entries) 25,176 23,193 🔴 -7.9%
for...of with destructuring 32,767 30,044 🔴 -8.3%
for-await-of with sync array 35,096 31,984 🔴 -8.9%
iterators.js — 🔴 12 regressed, 8 unchanged · avg -7.4%
Benchmark Base (ops/sec) PR (ops/sec) Change
Iterator.from({next}).toArray() — 20 elements 8,607 7,748 🔴 -10.0%
Iterator.from({next}).toArray() — 50 elements 3,858 3,349 🔴 -13.2%
spread pre-wrapped iterator — 20 elements 8,944 7,936 🔴 -11.3%
Iterator.from({next}).forEach — 50 elements 2,790 2,549 🔴 -8.6%
Iterator.from({next}).reduce — 50 elements 2,945 2,686 🔴 -8.8%
wrap array iterator 56,071 51,242 🔴 -8.6%
wrap plain {next()} object 6,077 5,454 🔴 -10.3%
map + toArray (50 elements) 2,440 2,352 -3.6%
filter + toArray (50 elements) 2,598 2,503 -3.7%
take(10) + toArray (50 element source) 13,883 12,764 🔴 -8.1%
drop(40) + toArray (50 element source) 3,482 3,308 -5.0%
chained map + filter + take (100 element source) 4,523 4,240 -6.3%
some + every (50 elements) 1,605 1,545 -3.8%
find (50 elements) 3,470 3,370 -2.9%
array.values().map().filter().toArray() 3,530 3,237 🔴 -8.3%
array.values().take(5).toArray() 59,504 57,939 -2.6%
array.values().drop(45).toArray() 16,761 15,960 -4.8%
map.entries() chained helpers 5,747 5,136 🔴 -10.6%
set.values() chained helpers 8,376 7,577 🔴 -9.5%
string iterator map + toArray 7,111 6,603 🔴 -7.1%
json.js — 🔴 4 regressed, 16 unchanged · avg -4.8%
Benchmark Base (ops/sec) PR (ops/sec) Change
parse simple object 152,189 146,962 -3.4%
parse nested object 99,438 89,739 🔴 -9.8%
parse array of objects 50,633 47,916 -5.4%
parse large flat object 47,332 45,631 -3.6%
parse mixed types 67,966 63,730 -6.2%
stringify simple object 144,440 135,284 -6.3%
stringify nested object 73,786 71,595 -3.0%
stringify array of objects 38,257 38,838 +1.5%
stringify mixed types 65,168 63,469 -2.6%
reviver doubles numbers 34,380 34,791 +1.2%
reviver filters properties 32,436 31,098 -4.1%
reviver on nested object 40,951 40,048 -2.2%
reviver on array 22,797 21,566 -5.4%
replacer function doubles numbers 37,033 32,839 🔴 -11.3%
replacer function excludes properties 47,062 42,599 🔴 -9.5%
array replacer (allowlist) 97,557 93,856 -3.8%
stringify with 2-space indent 76,883 72,239 -6.0%
stringify with tab indent 73,966 72,323 -2.2%
parse then stringify 47,498 43,647 🔴 -8.1%
stringify then parse 28,372 26,787 -5.6%
jsx.jsx — 🔴 1 regressed, 20 unchanged · avg -3.6%
Benchmark Base (ops/sec) PR (ops/sec) Change
simple element 180,054 173,706 -3.5%
self-closing element 182,788 178,331 -2.4%
element with string attribute 148,475 145,766 -1.8%
element with multiple attributes 125,724 125,319 -0.3%
element with expression attribute 136,719 134,005 -2.0%
text child 173,871 168,674 -3.0%
expression child 170,406 161,403 -5.3%
mixed text and expression 160,595 152,796 -4.9%
nested elements (3 levels) 64,582 62,887 -2.6%
sibling children 47,324 44,761 -5.4%
component element 119,227 116,275 -2.5%
component with children 73,081 71,256 -2.5%
dotted component 99,237 96,635 -2.6%
empty fragment 177,483 174,013 -2.0%
fragment with children 48,245 45,470 -5.8%
spread attributes 92,396 85,005 🔴 -8.0%
spread with overrides 81,777 78,916 -3.5%
shorthand props 127,664 122,174 -4.3%
nav bar structure 22,750 21,606 -5.0%
card component tree 25,976 24,970 -3.9%
10 list items via Array.from 11,941 11,309 -5.3%
numbers.js — 🔴 1 regressed, 10 unchanged · avg -4.9%
Benchmark Base (ops/sec) PR (ops/sec) Change
integer arithmetic 367,615 356,371 -3.1%
floating point arithmetic 399,560 379,287 -5.1%
number coercion 152,234 145,461 -4.4%
toFixed 92,602 88,928 -4.0%
toString 132,813 129,597 -2.4%
valueOf 203,879 185,240 🔴 -9.1%
toPrecision 125,269 117,868 -5.9%
Number.isNaN 248,005 231,980 -6.5%
Number.isFinite 242,687 229,327 -5.5%
Number.isInteger 240,390 233,331 -2.9%
Number.parseInt and parseFloat 206,508 195,915 -5.1%
objects.js — 🔴 1 regressed, 6 unchanged · avg -2.0%
Benchmark Base (ops/sec) PR (ops/sec) Change
create simple object 393,406 390,172 -0.8%
create nested object 182,810 183,381 +0.3%
create 50 objects via Array.from 8,158 7,859 -3.7%
property read 396,485 369,438 -6.8%
Object.keys 265,966 246,563 🔴 -7.3%
Object.entries 94,820 100,827 +6.3%
spread operator 152,038 148,893 -2.1%
promises.js — 12 unchanged · avg +0.9%
Benchmark Base (ops/sec) PR (ops/sec) Change
Promise.resolve(value) 438,975 423,185 -3.6%
new Promise(resolve => resolve(value)) 158,136 160,257 +1.3%
Promise.reject(reason) 434,012 412,047 -5.1%
resolve + then (1 handler) 137,439 136,232 -0.9%
resolve + then chain (3 deep) 55,886 56,551 +1.2%
resolve + then chain (10 deep) 18,819 18,579 -1.3%
reject + catch + then 81,600 77,218 -5.4%
resolve + finally + then 65,669 68,959 +5.0%
Promise.all (5 resolved) 25,790 26,662 +3.4%
Promise.race (5 resolved) 27,609 28,905 +4.7%
Promise.allSettled (5 mixed) 22,494 24,018 +6.8%
Promise.any (5 mixed) 26,350 27,434 +4.1%
strings.js — 🔴 1 regressed, 10 unchanged · avg -0.0%
Benchmark Base (ops/sec) PR (ops/sec) Change
string concatenation 322,396 329,492 +2.2%
template literal 404,264 355,249 🔴 -12.1%
string repeat 343,470 349,275 +1.7%
split and join 119,593 119,368 -0.2%
indexOf and includes 136,603 139,438 +2.1%
toUpperCase and toLowerCase 206,999 209,946 +1.4%
slice and substring 132,963 132,452 -0.4%
trim operations 153,794 151,912 -1.2%
replace and replaceAll 166,430 170,492 +2.4%
startsWith and endsWith 107,779 113,509 +5.3%
padStart and padEnd 162,308 160,277 -1.3%
typed-arrays.js — 22 unchanged · avg +0.0%
Benchmark Base (ops/sec) PR (ops/sec) Change
new Int32Array(0) 256,337 271,345 +5.9%
new Int32Array(100) 243,652 254,920 +4.6%
new Int32Array(1000) 148,084 149,838 +1.2%
new Float64Array(100) 215,016 228,835 +6.4%
Int32Array.from([...]) 157,503 165,340 +5.0%
Int32Array.of(1, 2, 3, 4, 5) 258,914 255,730 -1.2%
sequential write 100 elements 2,742 2,823 +2.9%
sequential read 100 elements 2,851 2,961 +3.9%
Float64Array write 100 elements 2,625 2,457 -6.4%
fill(42) 45,241 46,637 +3.1%
slice() 183,583 176,579 -3.8%
map(x => x * 2) 6,815 6,859 +0.6%
filter(x => x > 50) 7,256 6,899 -4.9%
reduce (sum) 6,891 6,481 -6.0%
sort() 161,632 164,333 +1.7%
indexOf() 365,015 377,837 +3.5%
reverse() 305,761 299,326 -2.1%
create view over existing buffer 318,159 311,873 -2.0%
subarray() 372,623 362,667 -2.7%
set() from array 440,828 417,511 -5.3%
for-of loop 4,088 3,913 -4.3%
spread into array 16,814 16,910 +0.6%

Measured on ubuntu-latest x64. Changes within ±7% are considered insignificant.

@frostney frostney marked this pull request as ready for review March 8, 2026 00:41
@frostney frostney merged commit 5222b03 into main Mar 8, 2026
4 checks passed
@frostney frostney deleted the cursor/environment-specific-test-failure-d434 branch March 8, 2026 00:55
@frostney frostney added the bug Something isn't working label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants