This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

node: change the constructor name of process from EventEmitter to pro…

…cess
  • Loading branch information...
AndreasMadsen authored and isaacs committed May 22, 2012
1 parent 3db2e03 commit 6d70a4ae162e0f364c45ac2ad6d008bf99aae47f
Showing with 9 additions and 2 deletions.
  1. +2 −1 src/node.cc
  2. +7 −1 src/node.js
View
@@ -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,
View
@@ -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();

0 comments on commit 6d70a4a

Please sign in to comment.