HistoryMenu __proto__ assignment triggers: "chrome://...browser.js, line 4763: 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"

NEW
Unassigned

Status

()

defect
4 years ago
4 years ago

People

(Reporter: dholbert, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

4 years ago
Noticed this go by in my debug build's terminalspew:
{
JavaScript warning: chrome://browser/content/browser.js, line 4763: 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
}

This points to the __proto__ assignment here:

> 496 // View for the history menu.
> 497 function HistoryMenu(aPopupShowingEvent) {
> 498   // Workaround for Bug 610187.  The sidebar does not include all the Places
> 499   // views definitions, and we don't need them there.
> 500   // Defining the prototype inheritance in the prototype itself would cause
> 501   // browser.js to halt on "PlacesMenu is not defined" error.
> 502   this.__proto__.__proto__ = PlacesMenu.prototype;

http://mxr.mozilla.org/mozilla-central/source/browser/base/content/browser-places.js?rev=a3d02e44a476#502

Setting dependency on bug 632411, which added this chunk, and bug 610187, which is mentioned in the code-comment.
You need to log in before you can comment on or make changes to this bug.