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

stream: avoid caching prepend check #8018

Closed

Conversation

calvinmetcalf
Copy link
Contributor

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
    no but it failed before my change
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

@nodejs/streams

Description of change

This removes the cached check for EE.prototype.prependListener because we can't
have nice things. More specifically some libraries will bundle their own event
emitter implementation.

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Aug 8, 2016
@jasnell
Copy link
Member

jasnell commented Aug 8, 2016

Ugh. Dang. Ok.
LGTM if we must (and if CI is green :-) ..)

prependListener = function prependListener(emitter, event, fn) {
function prependListener(emitter, event, fn) {
// sadly this is not cacheable as some libraries bundle their own
// event emitter implimentation with them
Copy link
Member

Choose a reason for hiding this comment

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

typo: implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

@calvinmetcalf
Copy link
Contributor Author

yeah libraries compiled as UMDs for node are the problem case this would solve

this.push(null);
};

var w = new Writable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use const here, and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I can, thanks

@addaleax
Copy link
Member

addaleax commented Aug 8, 2016

LGTM I think, CI: https://ci.nodejs.org/job/node-test-commit/4457/

@jasnell
Copy link
Member

jasnell commented Aug 8, 2016

Still LGTM with the latest commits if CI is green.

@cjihrig
Copy link
Contributor

cjihrig commented Aug 8, 2016

LGTM

@calvinmetcalf
Copy link
Contributor Author

ok there was a linting error but I fixed that

@jbergstroem
Copy link
Member

jbergstroem commented Aug 8, 2016

Hopefully final CI then: https://ci.nodejs.org/job/node-test-commit/4460/ (and below)

@calvinmetcalf
Copy link
Contributor Author

ok I'm heading out the door, but if that looks good i can squash that latter tonight

@calvinmetcalf
Copy link
Contributor Author

are those failures something I should worry about ?

@addaleax
Copy link
Member

addaleax commented Aug 9, 2016

I don’t think so, but maybe the FreeBSD failure (test-timers-same-timeout-wrong-list-deleted from #7827) is interesting to @erinspice @misterdjules?

@addaleax
Copy link
Member

addaleax commented Aug 9, 2016

New CI to be sure: https://ci.nodejs.org/job/node-test-commit/4472/

@jasnell
Copy link
Member

jasnell commented Aug 9, 2016

More flaky failures unfortunately. They appear unrelated.
Would likely be good to have a CITGM run also, tho... https://ci.nodejs.org/view/Node.js-citgm/job/thealphanerd-smoker-xunit/43/

This removes the cached check for EE.prototype.prependListener because we can't
have nice things. More specifically some libraries will bundle their own event
emitter implementation.
@calvinmetcalf
Copy link
Contributor Author

ok rebased it then

@jasnell
Copy link
Member

jasnell commented Aug 12, 2016

CITGM looks good with only expected failures.
New CI following the rebase: https://ci.nodejs.org/job/node-test-pull-request/3648/

@mcollina
Copy link
Member

LGTM

jasnell pushed a commit that referenced this pull request Aug 18, 2016
This removes the cached check for EE.prototype.prependListener
because we can't have nice things. More specifically some
libraries will bundle their own event emitter implementation.

PR-URL: #8018
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@jasnell
Copy link
Member

jasnell commented Aug 18, 2016

Landed in 774146d

@jasnell jasnell closed this Aug 18, 2016
evanlucas pushed a commit that referenced this pull request Aug 24, 2016
This removes the cached check for EE.prototype.prependListener
because we can't have nice things. More specifically some
libraries will bundle their own event emitter implementation.

PR-URL: #8018
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins
Copy link
Contributor

should this be backported?

@mcollina
Copy link
Member

No, the original change that introduced this issue was not backported to v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants