rvagg/node-abstract-leveldown — pull request #5 by mcollina (2013-05-10 10:17:23+00:00)
Title: iterator#next and iterator#end should not throw if there is a callback

In the `iterator-test.js` is specified that if `next` is called after `end`, then it should _throw_ an exception, instead of passing through the callback, as in the node callback style.
This causes the ReadStream in LevelUp not to emit `error` accordingly.

You can find an example of the behavior here: https://gist.github.com/mcollina/5544554.
It should be expected that the error is logged, instead it halts the program.

These are the lines in abstract-leveldown:
https://github.com/rvagg/node-abstract-leveldown/blob/master/abstract/iterator-test.js#L74-L85

And these in leveldown:
https://github.com/rvagg/node-leveldown/blob/master/src/iterator.cc#L138-L144

And these in levelup:
https://github.com/rvagg/node-levelup/blob/master/lib/read-stream.js#L121-L126

This can be fixed in leveldown, or the call to `next` wrapped in a try-catch in LevelUp.
I think it should be fixed in LevelDown.

I have a patch ready for LevelDown.
@rvagg @dominictarr let me know how to proceed.