Forbid using protocol module before app is ready, fixes #661

This commit is contained in:
Cheng Zhao 2014-10-30 22:27:29 +08:00
parent c0cd8fca80
commit 9ed6ad8165
2 changed files with 11 additions and 13 deletions

View file

@ -1,3 +1,6 @@
app = require 'app'
throw new Error('Can not initialize protocol module before app is ready') unless app.isReady()
protocol = process.atomBinding('protocol').protocol
EventEmitter = require('events').EventEmitter