Skip to content

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

Closed
@bmeck

Description

@bmeck
  • 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

Metadata

Metadata

Assignees

Labels

encodingIssues and PRs related to the TextEncoder and TextDecoder APIs.utilIssues and PRs related to the built-in util module.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions