💄 Use spread operator instead of arguments object

This commit is contained in:
Steve Kinney 2016-05-14 12:26:53 -04:00
parent 236810a923
commit fd9c9c3be7

View file

@ -101,6 +101,7 @@ BrowserWindow.getFocusedWindow = () => {
for (let window of BrowserWindow.getAllWindows()) { for (let window of BrowserWindow.getAllWindows()) {
if (window.isFocused()) return window if (window.isFocused()) return window
} }
return null
} }
BrowserWindow.fromWebContents = (webContents) => { BrowserWindow.fromWebContents = (webContents) => {
@ -118,20 +119,20 @@ BrowserWindow.fromDevToolsWebContents = (webContents) => {
// Helpers. // Helpers.
Object.assign(BrowserWindow.prototype, { Object.assign(BrowserWindow.prototype, {
loadURL () { loadURL (...args) {
return this.webContents.loadURL.apply(this.webContents, arguments) return this.webContents.loadURL.apply(this.webContents, args)
}, },
getURL () { getURL (...args) {
return this.webContents.getURL() return this.webContents.getURL()
}, },
reload () { reload (...args) {
return this.webContents.reload.apply(this.webContents, arguments) return this.webContents.reload.apply(this.webContents, args)
}, },
send () { send (...args) {
return this.webContents.send.apply(this.webContents, arguments) return this.webContents.send.apply(this.webContents, args)
}, },
openDevTools () { openDevTools (...args) {
return this.webContents.openDevTools.apply(this.webContents, arguments) return this.webContents.openDevTools.apply(this.webContents, args)
}, },
closeDevTools () { closeDevTools () {
return this.webContents.closeDevTools() return this.webContents.closeDevTools()
@ -145,8 +146,8 @@ Object.assign(BrowserWindow.prototype, {
toggleDevTools () { toggleDevTools () {
return this.webContents.toggleDevTools() return this.webContents.toggleDevTools()
}, },
inspectElement () { inspectElement (...args) {
return this.webContents.inspectElement.apply(this.webContents, arguments) return this.webContents.inspectElement.apply(this.webContents, args)
}, },
inspectServiceWorker () { inspectServiceWorker () {
return this.webContents.inspectServiceWorker() return this.webContents.inspectServiceWorker()