bunny
bunny copied to clipboard
Support for...of array iteration
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:
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.
Oh great! Thanks.
v1.0.4-5 is ES56 but i'm still getting the error, is this expected?
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
Ah, good to know thanks @milos-ljubinkovic
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
FYI: CWL v1.0 expressions are ECMAScript 5.1 only, not ES6.
https://www.commonwl.org/v1.0/CommandLineTool.html#Expressions