Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Blue committed Jul 2, 2016
1 parent 4be2b4c commit 83840ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@
*/
function _createWorker(fn, otherScripts) {
otherScripts = otherScripts || [];

var blobArray = otherScripts.map(function (script) {
return 'self.' + script.name + '=' + script.method.toString() + ';';
});
blobArray = blobArray.concat(['self.onmessage=', fn.toString(), ';']);

var blob = new Blob(blobArray.concat(['self.onmessage=', fn.toString(), ';']), { type: 'text/javascript' });
var blob = new Blob(blobArray, { type: 'text/javascript' });
var url = URL.createObjectURL(blob);

return {
// the web worker instance
_shell: (function () {
var worker = new Worker(url);

//URL.revokeObjectURL(url);
URL.revokeObjectURL(url);

return worker;
})(),
Expand Down

0 comments on commit 83840ee

Please sign in to comment.