Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do JS Reference Errors stop runtime thread execution?

Tags:

javascript

Since JS normally runs on only one thread, can a reference error from one script block subsequent JS execution as other scripts are evaluated?

Thanks!

like image 448
4m1r Avatar asked Feb 02 '26 01:02

4m1r


1 Answers

Separate scripts are evaluated separately, so no (unless of course the error in the first script broke something that the second script depended on).

The error itself will only break the current execution of code. Even other code in the same script can continue to function if otherwise unencumbered. (For example event handlers that were bound and were not directly affected by the error.)

like image 104
cookie monster Avatar answered Feb 03 '26 15:02

cookie monster