Found this when was reading through the sources, looks like a bug.
Pass an encoding like 'utf-8' instead of a parameters object as the second argument to fs.createReadStream('file/path', 'utf-8'), by design it is allowed. This will get passed down to the ReadStream class.
At this line:
https://github.com/oven-sh/bun/blob/0bfe3760f6dd542603aab239bb31034171bb7191/src/js/node/fs.js#L600
the options gets deconstructed into an object when calling super:
What version of Bun is running?
main branch
What platform is your computer?
all
What steps can reproduce the bug?
Found this when was reading through the sources, looks like a bug. Pass an encoding like
'utf-8'
instead of a parameters object as the second argument tofs.createReadStream('file/path', 'utf-8')
, by design it is allowed. This will get passed down to theReadStream
class. At this line: https://github.com/oven-sh/bun/blob/0bfe3760f6dd542603aab239bb31034171bb7191/src/js/node/fs.js#L600 theoptions
gets deconstructed into an object when callingsuper
:In case if
options
is a string representing the encoding (which is by the protocol) the resulting object will look something like this:I thing this does not break anything, but still clutters internal object shapes.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response