webworker-threads
Advanced tools
Comparing version 0.4.6 to 0.4.7
{ | ||
"name": "webworker-threads", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"main": "build/Release/WebWorkerThreads.node", | ||
@@ -5,0 +5,0 @@ "description": "Lightweight Web Worker API implementation with native threads", |
@@ -25,17 +25,26 @@ function DispatchEvents(thread){ | ||
}, this.dispatchEvents = function(event, args, q, i, len){ | ||
var results$ = []; | ||
var e, results$ = []; | ||
if (q = thread._on[event]) { | ||
i = 0; | ||
len = q.length; | ||
while (i < len) { | ||
q[i++].apply(thread, args); | ||
} | ||
if (q = q.once) { | ||
q.once = undefined; | ||
try { | ||
i = 0; | ||
len = q.length; | ||
while (i < len) { | ||
results$.push(q[i++].apply(thread, args)); | ||
q[i++].apply(thread, args); | ||
} | ||
return results$; | ||
if (q = q.once) { | ||
q.once = undefined; | ||
i = 0; | ||
len = q.length; | ||
while (i < len) { | ||
results$.push(q[i++].apply(thread, args)); | ||
} | ||
return results$; | ||
} | ||
} catch (e$) { | ||
e = e$; | ||
return __postError({ | ||
message: e, | ||
filename: '', | ||
lineno: 0 | ||
}); | ||
} | ||
@@ -42,0 +51,0 @@ } |
@@ -14,2 +14,5 @@ function Worker(){ | ||
}); | ||
t.on('error', function(args){ | ||
return typeof this$.onerror === 'function' ? this$.onerror(args) : void 8; | ||
}); | ||
t.on('close', function(){ | ||
@@ -16,0 +19,0 @@ return t.destroy(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
242494
1763