W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [IndexeddDB] Definitions of "valid key" and key comparison need to be tightened up

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 09 Oct 2012 14:44:15 -0400
Message-ID: <5074707F.6070103@mit.edu>
To: public-webapps@w3.org
On 10/9/12 2:33 PM, Boris Zbarsky wrote:
> 3)  It's not clear what the algorithm for determining whether a key is
> valid in the Array case is.  Is the following key valid:
>
>    var obj = [];
>    Object.defineProperty(foo, "0", { value: 1 });
>
> ?  What about this one:
>
>    function getItem() {
>      return 1;
>    }
>    var obj = [];
>    Object.defineProperty(foo, "0", { get: getItem });
>
> ?  What about this one:
>
>    var obj = [];
>    function getItem() {
>      if (Math.random() < 0.99) {
>        return 1;
>      } else {
>        return obj;
>      }
>    }
>    Object.defineProperty(foo, "0", { get: getItem });

All three of those should have "var foo = [];", not "var obj = [];", and 
the last one should "return foo" as well.

-Boris
Received on Tuesday, 9 October 2012 18:44:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:55 GMT