Skip to content

Commit

Permalink
node: deprecate process.EventEmitter
Browse files Browse the repository at this point in the history
The comment stating it was deprecated was added in 2011 via
4ef8f06. It is time to
actually deprecate it.

PR-URL: nodejs#5049
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
evanlucas authored and Michael Scovetta committed Apr 2, 2016
1 parent 7237535 commit 6b95c87
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@
});
EventEmitter.call(process);

process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated
let eeWarned = false;
Object.defineProperty(process, 'EventEmitter', {
get() {
const internalUtil = NativeModule.require('internal/util');
eeWarned = internalUtil.printDeprecationMessage(
`process.EventEmitter is deprecated. Use require('events') instead.`,
eeWarned
);
return EventEmitter;
}
});

startup.setupProcessObject();

Expand Down

0 comments on commit 6b95c87

Please sign in to comment.