We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.6.14
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 unknown
When creating a TextDecoder it can be configured to throw an error when it encounters invalid data like so:
const decoder = new TextDecoder("utf-8", { fatal: true });
However bun does not respect this, as seen with this code:
const decoder = new TextDecoder("utf-8", { fatal: true }); console.log(decoder.decode(new Uint8Array([195])));
The code should error when run, yet bun doesn't throw an error, and just returns a string.
In chrome the same code gives the following error:
VM28:2 Uncaught TypeError: Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid. at <anonymous>:2:21 (anonymous) @ VM28:2
And in firefox:
Uncaught TypeError: TextDecoder.decode: Decoding failed. <anonymous> debugger eval code:1
Bun instead outputs:
�
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Bun is running?
0.6.14
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 unknown
What steps can reproduce the bug?
When creating a TextDecoder it can be configured to throw an error when it encounters invalid data like so:
However bun does not respect this, as seen with this code:
What is the expected behavior?
The code should error when run, yet bun doesn't throw an error, and just returns a string.
In chrome the same code gives the following error:
And in firefox:
What do you see instead?
Bun instead outputs:
Additional information
No response
The text was updated successfully, but these errors were encountered: