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

Rice

On 11/13/06, Mark Lundquist <[EMAIL PROTECTED] > wrote:

On Nov 12, 2006, at 1:31 AM, I wrote:

> [...snip] Here's a patch you can try.  [...snip]

Do'h. my bad!  I didn't realize when I sent you that diff that I was in
the middle of changing the code from its first working form.   Sorry
for going off half cocked; here's a version that actually works... :-/

===================================================================
---
src/java/org/apache/cocoon/components/flow/_javascript_/fom/
FOM_JavaScriptInterpreter.java    (revision 472699)
+++
src/java/org/apache/cocoon/components/flow/_javascript_/fom/
FOM_JavaScriptInterpreter.java    (working copy)
@@ -69,6 +69,7 @@
  import java.io.InputStreamReader;
  import java.io.OutputStream;
  import java.io.PushbackInputStream;
+import java.io.StringReader;
  import java.io.Reader;
  import java.util.ArrayList;
  import java.util.HashMap;
@@ -744,9 +745,17 @@
                      }
                      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.compileReader (
+                                    thrScope, new StringReader
(funName), null, 1, null
+                                ).exec (context, thrScope);
+                    } catch (EcmaError ee) {
+                       throw new ResourceNotFoundException (
+                            "Function \"_javascript_:" + funName + "()\"
not found"
+                        );
                      }

Cheers,
—ml—


Reply via email to