Closed Bug 986940 Opened 6 years ago Closed 6 years ago

Remove Cu.createArrayIn and Cu.createDateIn

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(2 files)

In bug 933681, I set things up so that we resolve standard classes on Xrayed globals. This means that you can now safely do:

new contentWindow.Date();
new contentWindow.Array();
new contentWindow.Object();

(Note that I also implemented eval, so you can do contentWindow.eval(foo) as well).

This means that Cu.createObjectIn, Cu.createArrayIn, and Cu.createDateIn are no longer very useful. The latter two are not widely used, and I think we can remove them. createObjectIn is more widely used, and has a few extra features, so I'll leave it for now.

Cu.createDataIn is not used in addons. Cu.createArrayIn is used by the b2g simulator, so I'm CCing myk to make sure he knows this is coming.
Depends on: 933681
(also note that Cu.cloneInto is a more powerful API that also subsumes all of these).
Summary: Remove Cu.createArrayIn and Cu.createDatein → Remove Cu.createArrayIn and Cu.createDateIn
When we switch ObjectWrapper.jsm to use Cu.cloneInto, this became unused.
Attachment #8395413 - Flags: review?(gkrizsanits)
Attachment #8395414 - Flags: review?(gkrizsanits)
(In reply to Bobby Holley (:bholley) from comment #0)
> In bug 933681, I set things up so that we resolve standard classes on Xrayed
> globals. This means that you can now safely do:
> 
> new contentWindow.Date();
> new contentWindow.Array();
> new contentWindow.Object();
> 
> (Note that I also implemented eval, so you can do contentWindow.eval(foo) as
> well).
> 
> This means that Cu.createObjectIn, Cu.createArrayIn, and Cu.createDateIn are
> no longer very useful. The latter two are not widely used, and I think we
> can remove them. createObjectIn is more widely used, and has a few extra
> features, so I'll leave it for now.
> 
> Cu.createDataIn is not used in addons. Cu.createArrayIn is used by the b2g
> simulator, so I'm CCing myk to make sure he knows this is coming.

Would be great to see a one liner summary of this under Components.utils.createObjectIn on MDN... And then we could slowly deprecate createObjectIn... and note Cu.cloneInto ofc, it's a very handy function.
Attachment #8395413 - Flags: review?(gkrizsanits) → review+
Attachment #8395414 - Flags: review?(gkrizsanits) → review+
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/0f8fbc309505
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/936b03713f6c


(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #5)
> Would be great to see a one liner summary of this under
> Components.utils.createObjectIn on MDN... And then we could slowly deprecate
> createObjectIn... and note Cu.cloneInto ofc, it's a very handy function.

Will seems to be the owner of these docs.
Flags: needinfo?(wbamberg)
https://hg.mozilla.org/mozilla-central/rev/0f8fbc309505
https://hg.mozilla.org/mozilla-central/rev/936b03713f6c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Sorry this took so long. I've added a note in https://developer.mozilla.org/en-US/docs/Components.utils.createObjectIn, let me know if it works for you.
Flags: needinfo?(wbamberg)
You need to log in before you can comment on or make changes to this bug.