| <!doctype html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <title>JavaScript: Nashorn</title> |
| </head> |
| <body> |
| <h2>JavaScript: Nashorn</h2> |
| |
| <p><a href="https://docs.oracle.com/javase/10/nashorn/introduction.htm#JSNUG136">Nashorn</a> is a JavaScript interpreter that comes as part of your Java runtime. Its status is currently unclear as it is deprecated since Java 11. |
| However up to Java 14 it is still available. Nashorn does not provide a dedicated debug framework, therefore scripts can only be executed and not launched in debug mode using this engine. |
| Due to the nature of the Nashorn implementation in Java, a debugger implementation in EASE is impossible. |
| </p> |
| |
| <h3>JavaScript Compatibility</h3> |
| |
| <p>Nashorn claims to be fully compatible with ECMAScript 5.1 and includes some language features from ECMAScript 6. |
| </p> |
| |
| <h3>Special language features</h3> |
| |
| <h4>Built-in libraries</h4> |
| |
| <p>Nashorn comes with some standard libraries: |
| <ul> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math">Math</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp">RegExp</a></li> |
| <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON">JSON</a></li> |
| </ul> |
| </p> |
| |
| <h4>Java class interaction</h4> |
| |
| <p>Java classes on the classpath can directly be used when accessed with their full qualified name (eg. <i>java.io.File</i>). Typical top level package names will be detected automatically, eg com.*, org.*, java.*. In case your package is not detected as it may start with an unusual top level name, you may access it via the <i>Packages.<full qualified name></i> syntax.</p> |
| </p> |
| </body> |
| </html> |