-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b82
-
generic
-
generic
-
Verified
Nashorn supports function calls across script engines. When attempting such calls (and callbacks) from script, we get IllegalStateException from Global.instance() method. This suggests that either ScriptObject to mirror conversion or current global setup does not happen as expected.
Example:
r m = new javax.script.ScriptEngineManager();
var e = m.getEngineByName("nashorn");
var obj = {
func: function(str) {
return /hello/.exec(str);
}
};
e.put("obj", obj);
if (! e.eval("obj.func('hello')")) {
print("FAILED: obj.func('hello')");
}
e.eval("var foo = { callMe: function(callback) { callback() } }");
Example:
r m = new javax.script.ScriptEngineManager();
var e = m.getEngineByName("nashorn");
var obj = {
func: function(str) {
return /hello/.exec(str);
}
};
e.put("obj", obj);
if (! e.eval("obj.func('hello')")) {
print("FAILED: obj.func('hello')");
}
e.eval("var foo = { callMe: function(callback) { callback() } }");