W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2012

Re: [whatwg] StringEncoding: encode() return type looks weird in the IDL

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 05 Aug 2012 13:07:31 -0400
Message-ID: <501EA853.9030905@mit.edu>
To: whatwg@lists.whatwg.org
On 8/5/12 12:29 PM, Glenn Maynard wrote:
> My recollection is this was to allow returning Uint16Array (or, more
> specifically but currently unresolved, Uint16LEArray and Uint16BEArray) for
> encoding to UTF-16 and UTF-16BE.

If that ever happens the return value can be changed at that point. 
It's silly to build in "extensibility" like this, imo, because there's 
absolutely no reason for it: changing the return value to a superclass 
is completely transparent to JS consumers.  On the other hand, there's 
certainly a drawback to having less-specific return values: it gives 
JITs less information to work with in terms of optimizing the code.

Received on Sunday, 5 August 2012 17:08:02 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:44 UTC