Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for...of array iteration #421

Open
kmhernan opened this issue Feb 13, 2018 · 7 comments
Open

Support for...of array iteration #421

kmhernan opened this issue Feb 13, 2018 · 7 comments

Comments

@kmhernan
Copy link

Could we support javascript for/of loops like:

for( i of inputs.children ) {
    // do stuff
}

Currently we get exception:

Caused by: org.rabix.bindings.cwl.expression.CWLExpressionException: missing ; after for-loop initializer (script#5) encountered while resolving expression:
milos-ljubinkovic pushed a commit that referenced this issue Feb 13, 2018
@milos-ljubinkovic
Copy link
Contributor

Got interested in this because we had some similar issues with js. Seems that the default js version in our interpreter is ancient and stuff like this goes away when it's changed to ES6. Pushed directly to develop with this change for v1.0 expressions.

@kmhernan
Copy link
Author

Oh great! Thanks.

@kmhernan
Copy link
Author

kmhernan commented Mar 1, 2018

v1.0.4-5 is ES56 but i'm still getting the error, is this expected?

@milos-ljubinkovic
Copy link
Contributor

milos-ljubinkovic commented Mar 6, 2018

Seems like rhino doesn't support all ES6 features http://mozilla.github.io/rhino/compat/engines.html

When we switch to nashorn it might work

@kmhernan
Copy link
Author

kmhernan commented Mar 6, 2018

Ah, good to know thanks @milos-ljubinkovic

@milos-ljubinkovic
Copy link
Contributor

I've checked and for (var i in x) is supported in rhino currently and java 9.01's nashorn doesn't support for ... of but might in the future

@mr-c
Copy link
Contributor

mr-c commented May 29, 2018

FYI: CWL v1.0 expressions are ECMAScript 5.1 only, not ES6.

https://www.commonwl.org/v1.0/CommandLineTool.html#Expressions

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

No branches or pull requests

3 participants