On Mon, Apr 18, 2011 at 11:05, Brendan Eich <bren...@mozilla.com> wrote: > Given the primary problem is not ASI but its absence where users expect it > due to mistakenly believing a newline is significant, one could argue the fix > is not to ban ASI and tax everyone with writing lots of insignificant > semicolons (in some opt-in mode hardly anyone would use, which would only > crud up implementations' parser state spaces). > > One could argue instead that we need *more* newline signfiicance.
Yes. This is the sanest thing I've read in this thread. How about this? "use superasi" Result: 1. /\n\s*[\[\(+*\/-]/ is a syntax error. (Or should it silently do ASI here? Not sure.) 2. /;\s+\n/ is a syntax error. (No extraneous semicolons.) This would enforce proper use of ASI, and turn off the problems where statements are confusingly not ended by \n. (Starting a line with a "." should still be allowed, since that is not otherwise a valid construction, and thus not easily confused.) Arguments for: 1. Mostly backwards compatible, except in the case which everyone seems to agree is a language defect. 2. Prevents the wtfs that are cited as being due to ASI. 3. Encourages developers to know the language they're using. Arguments against: 1. Ew. There aren't semicolons there. --i _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss