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: #5049
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
evanlucas committed Feb 4, 2016
1 parent 7406cd3 commit 25751be
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 25751be

Please sign in to comment.