Javascript bug in setTimeout, setInterval

RESOLVED DUPLICATE of bug 394769

Status

()

defect
--
major
RESOLVED DUPLICATE of bug 394769
10 years ago
10 years ago

People

(Reporter: my-tmp-email, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)

setTimeout, setInterval bug: they set arguments.length to 1, and arguments[0] is number, even if no parameters specified. Internet Explorer 8 work correctly.
Bug show himself when function pointed to setTimeout or setInterval, not string.
Steps to reproduce contain html file, you can try it in both Firefox and Internet Explorer.
 

Reproducible: Always

Steps to Reproduce:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Mozilla 3.5.2 bug</title>
<script>
    var obj= {};
    obj.call= function() {
        alert("correct value is '0, undefined':   " + arguments.length + ", " + arguments[0] );
    };
    setTimeout(obj.call, 1000);
</script>
</head>
<body>
</body>
Actual Results:  
1, number

Expected Results:  
0, undefined

discussion: http://forums.mozillazine.org/viewtopic.php?f=25&t=1443565
Priority: -- → P1
Whiteboard: javascript bug
Version: unspecified → 3.5 Branch
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a1pre) Gecko/20090826 Minefield/3.7a1pre

The testcase has the described result.
Assignee: nobody → general
Component: General → JavaScript Engine
Keywords: testcase
Priority: P1 → --
Product: Firefox → Core
QA Contact: general → general
Whiteboard: javascript bug
Version: 3.5 Branch → Trunk
Duplicate of bug 394769
Yep, good catch.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 394769
You need to log in before you can comment on or make changes to this bug.