rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
551 stars 94 forks source link

Miscompilation of for statement #37

Closed lelit closed 11 years ago

lelit commented 12 years ago

The following code gets miscompiled by current slimit

var i=0;
for(i; i<10; i++) {}

as it emits something like

var i=0;
for(i i<10; i++) {}

I found such a (silly) construct in the ExtJS sources.

miketaylr commented 11 years ago

I'm running into the same issue:

for(P||(P=[]);d<b;) {
    foo();
}

-->

for (P || (P = []) d < b; ) {
  foo();
}

Which naturally results in: Uncaught SyntaxError: Unexpected token <

miketaylr commented 11 years ago

Sorry not awake yet... I realize the fix is in master now. Any ETA on a new release? ^_^

rspivak commented 11 years ago

Hey Mike,

I'll try to make a new release with some additional bug fixes by the end of next week.

miketaylr commented 11 years ago

That would be awesome. :)