浏览代码

added debug()

Nicolas Cannasse 13 年之前
父节点
当前提交
8bbb1abc73
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      std/js/Lib.hx

+ 10 - 0
std/js/Lib.hx

@@ -34,6 +34,16 @@ class Lib {
 	public static var window : Window;
 	public static var window : Window;
 	static var onerror : String -> Array<String> -> Bool = null;
 	static var onerror : String -> Array<String> -> Bool = null;
 
 
+	/**
+		Inserts a 'debugger' statement that will make a breakpoint if a debugger is available.
+	**/
+	public static inline function debug() {
+		untyped __js__("debugger");
+	}
+
+	/**
+		Display an alert message box containing the given message
+	**/
 	public static function alert( v : Dynamic ) {
 	public static function alert( v : Dynamic ) {
 		untyped __js__("alert")(js.Boot.__string_rec(v,""));
 		untyped __js__("alert")(js.Boot.__string_rec(v,""));
 	}
 	}