From 76a07955d38e5b075d3ec90ef8964638507776f8 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 3 Sep 2003 10:05:21 +0000 Subject: [PATCH] Allow unprototyped JavaScript objects as macro handlers. --- src/helma/scripting/rhino/RhinoEngine.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index b9634282..ebafb5ed 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -336,6 +336,13 @@ public class RhinoEngine implements ScriptingEngine { */ public boolean hasFunction(Object obj, String fname) { // System.err.println ("HAS_FUNC: "+obj+"."+fname); + if (obj instanceof Scriptable) { + Scriptable scrpt = (Scriptable) obj; + Object func = scrpt.get(fname, scrpt); + if (func != null && func instanceof Function) { + return true; + } + } return core.hasFunction(app.getPrototypeName(obj), fname.replace('.', '_')); }