Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6bdc42c

Browse filesBrowse files
committed
shorten some lines in events.js
1 parent ae8f8e7 commit 6bdc42c
Copy full SHA for 6bdc42c

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Open diff view settings
Collapse file

‎lib/events.js‎

Copy file name to clipboardExpand all lines: lib/events.js
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
exports.EventEmitter = process.EventEmitter;
1+
var EventEmitter = exports.EventEmitter = process.EventEmitter;
22

33
var isArray = Array.isArray;
44

5-
process.EventEmitter.prototype.emit = function (type) {
5+
EventEmitter.prototype.emit = function (type) {
66
// If there is no 'error' event listener then throw.
77
if (type === 'error') {
88
if (!this._events || !this._events.error ||
@@ -49,9 +49,9 @@ process.EventEmitter.prototype.emit = function (type) {
4949
}
5050
};
5151

52-
// process.EventEmitter is defined in src/node_events.cc
53-
// process.EventEmitter.prototype.emit() is also defined there.
54-
process.EventEmitter.prototype.addListener = function (type, listener) {
52+
// EventEmitter is defined in src/node_events.cc
53+
// EventEmitter.prototype.emit() is also defined there.
54+
EventEmitter.prototype.addListener = function (type, listener) {
5555
if ('function' !== typeof listener) {
5656
throw new Error('addListener only takes instances of Function');
5757
}
@@ -76,9 +76,9 @@ process.EventEmitter.prototype.addListener = function (type, listener) {
7676
return this;
7777
};
7878

79-
process.EventEmitter.prototype.on = process.EventEmitter.prototype.addListener;
79+
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
8080

81-
process.EventEmitter.prototype.removeListener = function (type, listener) {
81+
EventEmitter.prototype.removeListener = function (type, listener) {
8282
if ('function' !== typeof listener) {
8383
throw new Error('removeListener only takes instances of Function');
8484
}
@@ -101,13 +101,13 @@ process.EventEmitter.prototype.removeListener = function (type, listener) {
101101
return this;
102102
};
103103

104-
process.EventEmitter.prototype.removeAllListeners = function (type) {
104+
EventEmitter.prototype.removeAllListeners = function (type) {
105105
// does not use listeners(), so no side effect of creating _events[type]
106106
if (type && this._events && this._events[type]) this._events[type] = null;
107107
return this;
108108
};
109109

110-
process.EventEmitter.prototype.listeners = function (type) {
110+
EventEmitter.prototype.listeners = function (type) {
111111
if (!this._events) this._events = {};
112112
if (!this._events[type]) this._events[type] = [];
113113
if (!isArray(this._events[type])) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.