From 3d4474825131e9e58e2e0df2e39a02f4c2ea03c8 Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Thu, 24 Jul 2003 09:06:44 +0000 Subject: [PATCH] Restoring NativeJavaMethod(Method, String) for backward compatibility. --- .../org/mozilla/javascript/NativeJavaMethod.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java b/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java index 764ae84dea3..cbe010641c5 100644 --- a/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java +++ b/js/rhino/src/org/mozilla/javascript/NativeJavaMethod.java @@ -41,11 +41,8 @@ import java.lang.reflect.*; import java.io.*; /** - * This class reflects Java methods into the JavaScript environment. It - * handles overloading of methods, and method/field name conflicts. - * All NativeJavaMethods behave as JSRef `bound' methods, in that they - * always operate on the object underlying the original NativeJavaObject - * parent regardless of any reparenting that may occur. + * This class reflects Java methods into the JavaScript environment and + * handles overloading of methods. * * @author Mike Shaver * @see NativeJavaArray @@ -56,18 +53,23 @@ import java.io.*; public class NativeJavaMethod extends BaseFunction { - public NativeJavaMethod(MemberBox[] methods) + NativeJavaMethod(MemberBox[] methods) { this.functionName = methods[0].getName(); this.methods = methods; } - public NativeJavaMethod(MemberBox method, String name) + NativeJavaMethod(MemberBox method, String name) { this.functionName = name; this.methods = new MemberBox[] { method }; } + public NativeJavaMethod(Method method, String name) + { + this(new MemberBox(method), name); + } + private static String scriptSignature(Object value) { if (value == null) {