10 biggest JS pitfalls

Brendan Eich brendan at mozilla.com
Mon Dec 31 11:03:42 PST 2012


I don't think ASI _per se_ is the problem. Rather, the restricted 
productions bite people:

   function foo() {
     return
       very + long + expression() + goes + here;
   }

and of course, the expectation of ASI where there's no error to correct:

   a = b
   (function () {
     ... // lots of lines
    })();

You could mean these by ASI, but the solution some people want is not 
mandatory semicolons, because that does nothing to help the second 
example above. Rather, we'd need *more* newline significance. That is 
where I want to take

http://wiki.ecmascript.org/doku.php?id=strawman:paren_free

but after ES6 is more in hand.

/be

Juan Ignacio Dopazo wrote:
> I'm surprised not to see Automatic Semicolon Insertion in the list.
>
> Juan
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list