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

[gh-10902 v5] Emit end event in before close #10916

Merged
merged 3 commits into from
Nov 2, 2021

Conversation

iovanom
Copy link
Contributor

@iovanom iovanom commented Oct 22, 2021

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory.

If you're making a change to documentation, do not modify a .html file directly. Instead find the corresponding .pug file or test case in the test/docs directory.

Summary
The 'end' event should be emit before 'close' event.
See PR from master.
Issue: #10902 (comment)

Examples

@iovanom iovanom mentioned this pull request Oct 22, 2021
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor style comment, but otherwise LGTM 👍

Readable.call(this, { objectMode: true });
const streamOpts = { objectMode: true };
// for node < 12 we will emit 'close' event after 'end'
if (parseInt(process.versions.node.split('.')[0]) >= 12) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a static property in lib/utils.js? So instead of parseInt(process.versions.node.split('.')[0]), we'd just do require('../../utils').nodeMajorVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point!

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vkarpov15 vkarpov15 added this to the 5.13.13 milestone Nov 2, 2021
@vkarpov15 vkarpov15 merged commit c3463c4 into Automattic:5.x Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants