diff options
Diffstat (limited to 'src/proxyWorker.js')
-rw-r--r-- | src/proxyWorker.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/proxyWorker.js b/src/proxyWorker.js index b9f71614..29259552 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -8,7 +8,9 @@ function EventListener() { }; }; -var window = new EventListener(); +var window = this; +var windowExtra = new EventListener(); +for (var x in windowExtra) window[x] = windowExtra[x]; window.close = function() { postMessage({ target: 'window', method: 'close' }); @@ -58,3 +60,12 @@ document.createElement = function(what) { Module.canvas = document.createElement('canvas'); +Module.setStatus = function(){}; + +Module.print = function(x) { + postMessage({ target: 'stdout', content: x }); +}; +Module.printErr = function(x) { + postMessage({ target: 'stderr', content: x }); +}; + |