Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

What about TypedArray views? #18

Open
ghost opened this issue Mar 29, 2018 · 6 comments
Open

What about TypedArray views? #18

ghost opened this issue Mar 29, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 29, 2018

The rationale would seem to apply equally to them.

@ljharb
Copy link
Member

ljharb commented Mar 30, 2018

Good point; anything that is added here to Array.prototype should probably be added to TypedArray.prototype.

@keithamus
Copy link
Member

PRs always welcome 👍

@zloirock
Copy link
Contributor

zloirock commented Apr 3, 2018

2 questions: should proposed accessors validate that the target is a typed array and what the behaviour expected for typed arrays with zero length?

@addaleax
Copy link

addaleax commented Apr 3, 2018

@zloirock Is there any reason to do it differently than for Arrays? As far as I can tell, the proposed spec would work for typed arrays without changes… right?

@zloirock
Copy link
Contributor

zloirock commented Apr 3, 2018

@addaleax almost all typed array methods are non-generic and throws an error on something different from typed array. Typed arrays have a constant length, so setting .lastItem for typed arrays with zero length by the current spec is an error.

@jhpratt
Copy link

jhpratt commented Jul 12, 2019

If the issue @zloirock brought up is resolved, I can look into submitting a PR to add .lastItem and .lastIndex for TypedArrays.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants