Destructure params directly
This commit is contained in:
parent
43746727aa
commit
4127b524d5
2 changed files with 3 additions and 6 deletions
|
@ -124,12 +124,10 @@ let wrapWebContents = function(webContents) {
|
|||
};
|
||||
|
||||
// Dispatch IPC messages to the ipc module.
|
||||
webContents.on('ipc-message', function(event, packed) {
|
||||
const [channel, ...args] = packed;
|
||||
webContents.on('ipc-message', function(event, [channel, ...args]) {
|
||||
return ipcMain.emit.apply(ipcMain, [channel, event].concat(args));
|
||||
});
|
||||
webContents.on('ipc-message-sync', function(event, packed) {
|
||||
const [channel, ...args] = packed;
|
||||
webContents.on('ipc-message-sync', function(event, [channel, ...args]) {
|
||||
Object.defineProperty(event, 'returnValue', {
|
||||
set: function(value) {
|
||||
return event.sendReply(JSON.stringify(value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue