Repository navigation
Conversation
Collaborator
|
Review requested:
|
The prependListener method has been available on EventEmitter since Node.js v6.0.0 (April 2016). The internal fallback code in legacy.js that manually manipulates the `_events` object is only needed to support versions before that. This adds a runtime deprecation that fires when piping to an EventEmitter that lacks the prependListener method, so that users have time to migrate before the fallback code is removed in a future version. Signed-off-by: Karan Mangtani <karan.mangtani@lrn.com>
mcollina
force-pushed
the
stream-deprecate-prependlistener-fallback
branch
from
December 4, 2026 09:30
86f308d to
e12a7e3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #68009 +/- ##
==========================================
- Coverage 90.58% 90.57% -0.02%
==========================================
Files 802 802
Lines 286955 287051 +96
Branches 55417 55432 +15
==========================================
+ Hits 259945 259986 +41
- Misses 17107 17156 +49
- Partials 9903 9909 +6
🚀 New features to boost your workflow:
|
benjamingr
approved these changes
Dec 4, 2026
jasnell
approved these changes
Dec 4, 2026
bjohansebas
approved these changes
Dec 4, 2026
Renegade334
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of #62435 onto current
main. ThatPR is stalled and scheduled for automatic closure, so this carries the change
forward.
The
prependListenermethod has been available on EventEmitter since Node.jsv6.0.0 (April 2016). The internal fallback code in
legacy.jsthat manuallymanipulates the
_eventsobject is only needed to support versions beforethat.
This adds a runtime deprecation (DEP0216) that fires when piping to an
EventEmitter that lacks the
prependListenermethod, so users have time tomigrate before the fallback code is removed in a future version.
Supersedes #62435