Performance concern with let/const

François REMY fremycompany_pub at
Mon Sep 17 08:44:31 PDT 2012

(Just one opinion)

I'm all in favor of function-level parse errors. This reminds me an article 
of Ian Hickson where he wondered why, to the contrary of CSS, the ECMAScript 
language didn't define a generic syntax defining a well-formed program 
(tokens, parenthesis+brackets balance, ...) and which would replace any 
block he didn't understand by a { throw ParseError() } block.

    function A() {
        ooops {
            return 3;

would be the same as

    function() {
        do { throw new ParseError("..."); }

I don't say we need to go that far (in fact, ASI probably makes it 
impossible), but any progress made to more modularity and lazy compilation 
is good to take. 

More information about the es-discuss mailing list