- From: Erik Arvidsson <arv@chromium.org>
- Date: Thu, 20 Oct 2011 09:05:41 -0700
- To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
- Cc: Alex Russell <slightlyoff@google.com>, Webapps WG <public-webapps@w3.org>, Yehuda Katz <wycats@gmail.com>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>, Cameron McCormack <cam@mcc.id.au>
On Thu, Oct 20, 2011 at 04:37, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
> On 2011-10-20 13:18, Alex Russell wrote:
>>
>> On Thu, Oct 20, 2011 at 12:05 PM, Lachlan Hunt<lachlan.hunt@lachy.id.au>
>> wrote:
>>>
>>> We need NodeList separate from Array where they are live lists.
>>
>> No we don't. The fact that there's someone else who has a handle to
>> the list and can mutate it underneath you is a documentation issue,
>> not a question of type...unless the argument is that the slots should
>> be non-configurable, non-writable except by the browser that's also
>> holding a ref to it.
>
> The author cannot be allowed to directly modify a live list, as such it must
> be an immutable object from the script's perspective. Otherwise, things
> would get really complicated if this happened:
>
> var p = document.getElementsByTagName("p");
> p.reverse();
Just define [[Put]] to throw (by only having a getter). Since reverse
is defined using [[Put]] things would work as expected.
--
erik
Received on Thursday, 20 October 2011 16:06:34 UTC