Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup: address feedback
  • Loading branch information
apapirovski committed Dec 2, 2017
commit 145bbc33691ccc89057442f0ba5fd7ceea57199f
12 changes: 6 additions & 6 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,18 @@ EventEmitter.prototype.removeListener =
if (position < 0)
return this;

if (list.length === 2)
if (list.length === 2) {
events[type] = list[position ? 0 : 1];
else if (list.emitting) {
} else if (list.emitting) {
const { warned } = list;
events[type] = sliceOne(list, position);
if (warned)
events[type].warned = true;
} else if (position === 0)
} else if (position === 0) {
list.shift();
else if (position === list.length - 1)
} else if (position === list.length - 1) {
list.pop();
else {
} else {
if (spliceOne === undefined)
spliceOne = require('internal/util').spliceOne;
spliceOne(list, position);
Expand Down Expand Up @@ -464,8 +464,8 @@ EventEmitter.prototype.eventNames = function eventNames() {
}
}

// We must have Symbols to fill in
if (j < count) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: It would make sense to me if the comment was inside the if since it refers to what must be true if the condition is fulfilled... does that make sense?

// We must have Symbols to fill in
const symbols = Object.getOwnPropertySymbols(events);
for (var i = 0; i < symbols.length; ++i) {
key = symbols[i];
Expand Down