Closed Bug 1016132 Opened 6 years ago Closed 6 years ago

Port |Bug 985742 - fuelApplication.js:1512 - mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create| to SeaMonkey

Categories

(SeaMonkey :: General, defect)

defect
Not set

Tracking

(seamonkey2.26 unaffected, seamonkey2.27 affected, seamonkey2.28 fixed, seamonkey2.29 fixed, seamonkey2.30 fixed)

RESOLVED FIXED
seamonkey2.30
Tracking Status
seamonkey2.26 --- unaffected
seamonkey2.27 --- affected
seamonkey2.28 --- fixed
seamonkey2.29 --- fixed
seamonkey2.30 --- fixed

People

(Reporter: iann_bugzilla, Assigned: neil)

Details

Attachments

(1 file, 4 obsolete files)

STR
1/ Start recent SeaMonkey trunk build
2/ Instantiate somehow the Application Object
3/ Check console output

Actual result
System JS : WARNING file:///home/gizmo/central/sm-opt/mozilla/dist/bin/components/smileApplication.js:1519 - mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

Expected result
No error about smileApplication.js
Attached patch Simple port (obsolete) — Splinter Review
Simple port of patch from bug 985742
Assignee: nobody → iann_bugzilla
Status: NEW → ASSIGNED
Attachment #8428933 - Flags: review?(neil)
Attached patch Fixed simple port (obsolete) — Splinter Review
Fixed typo in function app_observe getPrototypeof vs getPrototypeOf
Attachment #8428933 - Attachment is obsolete: true
Attachment #8428933 - Flags: review?(neil)
Attachment #8428943 - Flags: review?(neil)
Attached patch Alternate approach (obsolete) — Splinter Review
Attached patch Another approach (obsolete) — Splinter Review
This works by creating an object whose prototype is extApplication.prototype but has the properties copied from the ApplicationPrototype object. Unfortunately there's no Object.getOwnPropertyDescriptors function so I have to reduce the own property names manually.
Attachment #8431161 - Flags: review?(iann_bugzilla)
Actually, there's another way: { (__proto__: {} }) doesn't warn, because it's the equivalent of creating an object with a given prototype (bug 948583).
Attached patch Proposed patchSplinter Review
Attachment #8434927 - Flags: review?(iann_bugzilla)
Note that bug 992958 regressed bug 948227 on trunk, so you'll need an older build in order to see the warning.
And I wondered why I no longer see the warning for the steelApplication in TB, right when I wanted to fix it with some of your methods here...
Attachment #8428943 - Flags: review?(neil)
Assignee: iann_bugzilla → neil
Comment on attachment 8434927 [details] [diff] [review]
Proposed patch

This looks cleaner than the other option and presumably stops code running slowly.
Attachment #8434927 - Flags: review?(iann_bugzilla) → review+
Comment on attachment 8431161 [details] [diff] [review]
Another approach

I prefer the other option.
Attachment #8431161 - Flags: review?(iann_bugzilla) → review-
Checkin-needed?
Attachment #8428943 - Attachment is obsolete: true
Attachment #8431142 - Attachment is obsolete: true
Attachment #8431161 - Attachment is obsolete: true
Pushed comm-central changeset 5dc9edfc4261.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.30
Comment on attachment 8434927 [details] [diff] [review]
Proposed patch

[Approval Request Comment]
Regression caused by (bug #): 948227
User impact if declined: None (cosmetic warning in Error Console only)
Testing completed (on m-c, etc.): Landed on c-c
Risk to taking this patch (and alternatives if risky): Low (Application isn't used by SeaMonkey itself)
String changes made by this patch: None
Attachment #8434927 - Flags: approval-comm-beta?
Attachment #8434927 - Flags: approval-comm-aurora?
Comment on attachment 8434927 [details] [diff] [review]
Proposed patch

a=me
Attachment #8434927 - Flags: approval-comm-beta?
Attachment #8434927 - Flags: approval-comm-beta+
Attachment #8434927 - Flags: approval-comm-aurora?
Attachment #8434927 - Flags: approval-comm-aurora+
You need to log in before you can comment on or make changes to this bug.