From:  "Mike" <>
Date:  14 Jul 2006 23:06:06 Hong Kong Time

Re: Load global functions from js file for later use in evaluateString calls


thanks for the reply.

I have had a look at compiling some code to the Function class, but I
wan't to do it the other way around, by having java code in a String
calling a custom js function. If I am not mistaken that isn't possible
with the Function object is it?

Noticed that this group was dead, and sent a copy of the original
message to the dev newsgroup.


Meandron wrote:
> Hi Mike,
> I don't know if it works (as I never tried it myself), but perhaps you
> could use compileFunction(see API for params), which is a method of
> Context objects and returns a Function object.
> Using that Function object you then can call call(again see API for
> params).
> It's possible to set parameters to the function you want to call.
> Hope, this is useful to you!
> Greetings,
> Matthias
> P.S. The Rhino- newsgroup switched to In
> order to get your postings read, you should think about a switch, too
> :-).