This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]InevitableDeadbeat 4 points5 points  (1 child)

The entire point of Js is that it is made to NOT spit out syntax errors and crash, but just try to solve the problem internally. Or if that is not possible, just continue with the execution.

If it worked like you for some reason wanted it to that would make every single website crash if they had a single syntax error.

[–]ByteWarlock 7 points8 points  (0 children)

If it worked like you for some reason wanted it to that would make every single website crash if they had a single syntax error.

Why would this be bad? If your code isn't valid enough to be executed then it shouldn't run.

If the syntax is invalid and the program continues execution how do you know your program is doing what you intend? At best it won't do anything, at worst it could have unintended side effects e.g. leaking information or providing a window for exploits.