Closed Bug 764479 Opened 12 years ago Closed 12 years ago

DOMWifiManager.js: JavaScript Error: "NS_ERROR_FAILURE: Failure arg 0 [nsIDOMEventListener.handleEvent]

Categories

(Core :: DOM: Device Interfaces, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 764682

People

(Reporter: gwagner, Unassigned)

References

Details

I have seen this error now for a few days on sgs2:

E/GeckoConsole( 1835): [JavaScript Error: "NS_ERROR_FAILURE: Failure arg 0 [nsIDOMEventListener.handleEvent]" {file: "jar:file:///system/b2g/omni.ja!/components/DOMWifiManager.js" line: 187}]
I have the same error with mozApps.oninstall/onuninstall callback on a b2g desktop build, so it seems like something else is broken.
*Anything* rely on DOMEvent could be broken?? Oh damn.
I also see it on line 177:
E/GeckoConsole(  115): [JavaScript Error: "NS_ERROR_FAILURE: Failure arg 0 [nsIDOMEventListener.handleEvent]" {file: "jar:file:///system/b2g/omni.ja!/components/DOMWifiManager.js" line: 177}]
(In reply to Gregor Wagner [:gwagner] from comment #4)
> Hm shouldn't
> http://mxr.mozilla.org/mozilla-central/source/dom/wifi/nsIWifi.idl#113 be
> the same as
> http://mxr.mozilla.org/mozilla-central/source/dom/wifi/DOMWifiManager.js#255
> ?
> What happened to the status attribute?

That seems unrelated and I filed bug 764503 for that.
mrbkap found that after bug 761613 we can't implement eventlisteners in JS any more.
In particular, nsIDOMEvent is now marked as "bultinclass", so XPConnect refuses to create wrappers around JS objects implementing it. smaug, was that intentional? Is there any way we can fix this and maintain the simplicity you introduced?
Depends on: 761613
(In reply to Gregor Wagner [:gwagner] from comment #6)
> mrbkap found that after bug 761613 we can't implement eventlisteners in JS
> any more.
Very much not true. Most of the event listeners are implemented in JS.
(In reply to Blake Kaplan (:mrbkap) from comment #7)
> In particular, nsIDOMEvent is now marked as "bultinclass", so XPConnect
> refuses to create wrappers around JS objects implementing it. smaug, was
> that intentional? 
This was the whole point of the patch. We should not "implement" DOM events in JS.
Non of the event implementations in JS are true implementations. They are hacks.
nsIDOMWifiStatusChangeEvent implementation doesn't even pretend to implement nsIDOMEvent.
Its QI is missing nsIDOMEvent.

> Is there any way we can fix this and maintain the
> simplicity you introduced?
nsIDOMWifiStatusChangeEvent should not inherit nsIDOMEvent
Also, you need to change the hackish b2g onfoo handlers to not use nsIDOMEventListener, but
something similar which takes a b2g-non-dom-event as a parameter.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.