I have a hard-to-locate bug affecting a JS code-base; periodically, an array is accessed out-of-bounds, which causes a TypeError: initial[data[(i + offset)]] is undefined error (note: similar indexing is found in dozens of places). Is there any way to make errors fatal and stop execution at that point so that the stack trace can be examined?
How can I force these warnings to become errors without adding throws() or if-statements all around the code-base? Is there any way to force a “strict” operation, something like the -Wall -Wfatal-errors flags found in gcc?
I am using the latest stable FireBug+Firefox, but could transition to the Chrome console if there are any mechanisms there.
Just enable break on… all errors.
Chrome Devtools and Opera Dragonfly provide similar options.