Non-extensibility of Typed Arrays

Oliver Hunt oliver at apple.com
Tue Aug 27 09:35:31 PDT 2013


Existing types with magic index properties (other than Array) just drop numeric expandos on the floor so it's logically a no-op.  Unless there was a numeric accessor on the prototype (which non-extensibility does not save you from).

My complaint is that this appears to be removing functionality that has been present in the majority of shipping TA implementations, assuming from LH's comment that Chakra supports expandos.

--Oliver

On Aug 27, 2013, at 9:26 AM, Domenic Denicola <domenic at domenicdenicola.com> wrote:

> I am not aware of all the nuances of the discussion, but as a developer I would find the behavior for numeric expandos confusing. For a typed array of length 1024, setting `ta[1023]` would do something completely different from setting `ta[1024]`. Unlike normal arrays, setting `ta[1024]` would not change `ta.length`, and presumably `ta[1024]` would not be exposed by the various iteration facilities.
> 
> I would much rather received a loud error (in strict mode), which will either alert me to my code being weird, or possibly to my code committing an off-by-one error.



More information about the es-discuss mailing list