ysmood / yaku

A lightweight promise library
https://tonicdev.com/ysmood/yaku
MIT License
290 stars 28 forks source link

Callbackify won't callback if the callback is the only argument #25

Closed hurrymaplelad closed 8 years ago

hurrymaplelad commented 8 years ago

This prints done as expected:

callbackify(function() {
  return Y.resolve('a');
})(1, function() {
  return console.log('done');
});

while this does not:

callbackify(function() {
  return Y.resolve('a');
})(function() {
  return console.log('done');
});

The only difference is the first example passes an extra (unused) argument to the function returned by callbackify.

ysmood commented 8 years ago

Thanks for your report. I have added two test cases for this function. The fixed new version has published.