Prefer event.returnValue to event.result for sync messages.

This commit is contained in:
Cheng Zhao 2013-09-20 21:24:04 +08:00
parent 50b5272354
commit b225a59a15
3 changed files with 6 additions and 4 deletions

View file

@ -16,9 +16,11 @@ class Ipc extends EventEmitter
ipc.send('ATOM_INTERNAL_MESSAGE', args...)
sendSync: (args...) ->
ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', 'sync-message', args...).result
msg = ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', 'sync-message', args...)
msg.returnValue ? msg.result
sendChannelSync: (args...) ->
ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', args...).result
msg = ipc.sendSync('ATOM_INTERNAL_MESSAGE_SYNC', args...)
msg.returnValue ? msg.result
module.exports = new Ipc