Skip to content
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

The WebIDL conversions shouldn't throw on detached buffers #12534

Closed
andreubotella opened this issue Oct 25, 2021 · 1 comment · Fixed by #12585
Closed

The WebIDL conversions shouldn't throw on detached buffers #12534

andreubotella opened this issue Oct 25, 2021 · 1 comment · Fixed by #12585

Comments

@andreubotella
Copy link
Contributor

See jsdom/webidl-conversions#29.

This is causing the failure of the following WPT tests:

serde_v8 does the right thing when constructing a ZeroCopyBuf and correctly derefs to an empty slice. Constructing that empty slice might be UB, though, but that is a more general problem than for detached buffers: see denoland/rusty_v8#711 (comment)

@andreubotella
Copy link
Contributor Author

UB is no longer an issue with denoland/rusty_v8#809.

andreubotella pushed a commit to andreubotella/deno that referenced this issue Oct 28, 2021
The Web IDL conversion to `BufferSource` and similar types shouldn't
check whether the buffer is detached.

In the case of `TextDecoder`, our implementation would still throw after
the Web IDL conversions because we're creating a new `Uint8Array` from
the buffer source's buffer, which throws if it's detached. This change
also fixes this bug.

Fixes denoland#12534.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant