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

I do include the DOM API in my statement, but I do not include non-standardized browser APIs, which attachEvent seems to be.

I'll refine my statement to "The JS standard never introduces breaking changes".

attachEvent never was part of any standard, and is therefore subject to breakage. Non-standard APIs should never be part of a comprehensive guide to the language in the first place.



I was worried that leading with `attachEvent` would get a response about only `attachEvent`.

The `with` statement is described on page 75 of the ES3 standard[0]. It does not work in an ES Module or in a strict mode context. This is a breaking change.

[0]: https://www-archive.mozilla.org/js/language/E262-3.pdf


Strict mode was invented as a way of introducing a handful of "breaking" changes without them actually being breaking, since it's opt-in. JavaScript had some egregious design issues from the beginning and strict mode is a remedy to some of them.

But when most people say "breaking changes" they mean things that suddenly cause legacy code to stop working, and non-strict mode will almost certainly be supported ad infinitum, so I don't really count that. It's also almost certainly never going to happen again.




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

Search: