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

doc: fix actual result of example is different in events #45656

Merged

Conversation

deokjinkim
Copy link
Contributor

@deokjinkim deokjinkim commented Nov 28, 2022

Change of events internal may be not reflected yet.

In document, result of example is like below.

a b MyEmitter {
   domain: null,
   _events: { event: [Function] },
   _eventsCount: 1,
   _maxListeners: undefined } true

But actual result of example with current node is like below.

a b MyEmitter {
  _events: [Object: null prototype] { event: [Function (anonymous)] },
  _eventsCount: 1,
  _maxListeners: undefined,
  [Symbol(kCapture)]: false
} true

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. events Issues and PRs related to the events subsystem / EventEmitter. labels Nov 28, 2022
@bnb
Copy link
Contributor

bnb commented Nov 28, 2022

Just ran with the below code example (separately, we should probably update this specific code example to actually be runnable with the below code) and got the updated output.

const EventEmitter = require('node:events');
class MyEmitter extends EventEmitter {};
const myEmitter = new MyEmitter();

myEmitter.on('event', function(a, b) {
  console.log(a, b, this, this === myEmitter);
});

myEmitter.emit('event', 'a', 'b');

@daeyeon
Copy link
Member

daeyeon commented Nov 29, 2022

Nit: the commit message title needs to start with an imperative verb to meet the guideline below. This isn't a blocker since it could be fixed by someone when landing the PR. However, it can be fixed also by a force push.

* be prefixed with the name of the changed [subsystem](#appendix-subsystems)
and start with an imperative verb. Check the output of `git log --oneline
files/you/changed` to find out what subsystems your changes touch.

Change of events internal may be not reflected yet.
@deokjinkim deokjinkim changed the title doc: actual result is different from specified one in events doc: fix actual result of example is different in events Nov 29, 2022
@deokjinkim
Copy link
Contributor Author

Nit: the commit message title needs to start with an imperative verb to meet the guideline below. This isn't a blocker since it could be fixed by someone when landing the PR. However, it can be fixed also by a force push.

* be prefixed with the name of the changed [subsystem](#appendix-subsystems)
and start with an imperative verb. Check the output of `git log --oneline
files/you/changed` to find out what subsystems your changes touch.

@daeyeon Thank you for kind explanation and remind. Updated commit message title starting with an imperative verb.

@daeyeon daeyeon added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Dec 6, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 6, 2022
@nodejs-github-bot nodejs-github-bot merged commit ab064d1 into nodejs:main Dec 6, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in ab064d1

targos pushed a commit that referenced this pull request Dec 12, 2022
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 4, 2023
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 5, 2023
Change of events internal may be not reflected yet.

PR-URL: #45656
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. events Issues and PRs related to the events subsystem / EventEmitter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants