Closed
Bug 327156
Opened 19 years ago
Closed 19 years ago
[FIX]|window instanceof X| throws a lot (e.g. if window is not an instance of X)
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
()
Details
(Keywords: fixed1.8.1)
Attachments
(1 file)
1.76 KB,
patch
|
jst
:
review+
jst
:
superreview+
jst
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•19 years ago
|
||
Not sure about fixing on 1.8.0 branch, but we should fix on 1.8.1, imo.
Flags: blocking1.8.1?
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)
Assignee | ||
Comment 2•19 years ago
|
||
*** Bug 310344 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 3•19 years ago
|
||
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #218129 -
Flags: superreview?(jst)
Attachment #218129 -
Flags: review?(jst)
Attachment #218129 -
Flags: approval-branch-1.8.1?(jst)
Assignee | ||
Updated•19 years ago
|
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 4•19 years ago
|
||
Comment on attachment 218129 [details] [diff] [review]
Fix
r+sr=jst
Attachment #218129 -
Flags: superreview?(jst)
Attachment #218129 -
Flags: superreview+
Attachment #218129 -
Flags: review?(jst)
Attachment #218129 -
Flags: review+
Attachment #218129 -
Flags: approval-branch-1.8.1?(jst)
Attachment #218129 -
Flags: approval-branch-1.8.1+
Assignee | ||
Comment 5•19 years ago
|
||
Fixed trunk and 1.8.1 branch.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: blocking1.8.1?
Keywords: fixed1.8.1
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•