-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplex stream is not returning whether it is in object mode correctly #33388
Comments
Version: v14.2.0 x = new stream.Duplex({ writableObjectMode: true })
// console.log(x.writable);
const prop = 'writableObjectMode';
const hasProp = Object.prototype.hasOwnProperty;
function listProtoChain(x) {
while (x !== null) {
console.log(hasProp.call(x, prop));
x = Object.getPrototypeOf(x);
}
}
listProtoChain(x);
// Output
// false
// false
// false
// false
// false
// false I was investigating this and for some reason this code was giving If I can get some help in this, and if this is somewhat an easy issue, I would like to make my first contribution. 😊 |
Yep, definitely a bug. If you look here you'll find where writableObjectMode:
ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableObjectMode'), Then add a regression test in |
@jasnell: Ah, sorry, guess this would have been a good first issue and I was a bit too fast :/. |
Duplex did not properly forward writableObjectMode. Fixes: nodejs#33388
Duplex did not properly forward writableObjectMode. Fixes: #33388 PR-URL: #33390 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
What steps will reproduce the bug?
but the mode is set correctly:
it does work on a Writable stream:
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior?
Return the actual value of whether the stream is in object mode.
The text was updated successfully, but these errors were encountered: