Skip to content

Latest commit

 

History

History
124 lines (114 loc) · 3.2 KB

File metadata and controls

124 lines (114 loc) · 3.2 KB

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
Uint8Array
Uint8ClampedArray
Int16Array
Uint16Array
Int32Array
Uint32Array
BigInt64Array
BigUint64Array
Float32Array
Float64Array

Solution

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

Use Cases