Good minifiers will not have a problem to perform ASI themselves. Browsers are not intended to check the code that is sent to them. They should try to compile and run the code as fast as possible, and not try to do code analytics for the developer. If you want to perform code analytics, use an external compiler (or IDE).
From: Mike Ratcliffe Sent: Monday, April 18, 2011 4:37 PM To: es-discuss@mozilla.org Subject: Re: Automatic Semicolon Insertion: value vs cost; predictabilityandcontrol; alternatives Jorge, I would opt in for warnings e.g. if I planned on minifying my web app in the future. Most web apps will burn in hell if they are missing semicolons when you minify them. On 04/18/2011 02:42 PM, Jorge wrote: On 18/04/2011, at 13:10, Peter van der Zee wrote: On Mon, Apr 18, 2011 at 12:34 PM, Jorge <jo...@jorgechamorro.com> wrote: What am I missing ? As far as the directive goes, they are opt-in. Old code won't be opting in. Other than that they have the same issues as "use strict" might have. But why would anyone want to opt-in to get warnings or even worse syntax errors for code like this that depends on ASI, where ASI is helping out : "die in hell ASI, i hate you with the fiery passion of a thousand burning suns."; // ^^^^^^^^^ the anti-ASI directive ^^^^^^^^^^ a= b c= d function e () { f() } *** Warning missing semicolon @ line #4,5 *** Warning missing semicolon @ line #5,5 *** Warning missing semicolon @ line #6,19 Or even worse, halt the program with a: Syntax error missing semicolon @ line #4,5 ? I understand that it would be quite interesting to get a warning/error in this case: a= b (c= d)(); ...only that there's no ASI in this case ! -- Jorge. _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -------------------------------------------------------------------------------- _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss