Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
This is the suggestion as distilled from the mailing list:
a) Add the return value to the eval() method
b) Wwe create a new SlingScript.call(String method,
Object... args) method which will be implemented such, that a new
(virtual) script is created from the original script appended with the
method call.
Example: Let the script source be
function sampleFunction()
{ ... }function anotherFunction(arg1, arg2) { ... }
Now, we call script.call("sampleFunction", null).
This would result in the virtual (combined) script:
function sampleFunction()
{ ... }function anotherFunction(arg1, arg2) { ... }
sampleFunction();
Likewise, calling script.call("anotherFunction", 5, "astring") would get
the virtual script:
function sampleFunction()
{ ... }function anotherFunction(arg1, arg2) { ... }
anotherFunction(5, "astring");
To build the method call, we may use the
ScriptEngineFactory.getMethodCallSyntax().
Finally the virtual script is actually evaluated.
This would also allow this for any scripting language ...