Skip to content

TC39 proposal to add DataView.prototype.getUint8Clamped and DataView.prototype.setUint8Clamped

License

Notifications You must be signed in to change notification settings

tc39/proposal-dataview-get-set-uint8clamped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

TC39 proposal to add DataView.prototype.getUint8Clamped and DataView.prototype.setUint8Clamped

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks