Set Objects

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Apr 4 09:31:14 PDT 2013


On Apr 3, 2013, at 9:17 PM, Peter Michaux wrote:

> On Fri, Mar 29, 2013 at 5:04 PM, Allen Wirfs-Brock
> <allen at wirfs-brock.com> wrote:
>> 
>> On Mar 29, 2013, at 3:02 PM, Peter Michaux wrote:
> 
> 
>>> 15.16.4.6
>>> 
>>> Why will callbackfn be called with the first two parameters being the
>>> same? That does not seem like the most practical or intuitive behavior
>>> for a set.
>> 
>> 
>> The intent is that all forEach methods use the same callback signature.
>> This is explained in the second note.
>> 
>> 
>>> The third NOTE about visiting elements that are deleted or added
>>> during iteration is excellent. Browsers have certainly varied in their
>>> behavior.
>> 
>> 
>> Yes, but this is just a note.  The specification algorithm normatively
>> exhibit this behavior which is where it really counts.
> 
> In that case, I think the second note might be an error. The
> specification algorithm has the following
> 
> 8.a.i) Let funcResult be the result of calling the [[Call]] internal
> method of callbackfn with T as thisArgument and a List containing e
> and S as argumentsList.
> 
> That means the callback function is called with only two arguments not
> three as mentioned in the second note.
> 


Actually, the code in the algorithm was wrong.  I've fixed it to pass three arguments.

Thanks,
Allen





More information about the es-discuss mailing list