Remove returns from event listeners

This commit is contained in:
Kevin Sawicki 2016-05-19 15:28:08 -07:00
parent a2b6731bf2
commit cc7395eea8
15 changed files with 34 additions and 36 deletions

View file

@ -45,7 +45,7 @@ if (process.platform === 'darwin') {
const events = ['login', 'certificate-error', 'select-client-certificate']
for (let name of events) {
app.on(name, (event, webContents, ...args) => {
return webContents.emit.apply(webContents, [name, event].concat(args))
webContents.emit.apply(webContents, [name, event].concat(args))
})
}

View file

@ -55,7 +55,7 @@ var spawnUpdate = function (args, detached, callback) {
errorEmitted = false
spawnedProcess.on('error', function (error) {
errorEmitted = true
return callback(error)
callback(error)
})
return spawnedProcess.on('exit', function (code, signal) {
spawnedProcess = undefined
@ -72,7 +72,7 @@ var spawnUpdate = function (args, detached, callback) {
}
// Success.
return callback(null, stdout)
callback(null, stdout)
})
}

View file

@ -23,7 +23,7 @@ BrowserWindow.prototype._init = function () {
width: 800,
height: 600
}
return ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, disposition, options)
ipcMain.emit('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, disposition, options)
})
// window.resizeTo(...)

View file

@ -125,7 +125,7 @@ let wrapWebContents = function (webContents) {
// Dispatch IPC messages to the ipc module.
webContents.on('ipc-message', function (event, [channel, ...args]) {
return ipcMain.emit.apply(ipcMain, [channel, event].concat(args))
ipcMain.emit.apply(ipcMain, [channel, event].concat(args))
})
webContents.on('ipc-message-sync', function (event, [channel, ...args]) {
Object.defineProperty(event, 'returnValue', {
@ -141,9 +141,8 @@ let wrapWebContents = function (webContents) {
// Handle context menu action request from pepper plugin.
webContents.on('pepper-context-menu', function (event, params) {
var menu
menu = Menu.buildFromTemplate(params.menu)
return menu.popup(params.x, params.y)
const menu = Menu.buildFromTemplate(params.menu)
menu.popup(params.x, params.y)
})
// The devtools requests the webContents to reload.