setTimeout and setInterval should not pass anything to their function by default

RESOLVED DUPLICATE of bug 394769

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 394769
9 years ago
9 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
setTimeout and setInterval seem to pass an int to their function when not given any arguments to pass. Worse still, the value changes randomly. Usually it's 0 or -1, but I've seen many other negative numbers.
(Reporter)

Comment 1

9 years ago
Created attachment 396220 [details]
testcase
(Reporter)

Comment 2

9 years ago
Sit and watch the testcase, and you'll see it intermittently change from green to red and back again.
Confirmed on Linux m-c trunk, as well as in Firefox 2. :)

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20090820 Minefield/3.7a1pre
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.18) Gecko/20081029 Firefox/2.0.0.18
OS: Mac OS X → All
Hardware: x86 → All
Assignee: nobody → general
Component: Virtual Machine → JavaScript Engine
Product: Tamarin → Core
QA Contact: vm → general
Version: unspecified → Trunk
Old Netscape extension, it's the "lateness" of the timeout. From Netscape 3 or 4. Time to lose it.

/be

Comment 5

9 years ago
I'll mention bug 394769 here as Gavin added a number of CCs who may be interested.

Traditionally this has been bug 10637
I suggest duping this to bug 394769 and confirming that bug; we can let bug 10637 stand for its day when it was indeed WONTFIX. Thanks for finding these bugs.

/be
(Reporter)

Updated

9 years ago
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 394769
(Reporter)

Comment 8

9 years ago
Should that bug be moved to JavaScript Engine, Brendan?
(In reply to comment #8)
> Should that bug be moved to JavaScript Engine, Brendan?

No, setTimeout and related APIs are DOM APIs, the JS engine doesn't have anything to do with them (other than running the timeout, of course!).
You need to log in before you can comment on or make changes to this bug.