0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

node: deprecate process.EventEmitter

The comment stating it was deprecated was added in 2011 via
4ef8f06fe6. It is time to
actually deprecate it.

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Evan Lucas 2016-02-02 19:57:21 -06:00
parent 7406cd3a59
commit 25751bedfe

View File

@ -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();