Using window.onerror I don't have access to the stacktrace. to get the stacktrace I need to surround code by try and catch.
I may be able to use javascript to change all references to global functions and surround them by try and catch statements. surrounding each and every global function in the window namespace would probably create a performance hit. however doing the same for only a subset of functions may be easier. I may for example surround only functions that start with PMA_ and the functions in the AJAX object.
According to this test [0] the performance hit is not that great so it may not hurt to add try and catch to all methods but I don't like to play with code that I donot own since it may cause problems that I may not be able to understand.
What I am trying to ask is should I surround only PMA_ and AJAX functions or should I add some extra functions (such as jquery functions) to the list or should I skip this entirely and rely only on line number and file name from the window.onerror
On Wed, Jun 19, 2013 at 9:05 PM, Mohamed Ashraf mohamed.ashraf.213@gmail.com wrote:
Using window.onerror I don't have access to the stacktrace. to get the stacktrace I need to surround code by try and catch.
I may be able to use javascript to change all references to global functions and surround them by try and catch statements. surrounding each and every global function in the window namespace would probably create a performance hit. however doing the same for only a subset of functions may be easier. I may for example surround only functions that start with PMA_ and the functions in the AJAX object.
According to this test [0] the performance hit is not that great so it may not hurt to add try and catch to all methods but I don't like to play with code that I donot own since it may cause problems that I may not be able to understand.
What I am trying to ask is should I surround only PMA_ and AJAX functions or should I add some extra functions (such as jquery functions) to the list or should I skip this entirely and rely only on line number and file name from the window.onerror
I forgot to add the link to the js try and catch test [0] http://jsperf.com/try-catch-performance-overhead