Rhino 1.7.14 supports ES6 functionalities like promises, but I am not able to use VERSION_ES6 flag

90 Views Asked by At

It is mentioned in Rhino 1.7.14 as Rhino can support ES6 features if VERSION_ES6 flag is used.

Flag to be used in Rhino 1.7.14

But there were no clear documentation of how & where to use the flag

I tried to use the Context.VERSION_ES6 flag to setLanguageVersion. https://github.com/workcraft/workcraft/issues/1367 But it didn't help me.

Am I trying the flag in a correct way ? Or should it be used in some other place ?

is there any other approach to make promises work in Rhino ?

I expect to unleash all the features of ES6 they can be provided by Rhino 1.7.14

1

There are 1 best solutions below

0
ibrabeicker On

I got it working on the parser with:

CompilerEnvirons compilerEnvirons = new CompilerEnvirons();
compilerEnvirons.setLanguageVersion(Context.VERSION_ES6);

but I don't execute it. If you need to run the code finding where you can pass this environs must not be too difficult.