Don't rely on the global process object for message dispatching

This commit is contained in:
Cheng Zhao 2015-01-26 18:42:43 -08:00
parent c14c6a3521
commit a10782cdea
3 changed files with 27 additions and 25 deletions

View file

@ -1,4 +1,5 @@
process = global.process
events = require 'events'
path = require 'path'
url = require 'url'
Module = require 'module'
@ -21,6 +22,10 @@ globalPaths.push path.join(process.resourcesPath, 'app')
# Import common settings.
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
# The global variable will be used by ipc for event dispatching
v8Util = process.atomBinding 'v8_util'
v8Util.setHiddenValue global, 'ipc', new events.EventEmitter
# Process command line arguments.
nodeIntegration = 'false'
for arg in process.argv