- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Tue, 09 Oct 2012 14:44:15 -0400
- 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 UTC