For AI agents: the complete documentation index is available at /tc39-atlas/en/llms.txt, the full documentation bundle is available at /tc39-atlas/en/llms-full.txt, and this page is available as Markdown at /tc39-atlas/en/proposals/stage/1/proposal-dataview-get-set-uint8clamped.md.
  • English
  • DataView get/set Uint8Clamped methods S1

    Proposal details
    Proposal overview

    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.

    Note

    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:

    Name constructor shared prototype ArrayBuffers DataView get method DataView set method
    Int8Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Uint8Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Uint8ClampedArray :white_check_mark: :white_check_mark: :white_check_mark: :x: :x:
    Int16Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Uint16Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Int32Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Uint32Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    BigInt64Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    BigUint64Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Float32Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
    Float64Array :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:

    Solution

    Add the get and set methods to round out Typed Array support.

    Use Cases