Versions Compared

Key

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

...

Any object can have this "method missing" hook method. When a method is called is not found on the object, this __noSuchMethod__ hook will be called.

 

...

Code Block
title__noSuchMethod__
var obj = {
  __noSuchMethod__: function() {
    for (i in arguments) {
       print(arguments[i])
    }
}

obj.foo(2, 'hello'); // prints "foo", 2, "hello"

Typed Arrays

Nashorn implements typed arrays as specified at https://www.khronos.org/registry/typedarray/specs/latest/ For a tutorial presentation, please check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays (which includes non-standard StringView which is not implemented by nashorn). Among the typed array constructors, DataView ( https://www.khronos.org/registry/typedarray/specs/latest/#8 ) is not implemented in jdk8's nashorn. DataView is included in jdk8u-dev and so is expected to make it into jdk8u20 release.

...