From 2c3cacdc087e58135818d6a82e5c468b816c3cf6 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Mon, 28 Mar 2016 17:40:40 -0700 Subject: [PATCH] standardize by hand --- lib/browser/api/menu.js | 8 ++++---- lib/browser/api/session.js | 2 +- lib/browser/api/tray.js | 2 +- lib/browser/api/web-contents.js | 2 +- lib/browser/chrome-extension.js | 5 +++-- lib/browser/desktop-capturer.js | 2 +- lib/browser/guest-view-manager.js | 4 ++-- lib/browser/guest-window-manager.js | 6 +++--- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 7330b89dd748..892f7a250fc9 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -93,7 +93,7 @@ Menu.prototype._init = function () { this.commandsMap = {} this.groupsMap = {} this.items = [] - return this.delegate = { + this.delegate = { isCommandIdChecked: (commandId) => { var command = this.commandsMap[commandId] return command != null ? command.checked : undefined @@ -142,7 +142,7 @@ Menu.prototype._init = function () { } Menu.prototype.popup = function (window, x, y, positioningItem) { - if (typeof window != 'object' || window.constructor !== BrowserWindow) { + if (typeof window !== 'object' || window.constructor !== BrowserWindow) { // Shift. positioningItem = y y = x @@ -224,7 +224,7 @@ Menu.prototype.insert = function (pos, item) { // Remember the items. this.items.splice(pos, 0, item) - return this.commandsMap[item.commandId] = item + this.commandsMap[item.commandId] = item } // Force menuWillShow to be called @@ -284,7 +284,7 @@ Menu.buildFromTemplate = function (template) { } positionedTemplate.splice(insertIndex, 0, item) } - menu = new Menu + menu = new Menu() for (k = 0, len1 = positionedTemplate.length; k < len1; k++) { item = positionedTemplate[k] if (typeof item !== 'object') { diff --git a/lib/browser/api/session.js b/lib/browser/api/session.js index 01814774fdcf..f0ff786cf2bd 100644 --- a/lib/browser/api/session.js +++ b/lib/browser/api/session.js @@ -27,7 +27,7 @@ Object.defineProperty(exports, 'defaultSession', { var wrapSession = function (session) { // session is an EventEmitter. - return session.__proto__ = EventEmitter.prototype + session.__proto__ = EventEmitter.prototype } bindings._setWrapSession(wrapSession) diff --git a/lib/browser/api/tray.js b/lib/browser/api/tray.js index 1f9f5881b289..293825200e48 100644 --- a/lib/browser/api/tray.js +++ b/lib/browser/api/tray.js @@ -17,7 +17,7 @@ Tray.prototype.setContextMenu = function (menu) { this._setContextMenu(menu) // Keep a strong reference of menu. - return this.menu = menu + this.menu = menu } module.exports = Tray diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index 9187c87bfccd..60c159467ff9 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -168,7 +168,7 @@ let wrapWebContents = function (webContents) { deprecate.event(webContents, 'page-title-set', 'page-title-updated', function (...args) { return this.emit.apply(this, ['page-title-set'].concat(args)) }) - return webContents.printToPDF = function (options, callback) { + webContents.printToPDF = function (options, callback) { var printingSetting printingSetting = { pageRage: [], diff --git a/lib/browser/chrome-extension.js b/lib/browser/chrome-extension.js index db3e4e9f9a59..562e77a11509 100644 --- a/lib/browser/chrome-extension.js +++ b/lib/browser/chrome-extension.js @@ -71,7 +71,8 @@ app.on('will-quit', function () { // We can not use protocol or BrowserWindow until app is ready. app.once('ready', function () { var BrowserWindow, chromeExtensionHandler, i, init, len, protocol, srcDirectory - protocol = electron.protocol, BrowserWindow = electron.BrowserWindow + protocol = electron.protocol + BrowserWindow = electron.BrowserWindow // Load persisted extensions. loadedExtensionsPath = path.join(app.getPath('userData'), 'DevTools Extensions') @@ -133,7 +134,7 @@ app.once('ready', function () { // Load persisted extensions when devtools is opened. init = BrowserWindow.prototype._init - return BrowserWindow.prototype._init = function () { + BrowserWindow.prototype._init = function () { init.call(this) return this.on('devtools-opened', function () { return this._loadDevToolsExtensions(Object.keys(extensionInfoMap).map(function (key) { diff --git a/lib/browser/desktop-capturer.js b/lib/browser/desktop-capturer.js index fd234437ff59..5ba64fcddb14 100644 --- a/lib/browser/desktop-capturer.js +++ b/lib/browser/desktop-capturer.js @@ -29,7 +29,7 @@ ipcMain.on('ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', function (event, capture // If the WebContents is destroyed before receiving result, just remove the // reference from requestsQueue to make the module not send the result to it. return event.sender.once('destroyed', function () { - return request.webContents = null + request.webContents = null }) }) diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index 0526e6a13618..ee633cf29019 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -131,7 +131,7 @@ var createGuest = function (embedder, params) { } this.loadURL(params.src, opts) } - return guest.allowPopups = params.allowpopups + guest.allowPopups = params.allowpopups }) // Dispatch events to embedder. @@ -188,7 +188,7 @@ var attachGuest = function (embedder, elementInstanceId, guestInstanceId, params webViewManager.addGuest(guestInstanceId, elementInstanceId, embedder, guest, webPreferences) guest.attachParams = params embedderElementsMap[key] = guestInstanceId - return reverseEmbedderElementsMap[guestInstanceId] = key + reverseEmbedderElementsMap[guestInstanceId] = key } // Destroy an existing guest instance. diff --git a/lib/browser/guest-window-manager.js b/lib/browser/guest-window-manager.js index 94805a4c1fbc..bc88337eb062 100644 --- a/lib/browser/guest-window-manager.js +++ b/lib/browser/guest-window-manager.js @@ -84,9 +84,9 @@ ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', function (event, url, options = mergeBrowserWindowOptions(event.sender, options) event.sender.emit('new-window', event, url, frameName, 'new-window', options) if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) { - return event.returnValue = null + event.returnValue = null } else { - return event.returnValue = createGuest(event.sender, url, frameName, options) + event.returnValue = createGuest(event.sender, url, frameName, options) } }) @@ -97,7 +97,7 @@ ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', function (event, gues ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', function (event, guestId, method, ...args) { var ref1 - return event.returnValue = (ref1 = BrowserWindow.fromId(guestId)) != null ? ref1[method].apply(ref1, args) : void 0 + event.returnValue = (ref1 = BrowserWindow.fromId(guestId)) != null ? ref1[method].apply(ref1, args) : void 0 }) ipcMain.on('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', function (event, guestId, message, targetOrigin, sourceOrigin) {