Commit b2c76d2e authored by Romain Courteaud's avatar Romain Courteaud

Queue: ensure Queue arguments are propagated without new

parent 27cc7f68
...@@ -21,7 +21,7 @@ var Queue = function(thenable) { ...@@ -21,7 +21,7 @@ var Queue = function(thenable) {
resolved; resolved;
if (!(this instanceof Queue)) { if (!(this instanceof Queue)) {
return new Queue(); return new Queue(thenable);
} }
function canceller() { function canceller() {
......
...@@ -2265,6 +2265,16 @@ describe("`RSVP.Queue`", function () { ...@@ -2265,6 +2265,16 @@ describe("`RSVP.Queue`", function () {
}, 20); }, 20);
}); });
it('should be fulfilled without new with the thenable argument', function (done) {
var queue = RSVP.Queue(RSVP.resolve('bar'));
setTimeout(function() {
assert.equal(queue.isFulfilled, true);
assert.equal(queue.fulfillmentValue, 'bar');
done();
}, 20);
});
it('should be rejected with the rejected thenable argument', function (done) { it('should be rejected with the rejected thenable argument', function (done) {
var queue = new RSVP.Queue(RSVP.reject('ko')); var queue = new RSVP.Queue(RSVP.reject('ko'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment