4 ms·
My understanding (though I'm not an expert) is that the way the JavaScript spec is written, you first try to parse a line as is, and if you encounter a parsing
by timothya 13y ago
My understanding (though I'm not an expert) is that the way the JavaScript spec is written, you first try to parse a line as is, and if you encounter a parsing error in trying to do that and the line doesn't have a semicolon, then you insert a semicolon and you try again. The end result is that it's a bit different then semicolons being optional; they are instead inserted automatically to try to recover from parse errors.
- mattdawson 13y agoFWIW, this is also the way O'Reilly's JS Pocket Reference explains it.
- leetrout 13y agoThanks, that's what I had read. I also found this set of tests http://jsperf.com/asi-versus-msi http://jsperf.com/asi-versus-msi My results on Opera Next (v15) http://imgur.com/hkAopfX http://imgur.com/hkAopfX shows MSI fastest FWIW.