Closed Bug 819253 Opened 12 years ago Closed 11 years ago

The instanceof operator and QueryInterface should be consistent about new-binding objects not having classinfo

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: emk, Unassigned)

References

Details

Otherwise |new Foo() instanceof Ci.nsIFoo| will fail while |new Foo().QueryInterface(Ci.nsIFoo)| succeeds.
QueryInterface seems to be telling a lie about whatever IIDs other than nsIClassInfo. https://mxr.mozilla.org/mozilla-central/source/dom/bindings/BindingUtils.cpp?rev=3db4085a10b2#549
Yeah, we sort of hacked in QueryInterface initially... Maybe we need to sort this out better. Ideally, we'd stop exposing QueryInterface on WebIDL objects altogether; the worry is backwards compat issues.
Then regarding bug 818281, should I update the broken tests instead of depending on another hack?
Summary: nsJSIID::HasInstance should handle new-binding objects without classinfo → The instanceof operator and QueryInterface should be consistent about new-binding objects not having classinfo
Yes, I think that would be preferable... One thing to watch out for here, though, is extension compat issues. :(
This change was unnecessary.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.