Closed
Bug 1245141
Opened 8 years ago
Closed 8 years ago
Use `new Proxy` for AddonManager.addonTypes
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: evilpie, Assigned: evilpie)
References
Details
Attachments
(1 file, 2 obsolete files)
3.59 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #8714863 -
Flags: review?(dtownsend)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → evilpies
Comment 1•8 years ago
|
||
Comment on attachment 8714863 [details] [diff] [review] v1 - Change Proxy.create to new Proxy in AddonManagerInternal Review of attachment 8714863 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/extensions/AddonManager.jsm @@ +2675,5 @@ > + setPrototypeOf(target, prototype) { > + // Not allowed to change prototype > + return false; > + } > + }); Why does this create a new proxy every time?
Assignee | ||
Comment 2•8 years ago
|
||
Because we need a reference to AddonManagerInternal.types, which we can't get during initialization. We can't cache the proxy on AddonManagerInternal, because that object seems to be frozen. However this would work: let types = {} let AddonManagerInternal = { ... types, ... typesProxy: new Proxy(types, {...}) ... } Or we could move typesProxy to a global variable.
Comment 3•8 years ago
|
||
Comment on attachment 8714863 [details] [diff] [review] v1 - Change Proxy.create to new Proxy in AddonManagerInternal Review of attachment 8714863 [details] [diff] [review]: ----------------------------------------------------------------- I guess it doesn't matter much
Attachment #8714863 -
Flags: review?(dtownsend) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Turns out that the previous Proxy actually modified that value returned for [[Get]]. (We always return the `type` property) Sorry about that, but I did a try push this time. https://treeherder.mozilla.org/#/jobs?repo=try&revision=cc284c8eb5b7
Attachment #8714863 -
Attachment is obsolete: true
Attachment #8715004 -
Flags: review?(dtownsend)
Assignee | ||
Comment 5•8 years ago
|
||
Ups, right patch this time.
Attachment #8715004 -
Attachment is obsolete: true
Attachment #8715004 -
Flags: review?(dtownsend)
Attachment #8715468 -
Flags: review?(dtownsend)
Updated•8 years ago
|
Attachment #8715468 -
Flags: review?(dtownsend) → review+
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6515133eb252
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•