@internal
(holder, nativeFunction, Class)
| 6 | |
| 7 | /** @internal */ |
| 8 | function* nativeIterator(holder, nativeFunction, Class) { |
| 9 | const iterator = Memory.alloc(Process.pointerSize); |
| 10 | let handle; |
| 11 | while (!(handle = nativeFunction(holder, iterator)).isNull()) { |
| 12 | yield new Class(handle); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | exports.nativeIterator = nativeIterator; |
| 17 |