archives

« Bugzilla Issues Index

#916 — 15.16.1.1 SetInitialisation 10.c ToObject() bogus, 10.e references v


In 15.16.1.1 SetInitialisation, two copy/paste-isms from MapInitialization:

10. Repeat
a. Let next be the result of performing Invoke with arguments "next", itr, and an empty arguments
List.
b. If IteratorComplete(next) is true, then return NormalCompletion(obj).
c. Let next be ToObject(next).
d. ReturnIfAbrupt(next).
e. Let status be the result of calling the [[Call]] internal method of adder with obj as thisArgument and a List whose sole element is v as argumentsList.
f. ReturnIfAbrupt(status).

10.c does a ToObject() conversion of |next|. This would make sense for Map where the iteration is expecting elements of the form [key, value], but for set the result yielded by the iterator should be used directly. As written, Set([1]).has(1) would return false. Steps c and d should be deleted.

10.e references |v|, which is not previously mentioned. This should be |next| instead.


corrected in rev 12 editor's draft


corrected in rev 12, Nov. 22, 2012 draft