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:
parent
7406cd3a59
commit
25751bedfe
12
src/node.js
12
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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user