diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-08 20:00:28 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-08 20:00:28 -0700 |
commit | 07151505da3206bd23101f25d05aba185e83c836 (patch) | |
tree | 953c1ff3323171ef5ead77fb5f6c2944686f456c /src/proxyWorker.js | |
parent | 2d0bd0061a4e57f999cf5c4bd537ffd8a2a0cdba (diff) |
test file preloading in worker
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 }); +}; + |