aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/stream.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/node/stream.js')
-rw-r--r--src/js/node/stream.js4
1 files changed, 4 insertions, 0 deletions
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;