CC-Archived / promise-as3

Promises/A+ compliant implementation in ActionScript 3.0
168 stars 55 forks source link

Promise.when handlers expects exactly one argument #8

Closed pmowrer closed 11 years ago

pmowrer commented 12 years ago

This issue is filed under the assumption that a promise may resolve/reject/notify/cancel with any number of arguments (or none).

The following will cause an argument count mismatch error to be thrown:

var dfd:Deferred = new Deferred();
Promise.when(dfd.promise);
dfd.resolve();

Easy fix is to modify the inline handlers in .when to take rest parameters. Question is what the expectations should be for the arguments. For example, in testWhen_withFunction, a null argument is expected when a function is passed -- now that'll be an array containing a null.

johnyanarella commented 11 years ago

This issue refers to the now-abandoned jQuery 1.4-style implementation.

promise-as3 has been rewritten to implement the Promises/A+ specification.