Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Shouldn't calling `preventDefault` on an event marked passive throw an exception? It seems sloppy not to but maybe I'm missing something.


It should be logged as a warning but I don't think it should throw. Throwing obviously stops execution which is unlikely what the programmer intended. Javascript is, for better or worse, a permissive language. It doesn't like to break code when it doesn't have to.


Of course it was not what the programmer intended, it is an error.

Javascript currently throws on many kinds of errors.


It's truly the Visual Basic of our times. On Error Resume Next...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: