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)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: luke, Unassigned)

Details

Attachments

(1 file)

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.
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
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.

Attachment

General

Created:
Updated:
Size: