Hi Guys

I am trying this patch in 2_1_10-dev and it does not compile :

compile-core:
Compiling 1 source file to /Users/Shared/Development/Checkouts/Apache/ Cocoon/Cocoon_2_1_X/build/cocoon/classes /Users/Shared/Development/Checkouts/Apache/Cocoon/Cocoon_2_1_X/src/ java/org/apache/cocoon/components/flow/javascript/fom/ FOM_JavaScriptInterpreter.java:750: cannot find symbol symbol : method compileString (java.lang.String,<nulltype>,int,<nulltype>)
location: class org.mozilla.javascript.Context
fun = context.compileString (funName, null, 1, null).exec (context, thrScope);
                                     ^

The method signature looks correct according to this:
http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/ Context.html

Is this another possible issue with our customised Rhino ?

regards Jeremy

On 16 Nov 2006, at 16:56, Vadim Gritsenko wrote:

Jason Johnston wrote:
Mark Lundquist wrote:

On Nov 13, 2006, at 10:14 PM, Rice Yeh wrote:

Thank you. Will this patch go into the trunk eventually?

It's up to the committers. I'm sure they will take a look at it and decide if they think it's a good way.
I can't vouch for the patch, but I'll definitely give my +1 on having this feature. It's something I've wanted for a while, just never got around to submitting a request.

Even though same can be achieved in flow itself, it probably is a good usability feature so it worth adding it... WDYT?

Vadim


But if you want to try a trunk version, here it is. I couldn't get trunk to build, so you might have to fix this if it doesn't compile :-/

cheers,
—ml—

==================================================================
--- blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/ org/apache/cocoon/components/flow/javascript/fom/ FOM_JavaScriptInterpreter.java (revision 474689) +++ blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/ org/apache/cocoon/components/flow/javascript/fom/ FOM_JavaScriptInterpreter.java (working copy)
@@ -593,11 +593,19 @@
                     }
                     cocoon.setParameters(parameters);

- Object fun = ScriptableObject.getProperty (thrScope, funName);
-                    if (fun == Scriptable.NOT_FOUND) {
- throw new ResourceNotFoundException ("Function \"javascript:" + funName + "()\" not found");
+                    // Resolve function name
+                    //
+                    Object fun;
+                    try {
+ fun = context.compileString (funName, null, 1, null)
+                                         .exec (context, thrScope);
+                    } catch (EcmaError ee) {
+                       throw new ResourceNotFoundException (
+ "Function \"javascript:" + funName + "()\" not found"
+                        );
                     }


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to