Closed
Bug 496213
Opened 17 years ago
Closed 15 years ago
creating aliases in user-defined toSource breaks sharp objects
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: luke, Unassigned)
Details
Attachments
(1 file)
|
438 bytes,
application/javascript
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10
As explained on line 521 in jsobj.cpp (mozilla-central 6/3), after the initial mark phase of js_EnterSharpObject, there can be changes to properties. This is partially handled by line 528 adding new objects to the sharp map, but it doesn't correctly handle the possibility that the object may require a sharp.
Example 1:
var single = { single:1 };
var tricky1 = { toSource:function(){a[2]=single;return "tricky"} };
var a = [tricky1,single,0];
print("\'single\' duplicated: " + a.toSource());
print("OK after first time: " + a.toSource());
Example 2:
var tricky2 = { toSource:function(){a[1]=single;a[2]=single;return "tricky"} };
a = [tricky2,0,0];
print("\'single\' duplicated: " + a.toSource());
print("OK after first time: " + a.toSource());
Notice that, in the first one, the Mark procedure fails to indicate that a[1] should be prefixed with #1= by the time a[1] is written to the buffer.
Reproducible: Always
Steps to Reproduce:
Examples above attached.
Updated•17 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
| Reporter | ||
Comment 1•17 years ago
|
||
| Reporter | ||
Updated•15 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•