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

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 UTC