summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-11-23 09:57:05 +0900
committerGitHub <noreply@github.com>2023-11-23 09:57:05 +0900
commitbf42467e215b20b36ec6b4bf30212e4beb2dd01f (patch)
tree3a7628e178b157660f904bafea734d854b8e86fc /ext
parent50d1ac9f6b78c6f85b2e0f2894390c24b9c20b46 (diff)
fix(ext/node): fix node:stream.Writable (#21297)
This change applies the same fix as https://github.com/nodejs/node/pull/46818, and the original example given in #20456 works as expected. closes #20456
Diffstat (limited to 'ext')
-rw-r--r--ext/node/polyfills/_stream.mjs6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/node/polyfills/_stream.mjs b/ext/node/polyfills/_stream.mjs
index 26d5fd30a..23df11ab3 100644
--- a/ext/node/polyfills/_stream.mjs
+++ b/ext/node/polyfills/_stream.mjs
@@ -1669,9 +1669,11 @@ var require_destroy = __commonJS({
}
}
try {
- stream._construct(onConstruct);
+ stream._construct((err) => {
+ nextTick(onConstruct, err);
+ });
} catch (err) {
- onConstruct(err);
+ nextTick(onConstruct, err);
}
}
function emitConstructNT(stream) {