💄 Standarize requires in JavaScript API

This commit is contained in:
Steve Kinney 2016-05-15 09:41:30 -04:00
parent 2317b56ac4
commit 0d3d097ce8
6 changed files with 10 additions and 13 deletions

View file

@ -1,7 +1,6 @@
'use strict' 'use strict'
const app = require('electron').app const {app, BrowserWindow} = require('electron')
const BrowserWindow = require('electron').BrowserWindow
const binding = process.atomBinding('dialog') const binding = process.atomBinding('dialog')
const v8Util = process.atomBinding('v8_util') const v8Util = process.atomBinding('v8_util')

View file

@ -1,6 +1,6 @@
'use strict' 'use strict'
const ipcMain = require('electron').ipcMain const {ipcMain} = require('electron')
// The history operation in renderer is redirected to browser. // The history operation in renderer is redirected to browser.
ipcMain.on('ELECTRON_NAVIGATION_CONTROLLER', function (event, method, ...args) { ipcMain.on('ELECTRON_NAVIGATION_CONTROLLER', function (event, method, ...args) {

View file

@ -1,5 +1,5 @@
const EventEmitter = require('events').EventEmitter const {EventEmitter} = require('events')
const powerMonitor = process.atomBinding('power_monitor').powerMonitor const {powerMonitor} = process.atomBinding('power_monitor')
Object.setPrototypeOf(powerMonitor, EventEmitter.prototype) Object.setPrototypeOf(powerMonitor, EventEmitter.prototype)

View file

@ -1,5 +1,5 @@
const EventEmitter = require('events').EventEmitter const {EventEmitter} = require('events')
const screen = process.atomBinding('screen').screen const {screen} = process.atomBinding('screen')
Object.setPrototypeOf(screen, EventEmitter.prototype) Object.setPrototypeOf(screen, EventEmitter.prototype)

View file

@ -1,5 +1,5 @@
const EventEmitter = require('events').EventEmitter const {EventEmitter} = require('events')
const Tray = process.atomBinding('tray').Tray const {Tray} = process.atomBinding('tray')
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype) Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)

View file

@ -1,9 +1,7 @@
'use strict' 'use strict'
const EventEmitter = require('events').EventEmitter const {EventEmitter} = require('events')
const ipcMain = require('electron').ipcMain const {ipcMain, Menu, NavigationController} = require('electron')
const NavigationController = require('electron').NavigationController
const Menu = require('electron').Menu
const binding = process.atomBinding('web_contents') const binding = process.atomBinding('web_contents')
const debuggerBinding = process.atomBinding('debugger') const debuggerBinding = process.atomBinding('debugger')