Export app before requiring modules

This commit is contained in:
Kevin Sawicki 2016-06-22 15:21:45 -07:00
parent 4dbdcad05e
commit be642612c0
2 changed files with 8 additions and 10 deletions

View file

@ -1,12 +1,15 @@
'use strict'
const bindings = process.atomBinding('app')
const {app} = bindings
// Only one app object permitted.
module.exports = app
const electron = require('electron')
const {deprecate, Menu} = electron
const {EventEmitter} = require('events')
const bindings = process.atomBinding('app')
const {app} = bindings
Object.setPrototypeOf(app, EventEmitter.prototype)
let appPath = null
@ -67,6 +70,3 @@ process.atomBinding('download_item')._setWrapDownloadItem((downloadItem) => {
// downloadItem is an EventEmitter.
Object.setPrototypeOf(downloadItem, EventEmitter.prototype)
})
// Only one App object pemitted.
module.exports = app