Proposal: Modify automatic semicolon insertion in strict mode

Brendan Eich brendan at mozilla.com
Tue Dec 9 10:45:30 PST 2008


On Dec 9, 2008, at 10:26 AM, Brendan Eich wrote:

> Wrong:
>
> s = 'c';
> b = 42;
> c = 33;
> g = 1;
> Number.prototype.exec = function(s){var c=this; return eval(s);};
> a = b
> /c/g.exec(s);
> print(a);

Sorry, I'm wrong -- that doesn't show the problem. ASI only inserts on  
an error, and there's no error there. I thought there was a case not  
covered by ES3 that would parse yet change meaning without ASI,  
compared to with ASI. It looks like there is no such case, so you're  
right that only parse-ability needs to be tested.

That still means work for someone, possibly dealing with thousands of  
lines of code written by someone else. It's still an unmotivated  
migration tax.

Again, what problem are you trying to solve by removing ASI from  
strict mode? You didn't answer last time I asked.

/be


More information about the Es-discuss mailing list