Explorar o código

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

This reverts commit 6ded3f624bfb7c57dd8ab3af9a05049ffaae9d43.
Bruno Garcia %!s(int64=10) %!d(string=hai) anos
pai
achega
9d80435bd2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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. *)
 	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 *)
 	let vars = [] in