Invalid output when for loop's initialization expression is constant #40

Closed
rivol opened this Issue Dec 16, 2012 · 1 comment

Projects

None yet

1 participant

@rivol
rivol commented Dec 16, 2012

Slimit produces invalid output with this example:

function test(callback) {
    var index = 3, length = 5;
    for(index; index < length; index++) {
    }
  }

The output in this case is:

function test(callback){var index=3,length=5;for(indexindex<length;index++){}}

As you can see, the semicolon after init expr is missing.
In real world, infinity.js uses such syntax, see https://github.com/airbnb/infinity/blob/master/infinity.js

@rivol
rivol commented Dec 17, 2012

My bad, this is duplicate of #37
Waiting for 0.7.5 release :-)

@rivol rivol closed this Dec 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment