W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: Specs and Object.observe()

From: Rick Waldron <waldron.rick@gmail.com>
Date: Mon, 17 Jun 2013 15:50:53 -0400
Message-ID: <CAHfnhforYX-fnWZ=oYVd-iojuP9eQ5ZmCtwiXK+KDzUKP=aeGA@mail.gmail.com>
To: "Mark S. Miller" <erights@google.com>
Cc: François REMY <francois.remy.dev@outlook.com>, Marcos Caceres <w3c@marcosc.com>, public-script-coord <public-script-coord@w3.org>
On Mon, Jun 17, 2013 at 3:35 PM, Mark S. Miller <erights@google.com> wrote:

> On Mon, Jun 17, 2013 at 11:59 AM, Rick Waldron <waldron.rick@gmail.com>wrote:
>
>>
>> On Mon, Jun 17, 2013 at 5:55 AM, François REMY <
>> francois.remy.dev@outlook.com> wrote:
>>
>>> As far as I know, Object.observe only works for "plain objects" i.e. it
>>> doesn't fire when properties with getter/setter are changed. If you are
>>> working on a DOM spec, it's very likely you're in this specific case.
>>>
>>
>> Object.observe works with all objects. Some objects, such as Dates, Maps,
>> Sets, WeakMaps and likely WeakSets will not trigger change events when
>> their internal data is modified via methods (setTime, set, add, delete,
>> etc), but defining and later modifying expando properties will trigger a
>> change. (This list is not exhaustive)
>>
>
> Hi Rick, I never recall deciding that they would not.
>

Exactly, we haven't :)

I think at least Date, Map and Set should, but we haven't addressed this
yet and have plenty of ES6 to finish before we can really look closer (as a
committee). Above, I'm merely illustrating the current state—I apologize if
that was unclear.



> In general, mutable abstractions should consider sending synthetic change
> notifications if anyone is listening. We need to take it on a case by case
> basis per mutable abstraction, and on the design of these particular
> synthetic change notifications. But I see no immediate reason why the
> non-Weak* ones above would be candidates. Even the Weak* ones perhaps, if
> we're careful enough with the security issues.
>

I'm +1 to the non-Weak* APIs, but agree that we should at least explore the
safe ways to do the Weak* APIs.

Rick
Received on Monday, 17 June 2013 19:51:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC