events: EventTarget use validators and small fix#33663
events: EventTarget use validators and small fix#33663lundibundi wants to merge 2 commits intonodejs:masterfrom
Conversation
lib/internal/event_target.js
Outdated
There was a problem hiding this comment.
I'd assume this was a bug (dept instead of depth) but wanted to point out since I'm not sure how this interaction works (inspecting circular events I assume?).
Also, use NumberIsInteger instead of just null check.
There was a problem hiding this comment.
That is both correct. The user should only ever pass through null or and integer but it would be possible to pass through other types as well.
lib/internal/event_target.js
Outdated
There was a problem hiding this comment.
| Object, | |
| NumberIsInteger, | |
| NumberIsInteger, | |
| Object, |
|
Generally LGTM - can you add a test? |
Do you mean test for |
02a268e to
c434ce6
Compare
lib/internal/event_target.js
Outdated
There was a problem hiding this comment.
Also, @BridgeAR shouldn't this return this? (as well as the other one)
There was a problem hiding this comment.
Yes, that would be ideal. this will just let inspect() to properly know what to do.
Yes. cc @jasnell wdyt? If this isn't too much work to test I think we should add a test - but if it's a lot of work I am fine with LGTMing without one. |
8ae28ff to
2935f72
Compare
lib/internal/event_target.js
Outdated
There was a problem hiding this comment.
Yes, that would be ideal. this will just let inspect() to properly know what to do.
lib/internal/event_target.js
Outdated
There was a problem hiding this comment.
That is both correct. The user should only ever pass through null or and integer but it would be possible to pass through other types as well.
c434ce6 to
9a50794
Compare
|
@lundibundi I rebased your branch and everything should be in order again. The tests pass locally. Please have a look to verify that, thanks. |
|
@BridgeAR thanks :). |
|
This needs another rebase, unfortunately. |
9a50794 to
8713e07
Compare
|
Closing in favor of #34015 (which combines this and other |
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes/cc @jasnell @nodejs/events