]> source.dussan.org Git - gwtquery.git/commitdiff
Add utility method to run a native JS function
authorManolo Carrasco <manolo@apache.org>
Fri, 6 Mar 2015 18:57:16 +0000 (19:57 +0100)
committerManolo Carrasco <manolo@apache.org>
Mon, 9 Mar 2015 08:49:11 +0000 (09:49 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java

index e4acf8ee494fb8faf0f6508af40ae567ffda84b1..7817bcab23282fc66bd6414d7179a9eea7b96c0f 100644 (file)
@@ -228,6 +228,14 @@ public class JsUtils {
     }
   }
 
+  /**
+   * Execute a native javascript function.
+   */
+  public static <T> T exec(JavaScriptObject jsFunction, Object... args) {
+    assert isFunction(jsFunction);
+    return jsni(jsFunction, "call", jsFunction, args);
+  }
+
   /**
    * Assign a function to a property of the window object.
    */