Non-extensibility of Typed Arrays

Niko Matsakis niko at alum.mit.edu
Wed Sep 4 18:11:08 PDT 2013


On Wed, Sep 04, 2013 at 02:41:24PM -0700, Brendan Eich wrote:
> Both adds up to two, not one, so the counterargument is odd beats
> odder, and prohibiting expandos keeps the oddness down to == and
> nothing else.

I just want to agree with this. I think the behavior of `==` is
unfortunate, but much more of a corner case than expando properties
disappearing and reappearing willy nilly as users switch between
otherwise identical views on the same data.

I feel like `==` can be explained by the fact that these are distinct
objects pointing at the same underyling buffer. People get aliasing.
But the fact that expando properties would live *on the wrapper* and
not on the *underlying data* is quite surprising and counterintuitive
-- some of the data (the elements) are aliased, but others are not.


Niko


More information about the es-discuss mailing list