Closed Bug 610697 Opened 9 years ago Closed 9 years ago

Lazy resolution of standard classes changes the shape of Object.prototype

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla2.0b8

People

(Reporter: bzbarsky, Assigned: brendan)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

For example, when setting up the Number class, when we JS_DefineFunctions, we use Number.prototype as the parent for the new functions, which makes it a delegate after the first function is defined.  Then we add the properties one by one, and do shadowing shape changes when things like toString come through.
Blocks: 610583
Testing a patch. Care is required to maintain API compatibility for lusers such as XPConnect.

/be
Assignee: general → brendan
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
Target Milestone: --- → mozilla2.0b8
Attached patch proposed fixSplinter Review
Attachment #489245 - Flags: review?(mrbkap)
Comment on attachment 489245 [details] [diff] [review]
proposed fix

I like it!
Attachment #489245 - Flags: review?(mrbkap) → review+
(I'll fix the prottoype typo ;-)

/be
http://hg.mozilla.org/tracemonkey/rev/c146eeb9fecc

/be
Status: NEW → ASSIGNED
Whiteboard: fixed-in-tracemonkey
Very nice. I like it.
http://hg.mozilla.org/mozilla-central/rev/c146eeb9fecc
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.