From 0000d2f01197a325485daf4cb2ae64e0eb134fd3 Mon Sep 17 00:00:00 2001 From: Ali Hassan <24819103+thisalihassan@users.noreply.github.com> Date: Thu, 12 Mar 2026 03:16:16 +0500 Subject: [PATCH] stream: replace bind with arrow function for onwrite callback PR-URL: https://github.com/nodejs/node/pull/62087 Reviewed-By: Mattias Buelens Reviewed-By: Benjamin Gruenbaum --- lib/internal/streams/writable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js index a9beecee156..e934c38bbf9 100644 --- a/lib/internal/streams/writable.js +++ b/lib/internal/streams/writable.js @@ -347,7 +347,7 @@ function WritableState(options, stream, isDuplex) { this.corked = 0; // The callback that's passed to _write(chunk, cb). - this.onwrite = onwrite.bind(undefined, stream); + this.onwrite = (er) => onwrite(stream, er); // The amount that is being written when _write is called. this.writelen = 0;