Fix syntax error in the output of for statement with some form of expressions #45

Merged
merged 1 commit into from Mar 26, 2013

Conversation

Projects
None yet
2 participants
Contributor

harig commented Mar 26, 2013

The semi-colon in the initialiser part of the following for statements
were missing in the .to_ecma() output :

for(Q||(Q=[]);d<b;){d=1;}
for( 2 >> (foo ? 32 : 43) && 54;21;){ a = c;}
for(/^.+/g;cond();++z){ev();}
for((new Number("32"));f;g){}

Fixed by looking for the various AST classes so as to add a
semi-colon or not. Tests added.

@harig harig Fix syntax error in output of for statement with some expressions
The semi-colon in the initialiser part of the following for statements
were missing in the .to_ecma() output :

for(Q||(Q=[]);d<b;){d=1;}
for( 2 >> (foo ? 32 : 43) && 54;21;){ a = c;}
for(/^.+/g;cond();++z){ev();}
for((new Number("32"));f;g){}

Fixed by looking for the various AST classes in whether to add a
semi-colon or not.
38bbcd1

rspivak merged commit f652075 into rspivak:master Mar 26, 2013

Owner

rspivak commented Mar 26, 2013

Thanks a lot!

Owner

rspivak commented Mar 26, 2013

I've uploaded a new version with the bugfix to PyPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment