diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-22 16:10:06 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-22 16:10:06 -0700 |
commit | c11c08094b855e8d6d00d84cbea0f4bf2b18ff72 (patch) | |
tree | 372dffb7a78a20848b18869be04b6a0060f1cd61 /src/postamble.js | |
parent | 9ff4aded21523a6ca1f3ae642cd70905d6fe8eef (diff) |
worker api closure fixes + additional testing
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/postamble.js b/src/postamble.js index 86c990e8..365f77d0 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -119,9 +119,9 @@ var buffer = 0, bufferSize = 0; var inWorkerCall = false, workerResponded = false, workerCallbackId = -1; onmessage = function(msg) { - var func = Module['_' + msg.data.funcName]; - if (!func) throw 'invalid worker function to call: ' + msg.data.funcName; - var data = msg.data.data; + var func = Module['_' + msg.data['funcName']]; + if (!func) throw 'invalid worker function to call: ' + msg.data['funcName']; + var data = msg.data['data']; if (!data.byteLength) data = new Uint8Array(data); if (!buffer || bufferSize < data.length) { if (buffer) _free(buffer); @@ -132,7 +132,7 @@ onmessage = function(msg) { inWorkerCall = true; workerResponded = false; - workerCallbackId = msg.data.callbackId; + workerCallbackId = msg.data['callbackId']; func(buffer, data.length); inWorkerCall = false; } |