archives

« Bugzilla Issues Index

#3785 — 22.1.5.2.1, 23.1.5.2.1, 23.2.5.2.1: Use CreateArrayFromList in {Array, Map, Set}Iterator#next() ?


The next() methods can be simplified when CreateArrayFromList is used instead of manually calling ArrayCreate + CreateDataProperty.


22.1.5.2.1 %ArrayIteratorPrototype%.next( )
- steps 17.b-e

> Let result be CreateArrayFromList(« index, elementValue »).


23.1.5.2.1 %MapIteratorPrototype%.next ( )
- steps 10.d.iii.2-5

> Let result be CreateArrayFromList(« e.[[key]], e.[[value]] »).


23.2.5.2.1 %SetIteratorPrototype%.next ( )
- steps 10.d.i.1-4

> Let result be CreateArrayFromList(« e, e »).


fixed in rev33 editor's draft

strangely enough, I had the same idea the afternoon before you submitted this.


fixed in rev33