Skip to content
Browse files

Cherry-pick: Not enough with checking existence of window.console. In…

… IE (depending of version/debugger), console object doesn't define log() and error()

from newbamboo/web-socket-js@2776dcf
  • Loading branch information...
1 parent 8ec2933 commit 6493b0c4b4d016268f1e00f4ec6c1468dc2f233e @gimite gimite committed Dec 4, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 web_socket.js
View
6 web_socket.js
@@ -8,8 +8,10 @@
if (window.WebSocket) return;
var console = window.console;
- if (!console) console = {log: function(){ }, error: function(){ }};
-
+ if (!console || !console.log || !console.error) {
+ console = {log: function(){ }, error: function(){ }};
+ }
+
if (!swfobject.hasFlashPlayerVersion("9.0.0")) {
console.error("Flash Player is not installed.");
return;

0 comments on commit 6493b0c

Please sign in to comment.
Something went wrong with that request. Please try again.