Browse Source

Revert "Use typeof to check for console instead of eval."

This reverts commit 6ded3f624bfb7c57dd8ab3af9a05049ffaae9d43.
Bruno Garcia 10 years ago
parent
commit
9d80435bd2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      genjs.ml

+ 1 - 1
genjs.ml

@@ -1291,7 +1291,7 @@ let generate com =
 
 
 	(* Provide console for environments that may not have it. *)
 	(* Provide console for environments that may not have it. *)
 	if not (Common.defined com Define.JsEs5) then
 	if not (Common.defined com Define.JsEs5) then
-		spr ctx "var console = typeof console != \"undefined\" ? console : {log:function(){}};\n";
+		spr ctx "var console = (1,eval)('this').console || {log:function(){}};\n";
 
 
 	(* TODO: fix $estr *)
 	(* TODO: fix $estr *)
 	let vars = [] in
 	let vars = [] in