]> khamidou — GitHub mirrors - electron.git/commitdiff
Unpack the arguments in ipc message
authorCheng Zhao <zcbenz@gmail.com>
Thu, 15 Jan 2015 03:33:24 +0000 (19:33 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 15 Jan 2015 03:33:24 +0000 (19:33 -0800)
atom/browser/api/lib/web-contents.coffee

index 5ed80a54ab01a7721141263a614676ffb91eace2..5217a7b386de0f87fe9a44d9a66e42383b99842a 100644 (file)
@@ -48,10 +48,12 @@ module.exports.wrap = (webContents) ->
     process.emit 'ATOM_BROWSER_RELEASE_RENDER_VIEW', "#{processId}-#{routingId}"
 
   # Dispatch IPC messages to the ipc module.
-  webContents.on 'ipc-message', (event, channel, args...) ->
+  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, channel, 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...