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
     TypeError.
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 * })
     behavior.

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.

-Boris
Received on Monday, 5 November 2012 14:32:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 14:32:13 GMT