Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Like other ECMAScript implementations (like Rhino, v8) Nashorn supports mutable __proto__ magic property to read and write prototype of a given object. See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto

__proto__ is deprecated. Please avoid using __proto__. Use Object.getPrototypeOf and Object.setPrototypeOf instead.

Object.setPrototypeOf(obj, newProto)

...

Code Block
title$ENV example
// print $JAVA_HOME and $PATH from the OS shell

print($ENV["JAVA_HOME"])
print($ENV["PATH"])
print($ENV.JAVA_HOME)
print($ENV.PATH)

Java object

"Java" global property is a script object that defines useful functions for script-to-Java interface.

...