Skip to content

textDecoder.decode() doesn't accept SharedArrayBuffers #32199

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
bmeck opened this issue Mar 11, 2020 · 0 comments
Closed

textDecoder.decode() doesn't accept SharedArrayBuffers #32199

bmeck opened this issue Mar 11, 2020 · 0 comments
Assignees
Labels
encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. util Issues and PRs related to the built-in util module.

Comments

@bmeck
Copy link
Member

bmeck commented Mar 11, 2020

  • Version: v14.0.0-pre
  • Platform: OSX
  • Subsystem: util

What steps will reproduce the bug?

new TextDecoder().decode(new SharedArrayBuffer(0));

How often does it reproduce? Is there a required condition?

Always reproduces.

What is the expected behavior?

Per https://encoding.spec.whatwg.org/#dom-textdecoder-decode it should accept SharedArrayBuffers and act like

new TextDecoder().decode(new ArrayBuffer(0));

What do you see instead?

TypeError [ERR_INVALID_ARG_TYPE]: The "input" argument must be an instance of ArrayBuffer or ArrayBufferView. Received an instance of SharedArrayBuffer

Additional information

@bmeck bmeck added the util Issues and PRs related to the built-in util module. label Mar 11, 2020
@bmeck bmeck self-assigned this Mar 11, 2020
@addaleax addaleax added the encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. label Mar 11, 2020
BridgeAR pushed a commit that referenced this issue Mar 17, 2020
PR-URL: #32203
Fixes: #32199
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this issue Mar 24, 2020
PR-URL: #32203
Fixes: #32199
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this issue Apr 22, 2020
PR-URL: #32203
Fixes: #32199
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants