-
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
doc: missing argument types for events methods #11802
Conversation
doc/api/events.md
Outdated
|
||
Alias for `emitter.on(eventName, listener)`. | ||
|
||
### emitter.emit(eventName[, ...args]) | ||
<!-- YAML | ||
added: v0.1.26 | ||
--> | ||
- `eventName` {string|symbol} | ||
- `...args` {Function[]} |
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.
The type here isn't correct. It can be zero or more of any kind of values. I'm not sure if we've yet "standardized" on what term to use as an 'any' type.
doc/api/events.md
Outdated
@@ -296,13 +296,17 @@ Its `name` property is set to `'MaxListenersExceededWarning'`. | |||
<!-- YAML | |||
added: v0.1.26 | |||
--> | |||
- `eventName` {string|symbol} |
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.
We're more lax than this. We basically accept any value, it's just that (currently) it will be converted to a string before being used. So for example numbers, booleans, functions (the function's source will be used as the event name), etc. all work.
doc/api/events.md
Outdated
@@ -564,6 +572,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained. | |||
<!-- YAML | |||
added: v0.3.5 | |||
--> | |||
- `n` {number} |
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 think it may make more sense to be more specific here and say 'integer.'
81c7f32
to
f581702
Compare
LGTM |
Refs: #9399 PR-URL: #11802 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
Landed in 38ba0c2. Thank you! :-) |
Refs: nodejs#9399 PR-URL: nodejs#11802 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
Refs: nodejs#9399 PR-URL: nodejs#11802 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
This does not land cleanly in LTS. Please feel free to manually backport. Please also feel free to replace the backport request label with do-not-land if it shouldn't land |
Checklist
Affected core subsystem(s)
documentation
Description of changes
Adds missing argument types to the docs for
event
methodsIssue