Skip to content

Conversation

@bserdar
Copy link
Contributor

@bserdar bserdar commented Mar 6, 2017

…field name

return new IfStatement(new SimpleExpression("typeof this.%s != 'undefined'", var),s);
StringBuffer b=new StringBuffer(64);
for(int i=0;i<var.length();i++) {
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this empty loop for?

@bserdar
Copy link
Contributor Author

bserdar commented Mar 6, 2017 via email

public void translateJS() throws Exception {
DBObject obj = expressionTranslator.translate(md, query("{'field':'field7.*.elemf1','op':'=','rfield':'field7.*.elemf2'}"));
Assert.assertEquals("function() {var r0=false;{if(typeof this.field7 != 'undefined'){for(var ri1=0;ri1<this.field7.length;ri1++){if(typeof this.field7 != 'undefined'){for(var ri2=0;ri2<this.field7.length;ri2++){r0=field7[ri1].elemf1 == field7[ri2].elemf2;if(r0){break;}}}if(r0){break;}}}}return r0;}",
Assert.assertEquals("function() {var r0=false;{if(typeof this.field7!='undefined'){for(var ri1=0;ri1<this.field7.length;ri1++){if(typeof this.field7!='undefined'){for(var ri2=0;ri2<this.field7.length;ri2++){r0=field7[ri1].elemf1 == field7[ri2].elemf2;if(r0){break;}}}if(r0){break;}}}}return r0;}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth touching this class just for spacing changes?

@bserdar
Copy link
Contributor Author

bserdar commented Mar 6, 2017 via email

@bserdar bserdar merged commit d8b0e61 into lightblue-platform:master Mar 6, 2017
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.

3 participants