Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

jonsey247
Copy link
Contributor

@jonsey247 jonsey247 commented Jun 6, 2017

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]

@nodejs-github-bot nodejs-github-bot added the events Issues and PRs related to the events subsystem / EventEmitter. label Jun 6, 2017
@BridgeAR
Copy link
Member

BridgeAR commented Jun 6, 2017

I think this was intentional and is correct the way it is: https://en.wikipedia.org/wiki/If_and_only_if

@mscdex
Copy link
Contributor

mscdex commented Jun 6, 2017

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
Copy link
Contributor

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

Copy link
Contributor

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.

@refack
Copy link
Contributor

refack commented Jun 6, 2017

@jonsey247 Thank you for the contribution, and welcome 🥇. Even if this change isn't adopted we appreciate the feedback.

@jonsey247
Copy link
Contributor Author

Thanks @refack. Plus side, I learnt what "iff" means 😃

@Trott
Copy link
Member

Trott commented Jun 6, 2017

@jonsey247 Do you want to try to update this to change it to if and only if or would you prefer it be closed?

@Trott
Copy link
Member

Trott commented Jun 6, 2017

FWIW, that's the only instance of iff in the lib directory so it might make sense to expand it to if and only if. While iff is a convention, it's not one we use otherwise in that area of the code.

@jonsey247
Copy link
Contributor Author

hi @Trott yes i can do that.

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Contributor Author

@jonsey247 jonsey247 left a 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"

@jonsey247
Copy link
Contributor Author

This is officially my first "contribution" to an open-source project! 😂 👍 Thanks @refack

@jonsey247 jonsey247 closed this Jun 6, 2017
@refack refack reopened this Jun 6, 2017
@refack
Copy link
Contributor

refack commented Jun 6, 2017

Hit the wrong button?

@jonsey247
Copy link
Contributor Author

.....yep

Copy link
Member

@Trott Trott left a 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
Copy link
Member

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.

Copy link
Contributor Author

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.
??

Copy link
Member

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!)

Copy link
Member

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.)

Copy link
Contributor

@refack refack Jun 6, 2017

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?

@refack refack self-assigned this Jun 6, 2017
@refack
Copy link
Contributor

refack commented Jun 6, 2017

…dejs#354 -emits -> Emits a removeListener event if and only if the listener was removed.
Copy link
Contributor Author

@jonsey247 jonsey247 left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.
@refack
Copy link
Contributor

refack commented Jun 6, 2017

@jonsey247 One more thing, in the git log you appear as:
Author: jonsey247 <jacobfilmjones@hotmail.com>
Is that Ok, or would you like your full name to be recorded?
https://help.github.com/articles/setting-your-username-in-git/

@jonsey247
Copy link
Contributor Author

No problem @refack (been meaning to do that). Changed now. 👍

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@refack
Copy link
Contributor

refack commented Jun 6, 2017

No problem @refack (been meaning to do that). Changed now. 👍

You'll need to rebase, or add another empty commit https://git-scm.com/docs/git-commit#git-commit---allow-empty

@jonsey247
Copy link
Contributor Author

@refack......not sure if I've done that.

refack pushed a commit to refack/node that referenced this pull request Jun 6, 2017
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>
@refack
Copy link
Contributor

refack commented Jun 6, 2017

Landed in afc59a9
Extra linter run on master: https://ci.nodejs.org/job/node-test-linter/9657/

@refack refack closed this Jun 6, 2017
jasnell pushed a commit that referenced this pull request Jun 7, 2017
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>
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
MylesBorins pushed a commit that referenced this pull request Jul 17, 2017
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>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
@refack refack removed their assignment Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events Issues and PRs related to the events subsystem / EventEmitter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants