But also that code is the following:
nsjsenvironment.cpp NS_ScriptErrorReporter
> if (sameOrigin) {
> errorevent.errorMsg = msg.get();
> errorevent.lineNr = report->lineno;
> } else {
> errorevent.errorMsg = xoriginMsg.get();
> errorevent.lineNr = 0;
> }
>
> // Dispatch() must be synchronous for the recursion block
> // (errorDepth) to work.
> nsEventDispatcher::Dispatch(win, presContext, &errorevent, nsnull,
> &status);
I guess that this is sending an event that should be picked up by code like:
window.addEventListener('error', function echoErrors(event)
{
console.log("error event seen by testErrors:", event);
}, true);
However, the 'event' has no errorMsg or lineNr properties. As far as I
can tell it just says "error happened". How can the message be found?
Also, from within Firebug (extension space) I can add an event listener
but it does not get called. Any hints as to why?
jjb
Maybe. Window onerror is special and passes extra arguments. See
http://www.w3schools.com/JS/js_onerror.asp for example. So it's not
normal DOM event dispatch.
-Boris