diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-21 09:32:32 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-21 09:32:32 -0800 |
commit | 8e3586920f1ce0e279f277c0370baa59024846ca (patch) | |
tree | 7fbe2573bbe6a64d75e72c4c56b22c754360e661 /src | |
parent | cb7bdc3ea72f234d333e119ecd9fdb85b55faafe (diff) | |
parent | 3cc5ca09f2313b95cdf923da905abe87bd0b78fc (diff) |
Merge pull request #2136 from rjanicek/worker-console
Don't redefine console if it already exists like in Chrome worker.
Diffstat (limited to 'src')
-rw-r--r-- | src/proxyWorker.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 5d34b900..cfe0c26e 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -79,11 +79,13 @@ document.createElement = function document_createElement(what) { } }; -var console = { - log: function(x) { - Module.printErr(x); - } -}; +if (typeof console === 'undefined') { + var console = { + log: function(x) { + Module.printErr(x); + } + }; +} Module.canvas = document.createElement('canvas'); |