Skip to content

Commit

Permalink
fixes i'm not sure about
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Dec 22, 2014
1 parent a5d5bf3 commit 4395cda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions master.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ function Master(filename, options) {
proc.removeListener('message', onmessage)
proc.queue--
proc._maxListeners--
if ('value' in res) return resolve(res.value)
else reject(JSONToError(res.error))
if ('error' in res) return reject(JSONToError(res.error))
resolve(res.value)
})

proc.send({
Expand Down
3 changes: 1 addition & 2 deletions slave.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module.exports = function (fn) {
return
}

if (isGenerator(thing)) thing = co(thing)
Promise.resolve(thing).then(function (val) {
Promise.resolve(isGenerator(thing) ? co(thing) : thing).then(function (val) {
process.send({
id: m.id,
value: val
Expand Down

0 comments on commit 4395cda

Please sign in to comment.