Skip to content

Conversation

@harig
Copy link
Contributor

@harig 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.

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.
rspivak added a commit that referenced this pull request Mar 26, 2013
Fix syntax error in the output of for statement with some form of expressions
@rspivak rspivak merged commit f652075 into rspivak:master Mar 26, 2013
@rspivak
Copy link
Owner

rspivak commented Mar 26, 2013

Thanks a lot!

@rspivak
Copy link
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants