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

RESOLVED DUPLICATE of bug 764682

Status

()

Core
DOM: Device Interfaces
RESOLVED DUPLICATE of bug 764682
6 years ago
6 years ago

People

(Reporter: gwagner, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 3

6 years ago
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}]
(Reporter)

Comment 5

6 years ago
(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.
(Reporter)

Comment 6

6 years ago
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?
(Reporter)

Updated

6 years ago
Depends on: 761613

Comment 8

6 years ago
(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.

Comment 9

6 years ago
(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.
(Reporter)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 764682
You need to log in before you can comment on or make changes to this bug.