Comment Comment by camus2 > This code will just ignore the error. While it is expected that the runtime error would float up and terminate the program - that is what runtime errors are made for.No, this behavior is consistent with how asynchronous programming works in JS. myDiv.addEventListener("click",function(event){ throw "error"; }); Nobody would expect that code to terminate a browser tab on error.> This also makes writing tests more difficult because tests often use exceptions to indicate failure.Then use async functions, problem solved. parent camus2 8 years ago
No, this behavior is consistent with how asynchronous programming works in JS.
Nobody would expect that code to terminate a browser tab on error.> This also makes writing tests more difficult because tests often use exceptions to indicate failure.
Then use async functions, problem solved.