diff --git a/lib/_http_agent.js b/lib/_http_agent.js index c18f39a38c..305baa2cbd 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -2,7 +2,7 @@ const net = require('net'); const util = require('util'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const debug = util.debuglog('http'); // New Agent code. diff --git a/lib/_http_client.js b/lib/_http_client.js index 8ddf3341cf..aef05eb8fa 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -3,7 +3,7 @@ const util = require('util'); const net = require('net'); const url = require('url'); -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'); diff --git a/lib/_http_server.js b/lib/_http_server.js index 7acc108638..f2e2dcf001 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -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) } diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index c6bd0c1665..64ff744b8d 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -3,7 +3,7 @@ module.exports = Readable; Readable.ReadableState = ReadableState; -const EE = require('events').EventEmitter; +const EE = require('events'); const Stream = require('stream'); const Buffer = require('buffer').Buffer; const util = require('util'); diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js index e0c60dbdf6..1d700c9218 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert'); -const events = require('events'); +const EventEmitter = require('events'); const stream = require('stream'); const tls = require('tls'); const util = require('util'); @@ -672,7 +672,7 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, options || (options = {}); - events.EventEmitter.call(this); + EventEmitter.call(this); this.server = options.server; this._secureEstablished = false; @@ -741,7 +741,7 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, process.nextTick(securePairNT, this, options); } -util.inherits(SecurePair, events.EventEmitter); +util.inherits(SecurePair, EventEmitter); function securePairNT(self, options) { /* The Connection may be destroyed by an abort call */ diff --git a/lib/cluster.js b/lib/cluster.js index 84d7c766cb..602cc8d60b 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -1,6 +1,6 @@ 'use strict'; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const assert = require('assert'); const dgram = require('dgram'); const fork = require('child_process').fork; diff --git a/lib/dgram.js b/lib/dgram.js index 5d207a5ef6..eaf84272d1 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -3,7 +3,7 @@ const assert = require('assert'); const Buffer = require('buffer').Buffer; const util = require('util'); -const events = require('events'); +const EventEmitter = require('events'); const constants = require('constants'); const UDP = process.binding('udp_wrap').UDP; @@ -79,7 +79,7 @@ exports._createSocketHandle = function(address, port, addressType, fd, flags) { function Socket(type, listener) { - events.EventEmitter.call(this); + EventEmitter.call(this); if (typeof type === 'object') { var options = type; @@ -101,7 +101,7 @@ function Socket(type, listener) { if (typeof listener === 'function') this.on('message', listener); } -util.inherits(Socket, events.EventEmitter); +util.inherits(Socket, EventEmitter); exports.Socket = Socket; diff --git a/lib/fs.js b/lib/fs.js index eeb3806cdc..76f53db9ba 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -12,7 +12,7 @@ const constants = require('constants'); const fs = exports; const Buffer = require('buffer').Buffer; const Stream = require('stream').Stream; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const FSReqWrap = binding.FSReqWrap; const FSEvent = process.binding('fs_event_wrap').FSEvent; diff --git a/lib/http.js b/lib/http.js index cead865749..64788dd5c0 100644 --- a/lib/http.js +++ b/lib/http.js @@ -2,7 +2,7 @@ const util = require('util'); const internalUtil = require('internal/util'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); exports.IncomingMessage = require('_http_incoming').IncomingMessage; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 328a67d1ef..d1596406cf 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -2,7 +2,7 @@ const StringDecoder = require('string_decoder').StringDecoder; const Buffer = require('buffer').Buffer; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const net = require('net'); const dgram = require('dgram'); const util = require('util'); diff --git a/lib/internal/socket_list.js b/lib/internal/socket_list.js index e9b388d420..950d632a26 100644 --- a/lib/internal/socket_list.js +++ b/lib/internal/socket_list.js @@ -2,7 +2,7 @@ module.exports = {SocketListSend, SocketListReceive}; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('util'); // This object keep track of the socket there are sended diff --git a/lib/net.js b/lib/net.js index 8245601e51..47422c30db 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1,6 +1,6 @@ 'use strict'; -const events = require('events'); +const EventEmitter = require('events'); const stream = require('stream'); const timers = require('timers'); const util = require('util'); @@ -1071,7 +1071,7 @@ function Server(options, connectionListener) { if (!(this instanceof Server)) return new Server(options, connectionListener); - events.EventEmitter.call(this); + EventEmitter.call(this); var self = this; var options; @@ -1113,7 +1113,7 @@ function Server(options, connectionListener) { this.allowHalfOpen = options.allowHalfOpen || false; this.pauseOnConnect = !!options.pauseOnConnect; } -util.inherits(Server, events.EventEmitter); +util.inherits(Server, EventEmitter); exports.Server = Server; diff --git a/lib/readline.js b/lib/readline.js index 0bdf5c16e2..0f9aabb2fe 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -12,7 +12,7 @@ const util = require('util'); const internalUtil = require('internal/util'); const inherits = util.inherits; const Buffer = require('buffer').Buffer; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); exports.createInterface = function(input, output, completer, terminal) { diff --git a/lib/stream.js b/lib/stream.js index 8d3535dc4d..047fbceb4b 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -2,7 +2,7 @@ module.exports = Stream; -const EE = require('events').EventEmitter; +const EE = require('events'); const util = require('util'); util.inherits(Stream, EE); diff --git a/src/node.js b/src/node.js index bd91fb888a..001a47657f 100644 --- a/src/node.js +++ b/src/node.js @@ -10,7 +10,7 @@ this.global = this; function startup() { - var EventEmitter = NativeModule.require('events').EventEmitter; + var EventEmitter = NativeModule.require('events'); process.__proto__ = Object.create(EventEmitter.prototype, { constructor: {