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

Re: ArrayClass should imply @@isConcatSpreadable

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 28 Oct 2013 19:46:41 -0400
Message-ID: <526EF761.9010700@mit.edu>
To: es-discuss@mozilla.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 10/28/13 7:43 PM, Boris Zbarsky wrote:
>   Our current implementation returns vanilla JS arrays, but returns a
> new one every get, which is pretty suboptimal.  So we were considering
> changing them to some ArrayClass interface and thinking about what
> issues that might cause for callers...

To be clear, we _could_ just change this particular API (Gamepad) to 
returning a plain-vanilla JS array and the same one every time and allow 
the caller to write to it; it's not like the API implementation ever 
_reads_ this array, so there aren't even safety issues here.  That still 
seems like it makes it really easy for a caller to accidentally modify 
the array and cause another caller to see incorrect data here, which 
smells quite fishy to me.

-Boris
Received on Monday, 28 October 2013 23:47:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:19 UTC