Wednesday, June 16, 2010

Firefox/3.5.6 window.onerror (MDC docs buggy as well)

https://developer.mozilla.org/en/DOM/window.onerror#Parameters
funcRef is a reference to a function. When the function returns true, this prevents the firing of the default event handler. Function parameters:
Error message (string)
Url where error was raised (string)
Line number where error was raised (number)
Question is What the "raised" means ?
In MSIE it means "thrown" (that is the word). In FF it means where new Error() was called.

Tested on:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)


Testcase available for those interesed (mail me).

You may be interesed in this as well:
https://bugzilla.mozilla.org/show_bug.cgi?id=355430


https://developer.mozilla.org/en/DOM/window.onerror#Parameters
funcRef is a reference to a function. When the function returns true, this prevents the firing of the default event handler. Function parameters:
Error message (string)
Url where error was raised (string)
Line number where error was raised (number)

The problem: What the "raised" means ?

In MSIE it means "thrown" (that is the word). In FF it means where new Error() was called.

Tested on:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)


Testcase available for those interesed (mail me).

You may be interesed in this as well:
https://bugzilla.mozilla.org/show_bug.cgi?id=355430

I have had a look at "solution" presented here:
http://github.com/emwendelin/javascript-tacktrace#readme but this
Some people recommend just assigning it to window.onerror:

window.onerror = function() {
alert(printStackTrace().join('\n\n'));
}

will not work in FF, just because of mentioned stack bug.

So all you will learn with the stacktrace.js sample is:

run(null)
printStackTrace
onerror

That your on error was called and it called printstacktrace and run.
You will not learn who called your onerror handler.

No comments:

Post a Comment