Skip to content
Permalink
Browse files

node: deprecate process.EventEmitter

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 <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 committed Feb 3, 2016
1 parent 7406cd3 commit 25751bedfe7b227dd3690a1e4bdee14fc9a2d517
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/node.js
@@ -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();

0 comments on commit 25751be

Please sign in to comment.
You can’t perform that action at this time.