Skip to content

Commit

Permalink
fixup! stream: use Buffer.ByteLength() to get the string length
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed May 4, 2024
1 parent 5e59e20 commit fb06325
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ function errorBuffer(state) {

if ((state[kState] & kBuffered) !== 0) {
for (let n = state.bufferedIndex; n < state.buffered.length; ++n) {
const { chunk, length, callback } = state[kBufferedValue][n];
const { length, callback } = state[kBufferedValue][n];
const len = (state[kState] & kObjectMode) !== 0 ? 1 : length;
state.length -= len;
callback(state.errored ?? new ERR_STREAM_DESTROYED('write'));
Expand Down

0 comments on commit fb06325

Please sign in to comment.