- Loading...
...
Nashorn implements ECMAScript 5.1 specification http://www.ecma-international.org/ecma-262/5.1/
HTML non-normative version of the spec is here: http://es5.github.io/
Nashorn implements number of syntactic and API extensions as well. This page describes syntax and API extensions of nashorn implementation.
...
ECMAScript specifies Object.getPrototypeOf(obj) http://es5.github.io/#x15.2.3.2 function to get prototype of the given object. This Object.setPrototypeOf is a nashorn specific extension that allows prototype of an object to be set by as newProto. Object.setPrototypeOf is one of proposed extensions in ECMAScript 6.
...
Current executing script file, line, directory of the script can be accessed by these global (read-only) properties. This is useful in debug/tracing scripts. __DIR__ can be used like Unix 'dirname' command. Script can load script-file relative path resources using __DIR__.
| Code Block | ||
|---|---|---|
| ||
print(__FILE__, __LINE__, __DIR__) |
...