Save the prototype of EventEmitter

This commit is contained in:
Cheng Zhao 2016-08-02 18:07:58 +09:00
parent 892026458d
commit 895b8b47ee
3 changed files with 40 additions and 0 deletions

View file

@ -6,6 +6,10 @@ const util = require('util')
const Module = require('module')
const v8 = require('v8')
// Save the prototype of EventEmitter, must be called before using native API.
const {setEventEmitterPrototype} = process.binding('atom_browser_event_emitter')
setEventEmitterPrototype(require('events').EventEmitter)
// We modified the original process.argv to let node.js load the atom.js,
// we need to restore it here.
process.argv.splice(1, 1)