Use spread syntax instead of function apply
This commit is contained in:
parent
f72942bff1
commit
c8ff67ab75
12 changed files with 30 additions and 34 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue