google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.18k stars 580 forks source link

TypeError: Cannot read property 'transform' of undefined #1970

Closed ghost closed 9 years ago

ghost commented 9 years ago

I receive TypeError: Cannot read property 'transform' of undefined when trying to compile any code that follows this pattern:

while( true ) {
    let foo = 1;
    ( () => { foo; } )();
}

It seems to involve the following components:

  1. while loop (for loops seem unaffected)
  2. variable declared within loop using either let or const (var is fine)
  3. variable created in 2 is referenced inside a closure within the loop

I understand this code might be buggy or bad practice, but the error from Traceur is cryptic.

I am compiling using traceur v0.0.90 via grunt-traceur v0.5.4.

ghost commented 9 years ago

@arv Wow! You fixed that fast!

arv commented 9 years ago

...because I'm addicted to the "Wow!"s