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

Re: QSA, the problem with ":scope", and naming

From: Erik Arvidsson <arv@chromium.org>
Date: Thu, 20 Oct 2011 09:02:10 -0700
Message-ID: <CAJ8+Goio7nUi+a+YrChH2Tnhmb7zxvWb+zNxrf+SRK+zSBP3UA@mail.gmail.com>
To: Alex Russell <slightlyoff@google.com>
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, 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:18, Alex Russell <slightlyoff@google.com> wrote:
> 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.

That is an ES violation. A non configurable, non writable data
property is not allowed to change its value.

var descr = Object.getOwnPropertyDescription(object, name);
if (!descr.configurable && !decsr.writable && ('value' in descr)) {
  var value = descr.value;
  setInterval(function() {
    // Must never change
    assert(object[name] === value);

Therefore there is no such thing as an immutable live NodeList.

There are ways around this.

1. Use a getter
2. Make it configurable

Received on Thursday, 20 October 2011 16:02:59 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC