]> source.dussan.org Git - gwtquery.git/commitdiff
Simple Implementation of console.log
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Fri, 1 Nov 2013 19:05:43 +0000 (20:05 +0100)
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Fri, 1 Nov 2013 19:05:43 +0000 (20:05 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java

index 790afca3cce2b0364c8592eccad7287838021bb9..89b1ab57c21180c76177c72e9c46a2220853c785 100644 (file)
@@ -516,5 +516,15 @@ public class JsUtils {
     }
     return ret;
   }
+  
+  /**
+   * Dump an object to the browser console.
+   * 
+   * TODO: enable console in IE8 && IE9
+   * http://snipplr.com/view/67830/
+   */
+  public static native void log(Object o) /*-{
+    if ($wnd.console && typeof $wnd.console.log === 'function') $wnd.console.log('' + o);
+  }-*/;
 
 }