Re: sequence and iterables

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.

And there are some complications if there are arguments that come after 
the iterable; webidl right now would say you snapshot before you coerce 
those.

> There are several APIs in ES5/ES6 which does do this. Array.map would
> be an obvious example. And for those APIs I believe they explicitly
> define that no snapshotting happens.

Indeed.

> However in the DOM I think we have very few APIs that synchronously
> call back out to external code while using an array-like.

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.

-Boris

Received on Saturday, 16 November 2013 02:48:13 UTC