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

Re: sequence and iterables

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 15 Nov 2013 19:09:17 -0800
Message-ID: <CA+c2ei-kHbd_+4FEUngrHfrDr=1Jamk3wYxjWsWDsprPD=Noww@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>, Anne van Kesteren <annevk@annevk.nl>
On Fri, Nov 15, 2013 at 6:47 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 11/15/13 9:32 PM, Jonas Sicking wrote:
>> These two are only distinguishable from outside of 'f' if doStuff
>> synchronously calls back into "external code".
> More precisely, if doStuff has any synchronous side-effects the caller can
> detect.

Just having side effects isn't really enough, no? It needs to be also
possible for the caller to synchronously run code after the side
effects of the doStuff calls for some items have happened, but before
the side effects of other doStuff calls have happened.

For example if doStuff(n) simply adds the value 'n' to some page
accessible state, that is a side effect, but not enough of a side
effect that the page can detect iterating vs. snapshotting. Likewise
if doStuff(n) appends 'n' to some array that also isn't enough. At
least assuming that the page can't change the array such that it can
cause setters to run while the array is modified.

So you really need some form of callback as far as I can tell.

> The proposed spec for Promise.all is what prompted my mail.
> That said, you seem to be right; in the DOM and HTML specs as of today there
> seem to be no uses of sequence where the difference would be observable....
> So maybe I shouldn't worry about it.

I wouldn't worry about it until it happens more often.

/ Jonas
Received on Saturday, 16 November 2013 03:10:14 UTC

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