diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-14 08:55:29 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-14 08:55:29 +0200 |
commit | ba6602b2de951beb74ef0f43a1cbae33ff0548e2 (patch) | |
tree | cd7ef9a34649d796bc0cc00bb708c7218ff5098f /js/src/builtin/Iterator.js | |
parent | 6452e3c9785260f21c5013d31e855e7b3e0497f4 (diff) | |
download | UXP-ba6602b2de951beb74ef0f43a1cbae33ff0548e2.tar UXP-ba6602b2de951beb74ef0f43a1cbae33ff0548e2.tar.gz UXP-ba6602b2de951beb74ef0f43a1cbae33ff0548e2.tar.lz UXP-ba6602b2de951beb74ef0f43a1cbae33ff0548e2.tar.xz UXP-ba6602b2de951beb74ef0f43a1cbae33ff0548e2.zip |
Bug 1326453 - Part 5: Remove no longer used ListIterator implementation
Diffstat (limited to 'js/src/builtin/Iterator.js')
-rw-r--r-- | js/src/builtin/Iterator.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/js/src/builtin/Iterator.js b/js/src/builtin/Iterator.js index 735eec7a0..e25b76156 100644 --- a/js/src/builtin/Iterator.js +++ b/js/src/builtin/Iterator.js @@ -84,44 +84,3 @@ function LegacyIteratorShim() { function LegacyGeneratorIteratorShim() { return NewLegacyIterator(ToObject(this), LegacyGeneratorIterator); } - -// 7.4.8 CreateListIterator() -function CreateListIterator(array) { - let iterator = NewListIterator(); - UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_TARGET, array); - UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_NEXT_INDEX, 0); - - // 7.4.8.1 ListIterator next() - // The spec requires that we use a new next function per iterator object. - let next = function() { - if (!IsObject(this) || !IsListIterator(this)) - return callFunction(CallListIteratorMethodIfWrapped, this, "ListIteratorNext"); - - if (ActiveFunction() !== UnsafeGetReservedSlot(this, ITERATOR_SLOT_NEXT_METHOD)) - ThrowTypeError(JSMSG_INCOMPATIBLE_METHOD, "next", "method", ToString(this)); - - let array = UnsafeGetObjectFromReservedSlot(this, ITERATOR_SLOT_TARGET); - let index = UnsafeGetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX); - - if (index >= ToLength(array.length)) { - UnsafeSetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX, 1/0); - return { value: undefined, done: true }; - } - - UnsafeSetReservedSlot(this, ITERATOR_SLOT_NEXT_INDEX, index + 1); - return { value: array[index], done: false }; - }; - - UnsafeSetReservedSlot(iterator, ITERATOR_SLOT_NEXT_METHOD, next); - iterator.next = next; - - iterator[std_iterator] = ListIteratorIdentity; - return iterator; -} - -function ListIteratorIdentity() { - if (!IsObject(this) || !IsListIterator(this)) - return callFunction(CallListIteratorMethodIfWrapped, this, "ListIteratorIdentity"); - - return this; -} |