From 41bd496f5a56a4d88f4acd6a95aad3129f049e03 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 15 Mar 2012 18:05:09 +0000 Subject: [PATCH] JsFunction should have an equal method --- .../main/java/com/google/gwt/query/client/js/JsUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java index e7ca0871..e3ad1586 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java @@ -37,17 +37,19 @@ public class JsUtils { */ public static class JsFunction extends Function { private JavaScriptObject jso = null; - public JsFunction(JavaScriptObject f) { if (JsUtils.isFunction(f)) { jso = f; } } + public boolean equals(Object obj) { + return jso.equals(obj); + } + private native void exec(JavaScriptObject f, Object data) /*-{ f(data); }-*/; - public void f() { if (jso != null) { exec(jso, getData()[0]); @@ -246,7 +248,7 @@ public class JsUtils { * Check is a javascript object is a function */ public static native boolean isFunction(JavaScriptObject o) /*-{ - return o && typeof o == 'function' + return !!o && typeof o == 'function' }-*/; /** -- 2.39.5