cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

callbacks.call example doesn't work #460

Closed ChrisEineke closed 9 years ago

ChrisEineke commented 9 years ago
$ node --version
v0.10.35
var callbacks = require("when/callbacks");
var waitFiveSeconds = callbacks.call(setTimeout, 5000);
timers.js:219
      callback.apply(timer, args);
               ^
TypeError: Object 5000 has no method 'apply'
    at timer._onTimeout (timers.js:219:16)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
briancavalier commented 9 years ago

Thanks, @ceineke. I'll take a look.

briancavalier commented 9 years ago

Yep, that example is pretty bone-headed ... who wrote that?!? :D I'll add a better one soon

briancavalier commented 9 years ago

See #461