Closed
Bug 853075
Opened 12 years ago
Closed 12 years ago
Self-hosted code can't call methods that are listed after first self-hosted function in method array
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: mozillabugs, Assigned: till)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
till
:
review+
till
:
checkin+
|
Details | Diff | Splinter Review |
Self-hosted code can't call methods that are listed after the first self-hosted function in the containing class's method array.
In the attached test case patch, testCallFilter calls Array.prototype.filter. filter is listed in array_methods after several self-hosted functions, lastIndexOf to reduceRight. Output from the js shell with this patch applied:
js> print([].testCallFilter)
function testCallFilter() {
[native code]
}
js> print([].testCallFilter())
typein:2:0 TypeError: undefined is not a function
After moving the entry for filter in array_methods to above lastIndexOf and rebuilding, you get the desired output:
js> print([].testCallFilter)
function testCallFilter() {
[native code]
}
js> print([].testCallFilter())
hello world!
Reporter | ||
Comment 1•12 years ago
|
||
The patches in bug 769871 add workarounds for this bug to the method arrays in jsstr.cpp, jsnum.cpp, and jsdate.cpp. The files should be cleaned up when this bug is fixed.
Assignee | ||
Comment 2•12 years ago
|
||
Well, this is embarrassing. Stopping the definition of a builtin's methods upon encountering the first self-hosted one might not actually be a good move. Not even during initialization of the self-hosting global ...
r=jonco via IRC
Assignee | ||
Updated•12 years ago
|
Assignee: general → tschneidereit
Assignee | ||
Updated•12 years ago
|
Attachment #730151 -
Flags: review+
Assignee | ||
Comment 3•12 years ago
|
||
Status: NEW → ASSIGNED
Reporter | ||
Comment 4•12 years ago
|
||
Attachment #730179 -
Flags: review?(tschneidereit)
Attachment #730179 -
Flags: checkin?(tschneidereit)
Assignee | ||
Comment 5•12 years ago
|
||
Comment on attachment 730179 [details] [diff] [review]
Remove workarounds
Review of attachment 730179 [details] [diff] [review]:
-----------------------------------------------------------------
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1de74b4a773
Attachment #730179 -
Flags: review?(tschneidereit)
Attachment #730179 -
Flags: review+
Attachment #730179 -
Flags: checkin?(tschneidereit)
Attachment #730179 -
Flags: checkin+
Comment 6•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Comment 7•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•