Open Bug 751627 Opened 8 years ago Updated 7 years ago

accessing Components.classes from content returns undefined, used to throw Permissions error

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

People

(Reporter: jgriffin, Unassigned)

References

Details

On the latest nightly, accessing Components.classes from content returns undefined.  In builds earlier than 4-16 (I'm not sure when between then and now this change was introduced), accessing it would throw a Permissions error.  Is this change intentional?

To reproduce:

On the latest nightly, open scratchpad and enter this script:

alert(Components.classes);

then execute it.

Results:  For the latest nightly, you get a dialog that says "undefined".  For builds earlier than 4-16 (and all older versions of Firefox), you'd get this error instead:

Exception: Permission denied for <https://bugzilla.mozilla.org> to get property XPCComponents.classes

This change was discovered in the context of Marionette tests for B2G, see bug 751406.
> Is this change intentional?

I don't think so.  Per bug 735280 it should still throw, I thought.

Gabor?
Blocks: 735280
(In reply to Boris Zbarsky (:bz) from comment #1)
> > Is this change intentional?

It is kind of intentional, I think I changed two tests as well. None of the wrappers throw on get property only on set, and I don't see why we should throw in this case. So right now the code is more consistent this way, and so far no one really had a problem with this behavior. If you think it's better to keep the old behavior or know some cases where this will cause problems, I can implement a follow up patch that throws. Thoughts?
I don't have a strong feeling about it, personally.
Duplicate of this bug: 799468
You need to log in before you can comment on or make changes to this bug.