-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
events: - line #354 - comment typo. "iff" corrected #13496
Conversation
I think this was intentional and is correct the way it is: https://en.wikipedia.org/wiki/If_and_only_if |
Yep, @BridgeAR is correct here, it's written that way on purpose. |
lib/events.js
Outdated
@@ -351,7 +351,7 @@ EventEmitter.prototype.prependOnceListener = | |||
return this; | |||
}; | |||
|
|||
// emits a 'removeListener' event iff the listener was removed | |||
// emits a 'removeListener' event if the listener was removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to change to if and only if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. This isn't the first time an issue like this has been opened.
@jonsey247 Thank you for the contribution, and welcome 🥇. Even if this change isn't adopted we appreciate the feedback. |
Thanks @refack. Plus side, I learnt what "iff" means 😃 |
@jonsey247 Do you want to try to update this to change it to |
FWIW, that's the only instance of |
hi @Trott yes i can do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iff change to "if and only if"
This is officially my first "contribution" to an open-source project! 😂 👍 Thanks @refack |
Hit the wrong button? |
.....yep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
IMO this doesn't need to wait the usual 48 hours.
CI might be unnecessary but better safe than sorry? At a minimum, whoever lands this should run the linter to make sure there isn't something surprising (like a new rule that slipped in that somehow would flag this for some reason I can't even think of)
lib/events.js
Outdated
@@ -351,7 +351,7 @@ EventEmitter.prototype.prependOnceListener = | |||
return this; | |||
}; | |||
|
|||
// emits a 'removeListener' event iff the listener was removed | |||
// emits a 'removeListener' event if and only if the listener was removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally optional, but while you're in here, if you want, emits
-> Emits
and put a .
at the end. I'm pretty sure we have Collaborators that strongly prefer that style (especially the capitalization), but I also know we have lots of comments that don't conform to it. So totally OK if you don't do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it would read:
emits -> Emits a 'removeListener' event if and only if the listener was removed.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. (And like I said: Totally optional!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(For that matter, it's something that whoever lands the PR can fix up if they want to.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonsey247 I'll land this. Comment if you want me to fix the sentence?
…dejs#354 -emits -> Emits a removeListener event if and only if the listener was removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to "emits -> Emits a 'removeListener' event if and only if the listener was removed.". Capitalisation and full-stop added.
lib/events.js
Outdated
@@ -351,7 +351,7 @@ EventEmitter.prototype.prependOnceListener = | |||
return this; | |||
}; | |||
|
|||
// emits a 'removeListener' event if and only if the listener was removed | |||
// emits -> Emits a 'removeListener' event if and only if the listener was removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost 😄
I believe what @Trott ment with the arrow is emits
needs to be replaced with Emits
.
I'll fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 Thank you. And thank you for putting up with me!
lib/events.js
Outdated
@@ -351,7 +351,7 @@ EventEmitter.prototype.prependOnceListener = | |||
return this; | |||
}; | |||
|
|||
// emits a 'removeListener' event iff the listener was removed | |||
// emits -> Emits a 'removeListener' event if and only if the listener was removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! Get rid of emits ->
.
When I typed this:
emits
->Emits
...the ->
was meant as an arrow and it meant "Change the thing on the left to be the thing on the right instead". Sorry about the confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see @refack said he'll fix it. Cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok. I can change it now, unless @refack has changed it?
…dejs#354 Emits a removeListener event if and only if the listener was removed.
@jonsey247 One more thing, in the git log you appear as: |
No problem @refack (been meaning to do that). Changed now. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You'll need to rebase, or add another empty commit https://git-scm.com/docs/git-commit#git-commit---allow-empty |
@refack......not sure if I've done that. |
PR-URL: nodejs#13496 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed in afc59a9 |
PR-URL: #13496 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #13496 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Simple typo. line 354 in events.js file. "iff" instead of "if". This could be a cause of confusion.
Checklist
Affected core subsystem(s)
[refack fixed formating]