1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
1.6K views
by ron-s-6919 (4.5k points)
What version of JavaScript does QIE support?  What is ECMAScript and what version does QIE support?

1 Answer

0 votes
 
Best answer
QIE uses the Mozilla Rhino based JavaScript engine that is included with the Java runtime.  The JavaScript version that is supported depends on which version of the Rhino engine is being used.
 
Java 6 supports the 1.6R2 Rhino version which supports JavaScript 1.5.
Java 7 supports the 1.7R3 Rhino version which supports JavaScript 1.8.
 
The Oracle versions of Java include a slightly modified version of the Rhino engine.  Details for what has been excluded can be found here for Java 6 and here for Java 7.
 
ECMAScript is the specification that the JavaScript language is based upon.  The ECMAScript edition that is supported depends on which version of JavaScript is supported.
 
JavaScript 1.5 & 1.7 support ECMAScript 3rd edition.
JavaScript 1.8 supports ECMAScript 5th edition.
 
More information about EMCAScript can be found here.
 
by ron-s-6919 (4.5k points)
selected by mike-r-7535
by ron-s-6919 (4.5k points)
The JavaScript array object did not introduce the indexOf() until JavaScript 1.6 ( see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf ).
by ron-s-6919 (4.5k points)
With Java 8, the Rhino based JavaScript engine has been replaced with Nashorn.  Nashorn is very similar to Rhino while being much more efficient.

Java 8 uses the Nashorn JavaScript engine which supports JavaScript 1.8 and ECMAScript 262 edition 5.1.

For details on changes that you may have to make in order for your custom scripts to run correctly, please review: https://www.qvera.com/kb/index.php/595/does-qie-run-under-java-8
by rich-c-2789 (17.6k points)
edited by rich-c-2789
To maintain backward compatibility in scripts QIE uses Rhino version 1.7.14 as of the date of this comment.  I believe when we are asked what version of Javascript is used that the answers above are a bit confusing.  To help clarify let me first explain that today I see to main version syntax used in reference to language feature support. ES6 and ES2015 which both refer to the same version of the ECMAScript spec that Javascript is based on.  Since, Rhino support is complicated to explain, it is better to reference the rhino compatibility table found here:

https://mozilla.github.io/rhino/compat/engines.html

Rhino fully supports up to ES5(2009) with limited support for later versions.  For versions ES6(2015) and later it is best to lookup the language feature of interest in the compatibility table to see if it is supported.
...