DataView get/set Uint8Clamped methods S1
- Stage: Stage 1
- Status: Active
- ECMAScript edition: —
- Synchronized: Aug 28, 2026
- 中文译文 · Source repository
This proposal addresses the lack of DataView get/set methods for Uint8ClampedArray, which prevents consistent dynamic dispatch across all typed array types. It proposes adding the corresponding methods to complete Typed Array support.
The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.
DataView get/set Uint8Clamped methods
There are currently 11 kinds of Typed Array in the language.
Stage: 1
Motivation/Use Case
I'd like to dynamically dispatch to DataView methods based on the "type" of the Typed Array. This works great for all of the types except Uint8Clamped.
Problem
Only 10 of them have DataView get/set methods.
Here's a matrix representing the consistently available functionality for each of them:
Solution
Add the get and set methods to round out Typed Array support.
Use Cases
- dynamic dispatch based on Typed Array type: https://github.com/esfx/esfx/blob/main/packages/struct-type/src/internal/numbers.ts#L122-L133