On Thu, May 13, 2010 at 5:34 PM, Mark S. Miller <erig...@google.com> wrote:
> On Thu, May 13, 2010 at 5:15 PM, Vladimir Vukicevic <vladi...@mozilla.com>
> wrote:
>>
>> This is difficult to do, given the goals of typed arrays -- they wouldn't
>> behave like normal Arrays in most meaningful ways.  At the core, an
>> ArrayBuffer is of fixed size, and it doesn't make sense to index an
>> ArrayBuffer directly (because there's no indication of what format the data
>> should be accessed in).  Making the array view types instances of Array
>> might work, but again given that they're fixed length, there's a significant
>> difference there.
>
> in ES5:
>     var x = [];
>     for (var i = 0; i < N; i++) {
>         x.push(0);
>     }
>     Object.seal(x);

That is verbose.

> The x that results from the above code is fully populated, of fixed length,
> and must remain fully populated. It is much closer to what programmers
> coming from other languages might regard as an array.

A FixedArrayLiteral would be better but the language does not have
such construct.

var noElisions =  [ length:N, sealed: true ];
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to