stream: fix Writable instanceof for subclasses#14945
stream: fix Writable instanceof for subclasses#14945addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
|
LGTM, would love it if you added a test for this. |
|
@benjamingr Can you be more specific? The test in this PR is basically equivalent to the code snippet from the issue… |
|
Nevermind, I see it is already covered for the reverse case. |
|
@addaleax made a suggestion for better assertion fail messages that were just out of the scope of this PR, but I felt should be remedied. |
|
Yea, removed it. If you want, open a different PR, it’s barely going to conflict. |
Ack |
|
There's too much red in that previous CI run. Trying again: Also, this needs a rebase |
|
Added a commit to resolve the merge conflict. Feel free to drop the extra commit if you'd like @addaleax |
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: nodejs#14943
|
I don’t think CI handles merge commits well? Anyway, I pushed a rebased version |
|
CI: https://ci.nodejs.org/job/node-test-commit/11986/ This should be ready. |
|
Landed in 7ce2555 |
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: #14943 PR-URL: #14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: nodejs/node#14943 PR-URL: nodejs/node#14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: nodejs/node#14943 PR-URL: nodejs/node#14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: #14943 PR-URL: #14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: #14943 PR-URL: #14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
@addaleax should we backport to v6.x? It seems like this could change behavior, even if it were to the correct behavior |
|
@MylesBorins Yes, I am confident that we should backport this fix. |
The current custom instanceof for `Writable` subclasses previously returned false positives for instances of *other* subclasses of `Writable` because it was inherited by these subclasses. Fixes: #14943 PR-URL: #14945 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
done :D 🎉 |
The current custom instanceof for
Writablesubclasses previouslyreturned false positives for instances of other subclasses of
Writablebecause it was inherited by these subclasses.Fixes: #14943
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
stream