Closed
Bug 930523
Opened 11 years ago
Closed 11 years ago
createObjectIn should waive before returning
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: bholley, Assigned: gkrizsanits)
References
Details
Attachments
(1 file)
2.70 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
Gabor and I discussed this during our meeting today. Our eventual conclusion was that there's not really any point to forcing consumers to use .wrappedJSObject to add properties to an object that they've created. The two things you might want to do with an object created by createObjectIn are: (1) Define properties on it. (2) Export functions using exportFunction. (1) only works with a waiver, and does nothing useful without it. (2) is agnostic to the existence of a waiver. In particular, consumers are unlikely to be pulling content-side properties off these objects, which is the main hazard of adding waivers where they didn't previously exist (since the waivers might leak into objects that the consumer didn't expect). So I think we're good to do this.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #825343 -
Flags: review?(bobbyholley+bmo)
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 825343 [details] [diff] [review] createObjectIn should waive. v1 Review of attachment 825343 [details] [diff] [review]: ----------------------------------------------------------------- Make sure to run this through try if you haven't already. Also, please document this in the IDL and on MDN: https://developer.mozilla.org/en-US/docs/Components.utils.createObjectIn ::: js/xpconnect/tests/chrome/test_APIExposer.xul @@ +25,5 @@ > sandbox.is = is; > Cu.evalInSandbox("Object.defineProperty(Object.prototype, 'getProp', { get: function() { throw 'FAIL: called getter' }, set: function() { throw 'FAIL: called setter'; } })", sandbox); > > var obj = Cu.createObjectIn(sandbox); > + is(Object.getPrototypeOf(obj), Cu.waiveXrays(Cu.evalInSandbox("Object.prototype", sandbox)), Please also check |obj == Cu.waiveXrays(obj)|
Attachment #825343 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 3•11 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/9b23ec089b24 https://tbpl.mozilla.org/?tree=Try&rev=5b4c09cc96d2
Comment 4•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9b23ec089b24
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in
before you can comment on or make changes to this bug.
Description
•