()
| 629 | } |
| 630 | |
| 631 | next() { |
| 632 | const type = this._type; |
| 633 | let stack = this._stack; |
| 634 | while (stack) { |
| 635 | const node = stack.node; |
| 636 | const index = stack.index++; |
| 637 | let maxIndex; |
| 638 | if (node.entry) { |
| 639 | if (index === 0) { |
| 640 | return mapIteratorValue(type, node.entry); |
| 641 | } |
| 642 | } else if (node.entries) { |
| 643 | maxIndex = node.entries.length - 1; |
| 644 | if (index <= maxIndex) { |
| 645 | return mapIteratorValue( |
| 646 | type, |
| 647 | node.entries[this._reverse ? maxIndex - index : index] |
| 648 | ); |
| 649 | } |
| 650 | } else { |
| 651 | maxIndex = node.nodes.length - 1; |
| 652 | if (index <= maxIndex) { |
| 653 | const subNode = node.nodes[this._reverse ? maxIndex - index : index]; |
| 654 | if (subNode) { |
| 655 | if (subNode.entry) { |
| 656 | return mapIteratorValue(type, subNode.entry); |
| 657 | } |
| 658 | stack = this._stack = mapIteratorFrame(subNode, stack); |
| 659 | } |
| 660 | continue; |
| 661 | } |
| 662 | } |
| 663 | stack = this._stack = this._stack.__prev; |
| 664 | } |
| 665 | return iteratorDone(); |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | function mapIteratorValue(type, entry) { |
no test coverage detected