Open lastmjs opened 7 months ago
Here opts is assumed to be an object, but in one of our code paths it was a string like utf-8: https://github.com/second-state/wasmedge-quickjs/blob/main/modules/internal/fs/stream.js#L202
opts
utf-8
I've added this code to fix it temporarily: opts = typeof opts !== 'object' ? {} : opts;
opts = typeof opts !== 'object' ? {} : opts;
I'm not very familiar with JavaScript, so if there are bugs like this in JavaScript, feel free to submit a pull request to help us optimize it.
Here
opts
is assumed to be an object, but in one of our code paths it was a string likeutf-8
: https://github.com/second-state/wasmedge-quickjs/blob/main/modules/internal/fs/stream.js#L202I've added this code to fix it temporarily:
opts = typeof opts !== 'object' ? {} : opts;