| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
|
Will continue the review tomorrow night, but one general note, I think you should avoid deleting those events when removing listener, and IIRC I think we use the number of keys exists in order to see how many events we listen to |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
| else | ||
| delete events[type]; | ||
| } | ||
| this[kShapeMode] = false; |
There was a problem hiding this comment.
Why? What if we just have an object template (template in the abstract way not v8 one) and use that when resetting? (Same for the one below)
(This is not really important comment as it's not happening on a regular basis)
Sorry, something went wrong.
There was a problem hiding this comment.
I don't understand
Sorry, something went wrong.
There was a problem hiding this comment.
Maybe reset _events to the template you provided (e.g. with data event key) instead to the default one (i.e. empty with proto null)
Sorry, something went wrong.
There was a problem hiding this comment.
That would require us to keep the template in memory and then create copies. Maybe having some kind of reset/initEvents override is better but starts to make things complciated.
Sorry, something went wrong.
| if (!(this instanceof Duplex)) | ||
| return new Duplex(options); | ||
|
|
||
| this._events ??= { |
There was a problem hiding this comment.
I don't really think we should modify the private property _events like that, maybe have an option or an api for setting events template in the EventEmitter class?
Sorry, something went wrong.
There was a problem hiding this comment.
Follow up PR welcome?
Sorry, something went wrong.
No longer necessary given recent stream and event optimziations. Refs: nodejs#50428 Refs: nodejs#50439 PR-URL: nodejs#50440
PR-URL: #50428 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #50428 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #50428 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This seems to have broken the emitter.eventNames() function. Because it pre-allocates the _events object it will now report that it has handlers for all those pre-allocated names even if none actually exist. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.