You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Database}from'node:sqlite';constdb=newDatabase(':memory:');db.createModule('empty',{columns: [{name: 'value',type: 'INTEGER'}],rows(){return{[Symbol.iterator](){returnthis;},next(){return{value: [],done: true};},// empty: exhausted immediatelyreturn(){thrownewError('cleanup boom');},};},});console.log(db.prepare('SELECT value FROM empty').all());
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Once next() reports done: true, the iterator is finished and return() must be skipped, matching for...of semantics where return() is only called on abrupt termination; the query should return [].
What do you see instead?
throws Error: cleanup boom from the custom iterator's return() even though the iterable is empty and was exhausted normally.
Activity