Closed
Bug 145779
Opened 22 years ago
Closed 22 years ago
Function.prototype.apply.length should return 2
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: pschwartau, Assigned: khanson)
References
Details
(Keywords: js1.5, Whiteboard: [Bug 145791 has been filed against Rhino for same issue])
Attachments
(1 file)
(deleted),
patch
|
rogerl
:
review+
brendan
:
superreview+
chofmann
:
approval+
|
Details | Diff | Splinter Review |
Function.prototype.apply has a FormalParameterList of length two:
Function.prototype.apply (thisArg, argArray)
Accordingly, Function.prototype.apply.length should return 2.
This is explicitly stated in Section 15.3.4.3 of ECMA-262 Edition 3.
See http://www.mozilla.org/js/language/ for a reference.
However, SpiderMonkey currently returns 1 instead of 2.
This was reported by igor3@apochta.com.
Reporter | ||
Comment 1•22 years ago
|
||
Testcase added to JS testsuite:
mozilla/js/tests/ecma_3/Function/regress-145779.js
OS: Windows NT → All
Whiteboard: [Bug 145791 has been filed against Rhino for same issue]
Reporter | ||
Comment 2•22 years ago
|
||
Igor has provided many specific tests of EMCA conformance for
both Function.prototype.apply and Function.prototype.call.
Following prevailing custom in the JS testsuite, I have CVS-deleted
mozilla/js/tests/ecma_3/Function/regress-145779.js
and added Igor's tests in the following two testcases:
mozilla/js/tests/ecma_3/Function/15.3.4.3-1.js
mozilla/js/tests/ecma_3/Function/15.3.4.4-1.js
which test ECMA-262 Edition 3
Section 15.3.4.3 (Function.prototype.apply)
Section 15.3.4.4 (Function.prototype.call)
In the current SpiderMonkey shell, test 15.3.4.4-1.js passes;
and test 15.3.4.3-1.js fails only on the section that tests
Function.prototype.apply.length:
FAILED!: Section 1 of test -
FAILED!: Expected value '2', Actual value '1'
Assignee | ||
Comment 3•22 years ago
|
||
Proposed patch.
Reporter | ||
Comment 4•22 years ago
|
||
cc'ing reviewers to r= this patch
Comment 5•22 years ago
|
||
Comment on attachment 89193 [details] [diff] [review]
changes table entry to indicate 2 args for apply
r=rogerl
Attachment #89193 -
Flags: review+
Comment 6•22 years ago
|
||
Comment on attachment 89193 [details] [diff] [review]
changes table entry to indicate 2 args for apply
sr=brendan@mozilla.org, please get drivers to approve this for the 1.0 branch.
/be
Attachment #89193 -
Flags: superreview+
Updated•22 years ago
|
Attachment #89193 -
Flags: approval+
Comment 7•22 years ago
|
||
Comment on attachment 89193 [details] [diff] [review]
changes table entry to indicate 2 args for apply
a=chofmann for 1.0.1 add fixed1.0.1 to the keywords after checking into the
branch
Comment 8•22 years ago
|
||
Checked into branch and trunk.
/be
Reporter | ||
Comment 9•22 years ago
|
||
Verified Fixed. Both testcases in Comment #2 now pass in the
debug and optimized SpiderMonkey shell.
Have verified the fix on the 1.0 branch as well. Used a
Mozilla 1.0 branch build from 2002-08-23, and javascript:URL
javascript:alert(Function.prototype.apply.length) ---> 2
Status: RESOLVED → VERIFIED
Keywords: verified1.0.1
Updated•19 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•