bigeasy / cadence

A Swiss Army asynchronous control flow function for JavaScript.
https://bigeasy.github.io/cadence
MIT License
35 stars 7 forks source link

cadence logic "tricks" dblite package #322

Closed mrose17 closed 9 years ago

mrose17 commented 9 years ago

https://github.com/WebReflection/dblite/blob/master/build/dblite.node.js#L350 has this:

            // if there was an error signature
            if (1 < callback.length) {
              callback.call(self, null, rows);
            } else {
              // invoke it with the db object as context
              callback.call(self, rows);
            }

when using db.query(query, [ params ], async()) the dblite code calls callback.length and gets 0 causing callback.call(self, rows) to be called instead of callback.call(self, null, rows)

i don't know if it's possible to harmonize this with the other asynchronous packages that are used with dblite. comments? thanks!

mrose17 commented 9 years ago

cf., https://github.com/bigeasy/cadence/issues/322

bigeasy commented 9 years ago

That is very silly on the part of dblite. I'll add an error to the callback signature. You're going to need to upgrade to Cadence 0.2.x where new things happen.

mrose17 commented 9 years ago

alan - thanks. that works!