Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
node: change the constructor name of process from EventEmitter to pro…
Browse files Browse the repository at this point in the history
…cess
  • Loading branch information
AndreasMadsen authored and isaacs committed Jun 17, 2012
1 parent 3db2e03 commit 6d70a4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/node.cc
Expand Up @@ -2123,8 +2123,9 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {

Local<FunctionTemplate> process_template = FunctionTemplate::New();

process = Persistent<Object>::New(process_template->GetFunction()->NewInstance());
process_template->SetClassName(String::NewSymbol("process"));

process = Persistent<Object>::New(process_template->GetFunction()->NewInstance());

process->SetAccessor(String::New("title"),
ProcessTitleGetter,
Expand Down
8 changes: 7 additions & 1 deletion src/node.js
Expand Up @@ -29,7 +29,13 @@

function startup() {
var EventEmitter = NativeModule.require('events').EventEmitter;
process.__proto__ = EventEmitter.prototype;

process.__proto__ = Object.create(EventEmitter.prototype, {
constructor: {
value: process.constructor
}
});

process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated

startup.globalVariables();
Expand Down

0 comments on commit 6d70a4a

Please sign in to comment.