Toplevel 'let' binding can be left permanently uninitialized after an error

Jason Orendorff jason.orendorff at
Tue Sep 30 03:52:59 PDT 2014

I just realized this has an unfortunate implication for REPLs. Suppose
you make this typo:

    js> let x = Math.cso(a)    // oops, TypeError, should be Math.cos

Now x is irreparably hosed in your REPL. That seems bad.

I guess we can fix this by making the REPL bend the rules of the
language. But this is rather hard to do for REPLs implemented in JS.
Maybe the rules should just be a little more forgiving.


More information about the es-discuss mailing list