Allow unprototyped JavaScript objects as macro handlers.
This commit is contained in:
parent
e3dfc52191
commit
76a07955d3
1 changed files with 7 additions and 0 deletions
|
@ -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('.', '_'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue