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 16:15:47 -0400
Message-ID: <CAHfnhfpxx5WG6ikGMvBnCV2fqFQpJJ4Ck5Yr_qM-f-9dC-JKFQ@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: "Mark S. Miller" <erights@google.com>, 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:57 PM, Domenic Denicola <
domenic@domenicdenicola.com> wrote:

> What would change notifications look like for a Map, say? My impression of
> change notifications was that they usually applied to properties, not to
> general internal mutable state.

Naively, I would guess something like...

var o = {};
var m = Object.observe(new Map(), function(change) {
  console.log( change );

m.set(o, 1);

// Produces
    key: ...a reference to `o`
    object: ...a reference to `m`
    type: "new"

(the key reference to `o` is my concern point for Weak* object observation)

...Of course, this is just made-up for the sake of entertaining a question
that I don't have a better answer for ;)

Received on Monday, 17 June 2013 20:16:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:13 UTC