rvagg/node-levelup — pull request #87 by dominictarr (2013-03-03 07:05:10+00:00)
Title: Safe deferred open

Make it safe to patch (put, del, batch, get, and approximateSize)

When the database is opening, it will never call the (possibly) patched method twice.

Adds a test and a fix.

This will close https://github.com/rvagg/node-levelup/issues/86

I could do this a different way, but this corrects the behaviour and passes the test.
Prehaps adding a `_put` (etc) method, which handles the defering, while _db isn't defined.

or, `this._db` could initially be set to a temporary binding, that does the defering, and is later replaced.