From: Manolo Carrasco Date: Fri, 6 Mar 2015 18:57:16 +0000 (+0100) Subject: Add utility method to run a native JS function X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd4a583480c7940459f5c489487fa8232dfb13e8;p=gwtquery.git Add utility method to run a native JS function --- 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 e4acf8ee..7817bcab 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 @@ -228,6 +228,14 @@ public class JsUtils { } } + /** + * Execute a native javascript function. + */ + public static 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. */