Closed
Bug 501873
Opened 17 years ago
Closed 8 years ago
if (window.event) gives a warning
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: akkzilla, Unassigned)
References
Details
Attachments
(1 file)
To make event handling code work in IE as well as mozilla, in the event handler I have:
if (window.event) e = window.event;
But in 3.5 that now throws an error. Isn't this supposed to be the right way to check for JS capabilities (rather than browser version sniffing)?
Will attach a small test. Make the error console visible (and clear it), then load the page. Hit shift-reload a few times if needed (it warns most times but not every time).
| Reporter | ||
Comment 1•17 years ago
|
||
> it warns most times but not every time
Ignore that part -- I was being dense. Of course it's the shift that shows the warning, not the reload (duh). Just type anything after loading the page to see the warning.
| Reporter | ||
Comment 2•17 years ago
|
||
Further clarification: you'll only see the warning if javascript.options.strict is true.
Comment 3•17 years ago
|
||
I suspect that this was caused by bug 480185. window is a XOW and before that bug, XOWs used to use OBJ_GET_PROPERTY directly. Now they use JS_GetPropertyById which overrides cx->resolveFlags.
This is a hole in the API -- I think I need to be able to pass resolve flags into the Get and Set hooks (it'd be doubly nice if I could pass in a "preserve the current value" flag since that's what wrappers really want).
| Assignee | ||
Updated•12 years ago
|
Assignee: general → nobody
Comment 4•8 years ago
|
||
This is fixed now.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•