Non-extensibility of Typed Arrays

Filip Pizlo fpizlo at
Fri Aug 30 15:54:29 PDT 2013

On Aug 30, 2013, at 3:46 PM, David Herman <dherman at> wrote:

> On Aug 30, 2013, at 12:46 PM, Filip Pizlo <fpizlo at> wrote:
>> OK - by "sanepants" do you mean that there is no weirdo aliasing?  Going back to my example of field 'a' aliasing field 'b' - is it possible?
> There is plenty of aliasing possible, but I'm trying to understand what you mean specifically by "weirdo" aliasing. Do you mean that in a given struct it's impossible for it to have two fields that alias each other? That's definitely true. E.g., if I have a struct type
>    var T = new StructType({ a: t1, b: t2, ... });
> then for any given instance x of T, I know for sure that x.a and x.b do not alias the same storage.

Yup, that's what I was concerned about.  And reading over the spec I agree.  But just for sanity, we're guaranteeing this because you cannot create a struct type instance by pointing into an arbitrary offset of a buffer - you can only instantiate new ones, or alias structs nested as fields in other structs.  Right?


> Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list