Closed Bug 327156 Opened 18 years ago Closed 18 years ago
[FIX]|window instanceof X| throws a lot (e
.g . if window is not an instance of X)
The problem is that the classinfo for Window has: DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventReceiver) But that's not a scriptable (or indeed IDL!) interface. So in nsDOMConstructor::HasInstance when we call GetInfoForIID() on that interface we of course get nothing back. That causes: ###!!! ASSERTION: nsDOMConstructor::HasInstance can't get interface info.: 'Error', file ../../../../mozilla/dom/src/base/nsDOMClassInfo.cpp, line 4804 followed by a throw. In other words, the only way "window instanceof X" doesn't throw is if X is Window, JSWindow, or WindowInternal. It seems to me like the right way to fix this is to remove the classinfo for nsIDOMEventReceiver... or am I missing something? The other option would be to silently continue on lack of interface info, if we do need that interface in classinfo for window (or other non-idl interfaces in other classinfos). This isn't a recent regression or anything, which frankly amazes me.
Not sure about fixing on 1.8.0 branch, but we should fix on 1.8.1, imo.
Summary: Window instanceof X throws a lot (e.g. if Window is not an instance of X) → |window instanceof X| throws a lot (e.g. if window is not an instance of X)
*** Bug 310344 has been marked as a duplicate of this bug. ***
Priority: -- → P2
Summary: |window instanceof X| throws a lot (e.g. if window is not an instance of X) → [FIX]|window instanceof X| throws a lot (e.g. if window is not an instance of X)
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 218129 [details] [diff] [review] Fix r+sr=jst
Fixed trunk and 1.8.1 branch.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.