by tekkk · 8y ago · 0 comments
One thing bothering me about reading the API is the inconsistent way of adding semicolons. Not an important thing I'm sure and as my personal opinion I'd much rather have the examples without them. To me they are just waste of time. Also it makes the code look more like Python.
Anyway, looks great!
Removing ASI from ECMAScript would break backwards compatibility - modern JS engines couldn't run scripts that use ASI which would break a lot of websites that are alread deployed. ECMA will add features that won't run in old engines (older V8 can't parse arrow functions) but they won't add/remove/change features that break existing behavior.
Today there are code patterns where ASI is ambiguous, or at-least hard for a developer to grok. TC39 is warning developers that new language features will not be designed for ASI and might have confusing behavior if those new features are used without semicolons.
[this pull request]: https://github.com/tc39/ecma262/pull/1062/files
Closest thing I could find was this, which simply adds an ASI hazard clause: https://github.com/tc39/ecma262/pull/1062