diff options
Diffstat (limited to 'ext/node/polyfills/_stream.mjs')
-rw-r--r-- | ext/node/polyfills/_stream.mjs | 6 |
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) { |