Set sender in EventEmitter.emit

This commit is contained in:
Cheng Zhao 2015-06-25 11:16:31 +08:00
parent fb5fe7a714
commit 2ea2413752
3 changed files with 6 additions and 6 deletions

View file

@ -33,12 +33,10 @@ wrapWebContents = (webContents) ->
# Dispatch IPC messages to the ipc module.
webContents.on 'ipc-message', (event, packed) ->
[channel, args...] = packed
Object.defineProperty event, 'sender', value: webContents
ipc.emit channel, event, args...
webContents.on 'ipc-message-sync', (event, packed) ->
[channel, args...] = packed
Object.defineProperty event, 'returnValue', set: (value) -> event.sendReply JSON.stringify(value)
Object.defineProperty event, 'sender', value: webContents
ipc.emit channel, event, args...
webContents.printToPDF = (options, callback) ->