Closed Bug 418638 Opened 14 years ago Closed 14 years ago
Bugs in JS shell functions scatter() and sleep()
To my shame I posted patch v11 in bug 404879 without testing the new snippet of code. It's even more busted than v9 and v10, of course. I also found some other minor bugs, poking around. scatter() passes PR_LOCAL_THREAD to PR_CreateThread; that should be PR_GLOBAL_THREAD. sleep() doesn't detect when it's passed 0 arguments. It doesn't do anything meaningful when an argument that isn't a number. It should throw in both cases.
Assignee: general → jorendorff
Status: NEW → ASSIGNED
Attachment #304579 - Flags: review?(crowder)
Changes the NaN check to use a macro.
Comment on attachment 304582 [details] [diff] [review] v2 Worth speculating about whether JSDOUBLE_IS_NaN should be public; but for another bug.
Attachment #304582 - Flags: review?(crowder) → review+
This additionally fixes a stupid crash when n==0, that is, scatter().
How about the right patch.
As we evolve toward JS2/ES4, ask yourself not what crazy loosy-goosey conversion would JS1 do, but what type annotations would you want on the function you are adding, and what built-in and few conversions might apply. /be
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.