It looks like some operations that are available for native Nashorn
objects, are not implemented for JSObject.
For example, following script works and prints '6': engine.eval("var
obj={};var key={}; obj[key]=6;print(obj[key])");
In case when 'obj' is an implementation of JSObject, the script runs
without any error, printing 'null'.
SM