Use spread syntax instead of function apply

This commit is contained in:
Kevin Sawicki 2016-12-01 14:37:03 -08:00
parent f72942bff1
commit c8ff67ab75
12 changed files with 30 additions and 34 deletions

View file

@ -4,13 +4,11 @@ const {ipcMain} = require('electron')
// The history operation in renderer is redirected to browser.
ipcMain.on('ELECTRON_NAVIGATION_CONTROLLER', function (event, method, ...args) {
var ref
(ref = event.sender)[method].apply(ref, args)
event.sender[method](...args)
})
ipcMain.on('ELECTRON_SYNC_NAVIGATION_CONTROLLER', function (event, method, ...args) {
var ref
event.returnValue = (ref = event.sender)[method].apply(ref, args)
event.returnValue = event.sender[method](...args)
})
// JavaScript implementation of Chromium's NavigationController.