W3C home > Mailing lists > Public > public-web-security@w3.org > November 2012

Re: CSP 1.1 DOM design

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 05 Nov 2012 09:31:37 -0500
Message-ID: <5097CDC9.6060701@mit.edu>
To: David Bruant <bruant.d@gmail.com>
CC: Alex Russell <slightlyoff@google.com>, public-web-security@w3.org
On 11/5/12 5:56 AM, David Bruant wrote:
> Arguably, ES6 symbols may give a re-birth to ad-hoc collection types by
> allowing safe (uncollidable) extension of built-ins. I think an IDL
> array is fine (as far as I can tell, the difference with a regular array
> is just a different prototype).

Actually, the prototype of IDL arrays is Array.prototype.

The differences between IDL arrays and ES arrays per spec as of today are:

1)  toString behavior.
2)  Object.prototype.toString behavior.
3)  Calling Object.freeze/seal/preventExtensions on IDL arrays throws a
4)  IDL arrays can have readonly slots and a fixed length.
5)  Array.isArray behavior.
6)  Array.prototype.concat behavior.
7)  Object.defineProperty(obj, "length", { /* non-value descriptor * })

I think that's it, though I won't guarantee that I got them all.

Of course there may also be implementation-dependent differences in 
terms of performance.  But those can happen between different Array 
instances too, so that's not as big a deal.

Received on Monday, 5 November 2012 14:32:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:20 UTC