diff --git a/js/rhino/src/org/mozilla/javascript/FunctionObject.java b/js/rhino/src/org/mozilla/javascript/FunctionObject.java index 517d31570cb..b59d3d5ca2c 100644 --- a/js/rhino/src/org/mozilla/javascript/FunctionObject.java +++ b/js/rhino/src/org/mozilla/javascript/FunctionObject.java @@ -219,6 +219,18 @@ public class FunctionObject extends BaseFunction return getArity(); } + /** + * Get Java method or constructor this function represent. + */ + public Member getMethodOrConstructor() + { + if (method != null) { + return method; + } else { + return ctor; + } + } + static Method findSingleMethod(Method[] methods, String name) { Method found = null;