-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Description
- Version: 13.6.0
- Platform: all
- Subsystem: events
Docs tell that eventName should be of type string or symbol. But actually there is no type check and it works to use e.g. number, function or null - they just get coerced to a string (which is quite nice for functions).
There are also two tests which use non string/symbol: e.g. test-event-emitter-max-listeners-warning-for-null.js and test-event-emitter-subclass.js.
Are the docs wrong or the implementation? Or is this just some relict which can't be changed but should be hidden in docs as there were already type checks implemented (see 0468861).
Edit:
Maybe some more background on this: I worked on adding typechecks for types and at that time I discovered a few failing tests and as followup the commit linked above.
Metadata
Metadata
Assignees
Labels
No labels