Browse Source

added eval.

Nicolas Cannasse 19 years ago
parent
commit
da2ae2e211
1 changed files with 4 additions and 0 deletions
  1. 4 0
      std/js/Lib.hx

+ 4 - 0
std/js/Lib.hx

@@ -34,6 +34,10 @@ class Lib {
 		untyped __js__("alert")(js.Boot.__string_rec(v,""));
 		untyped __js__("alert")(js.Boot.__string_rec(v,""));
 	}
 	}
 
 
+	public static function eval( code : String ) : Dynamic {
+		return untyped __js__("eval")(code);
+	}
+
 	public static function setErrorHandler( f : String -> String -> Int -> Bool ) {
 	public static function setErrorHandler( f : String -> String -> Int -> Bool ) {
 		untyped onerror = f;
 		untyped onerror = f;
 	}
 	}