This is a useful function that will help us identify a script error on any webpage.
It uses a onerror event function to identify what sort of error happened and at what line. This can be helpful in coding to catch your errors.
I have messed around with the original example to see how the browsers deal with the error. It seems that the example above shown, it goes ahead and executes the program until the line of the error after which it throws the popup error message as expected.