Details
-
New Feature
-
Resolution: Fixed
-
P4
-
8
-
b100
-
generic
-
generic
-
Verified
Description
In node (https://kenai.com/jira/browse/NODEJS-59), there is the ability to set a JS Object as the global scope of an evaluated script.
Today, we can extend the global scope with some definitions but we can't provide a global instance.
A possible approach would have been to add __no_such_property to the evaluated script, provide a Well known mapping name for our global JS instance, and route to the instance.
This does work when getting property, but not for setting them.
So currently we don't have any solution.
A possible approach would be to have a JSObject being a Bindings. Something like:
var obj = {foo:2};
var newCtxt = new javax.script.SimpleScriptContext();
newCtxt.setBindings(obj, javax.script.SimpleScriptContext.ENGINE_SCOPE);
...
Today, we can extend the global scope with some definitions but we can't provide a global instance.
A possible approach would have been to add __no_such_property to the evaluated script, provide a Well known mapping name for our global JS instance, and route to the instance.
This does work when getting property, but not for setting them.
So currently we don't have any solution.
A possible approach would be to have a JSObject being a Bindings. Something like:
var obj = {foo:2};
var newCtxt = new javax.script.SimpleScriptContext();
newCtxt.setBindings(obj, javax.script.SimpleScriptContext.ENGINE_SCOPE);
...
Attachments
Issue Links
- relates to
-
JDK-8020324 Object.bindProperties(target, source) does not work when source object is a java bean
- Closed