node: change the constructor name of process from EventEmitter to process #3307

Closed
wants to merge 1 commit into
from
View
@@ -2162,8 +2162,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();