W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2009

Re: Binary data (ByteArray/ByteVector) proposal on public-script-coord

From: David-Sarah Hopwood <david-sarah@jacaranda.org>
Date: Fri, 06 Nov 2009 00:01:49 +0000
Message-ID: <4AF3676D.9010701@jacaranda.org>
To: es-discuss@mozilla.org, public-script-coord@w3.org
Charles Jolley wrote:
> This looks like a good approach.  I wonder if the Data/DataBuilder
> distinction could be handled better by using the Object.freeze()
> semantics.  Even if the browser does not support freezing in the general
> sense yet, you could borrow the ideas for data.
> 
> Probably the wrong API names, but here is the basic idea:
> 
> Data.prototype.copy()
>   -> returns a mutable form of the Data object
> 
> Data.prototype.freeze() or Data.freeze(aDataObject)
>   -> makes the Data object frozen if it is not frozen already
> 
> Data.prototype.frozenCopy()
>   -> returns the data object but pre-frozen.  For Data object's already
> frozen can return "this"
> 
> Data.prototype.frozen - true when frozen, false otherwise.

I don't know why we wouldn't just use Object.freeze. It is not unreasonable
to require support for the ES5 APIs as a prerequisite for the Data type.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com


Received on Friday, 6 November 2009 00:03:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:02 UTC