From 75b5c715405d49b5026c13143efecd580d27be1b Mon Sep 17 00:00:00 2001 From: cfal Date: Wed, 13 Sep 2023 12:21:58 +0700 Subject: js/node/stream.js: call write() callback when encoding is not provided (#4841) * js/node/stream.js: call write() callback when encoding is not provided * js/out/InternalModuleRegistryConstants.h: update --- src/js/node/stream.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/js/node/stream.js') diff --git a/src/js/node/stream.js b/src/js/node/stream.js index f9d4377b5..4112589eb 100644 --- a/src/js/node/stream.js +++ b/src/js/node/stream.js @@ -5540,6 +5540,10 @@ NativeWritable.prototype.write = function NativeWritablePrototypeWrite(chunk, en return false; } fileSink.flush(true); + + if (typeof encoding === "function") { + cb = encoding; + } // TODO: Should we just have a calculation based on encoding and length of chunk? if (cb) cb(null, chunk.byteLength); return true; -- cgit v1.2.3