From 875a2ef797c44dc62b8ee1f9900c450da307ab6d Mon Sep 17 00:00:00 2001 From: Richard Janicek Date: Tue, 18 Feb 2014 20:50:49 -0500 Subject: Don't redefine console if it already exists like in Chrome worker. --- src/proxyWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 5d34b900..b95f05e9 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -79,7 +79,7 @@ document.createElement = function document_createElement(what) { } }; -var console = { +var console = console || { log: function(x) { Module.printErr(x); } -- cgit v1.2.3-18-g5258 From 3cc5ca09f2313b95cdf923da905abe87bd0b78fc Mon Sep 17 00:00:00 2001 From: Richard Janicek Date: Tue, 18 Feb 2014 21:57:43 -0500 Subject: fixed console detection so it does not throw tested in Chrome and Firefox --- src/proxyWorker.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/proxyWorker.js b/src/proxyWorker.js index b95f05e9..cfe0c26e 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -79,11 +79,13 @@ document.createElement = function document_createElement(what) { } }; -var console = console || { - log: function(x) { - Module.printErr(x); - } -}; +if (typeof console === 'undefined') { + var console = { + log: function(x) { + Module.printErr(x); + } + }; +} Module.canvas = document.createElement('canvas'); -- cgit v1.2.3-18-g5258