mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib,src: remove usage of events.EventEmitter
The `events` module already exports `EventEmitter` constructor function So, we don't have to use `events.EventEmitter` to access it. Refer: https://github.com/nodejs/node/pull/2896 PR-URL: https://github.com/nodejs/node/pull/2921 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
This commit is contained in:
1 parent
7953c83b85
commit
f32a606e37
15 files changed
+23
-22
No files matched your search
+3
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
const util = require('util');
|
||||
const net = require('net');
|
||||
const EventEmitter = require('events').EventEmitter;
|
||||
const EventEmitter = require('events');
|
||||
const HTTPParser = process.binding('http_parser').HTTPParser;
|
||||
const assert = require('assert').ok;
|
||||
const common = require('_http_common');
|
||||
@@ -117,7 +117,8 @@ function onServerResponseClose() {
|
||||
// array. That is, in the example below, b still gets called even though
|
||||
// it's been removed by a:
|
||||
//
|
||||
// var obj = new events.EventEmitter;
|
||||
// var EventEmitter = require('events');
|
||||
// var obj = new EventEmitter();
|
||||
// obj.on('event', a);
|
||||
// obj.on('event', b);
|
||||
// function a() { obj.removeListener('event', b) }
|
||||
|
||||
Reference in new issue
Block a user