-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Adding ignoreBOM and fatal to TextDecoder #1730
Conversation
Looks good to me, thanks! Could this also include a comment for why the extra options are specified? (in the Rust source, not the generated JS source) |
Looks great! I think there are some test failures though? |
@alexcrichton It seems to work fine in Chrome, but is failing in Firefox. I'm investigating it. |
Okay, that took me several hours to debug. It's actually a bug in Firefox: const decoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
const slice = new Uint8Array([239, 187, 191, 98, 97, 114]);
console.log(decoder.decode(slice) === decoder.decode(slice)); The above code returns This has already been reported and fixed (3 days ago), but it is fixed in Firefox 70, so we have to wait for that to be released. |
Nice digging! Want to back out the tests and we can land this anyway for the time being? |
@alexcrichton Done. |
👍 |
Fixes #1729