Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…cess
  • Loading branch information...
commit 6d70a4ae162e0f364c45ac2ad6d008bf99aae47f 1 parent 3db2e03
@AndreasMadsen AndreasMadsen authored isaacs committed
Showing with 9 additions and 2 deletions.
  1. +2 −1  src/node.cc
  2. +7 −1 src/node.js
View
3  src/node.cc
@@ -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
8 src/node.js
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.