Commit 51878cf5 authored by Yehuda Katz's avatar Yehuda Katz

Support overriding the async function

parent 8a111c0c
...@@ -39,6 +39,8 @@ if (typeof process !== 'undefined') { ...@@ -39,6 +39,8 @@ if (typeof process !== 'undefined') {
}; };
} }
RSVP.async = async;
var Event = exports.Event = function(type, options) { var Event = exports.Event = function(type, options) {
this.type = type; this.type = type;
...@@ -182,7 +184,7 @@ Promise.prototype = { ...@@ -182,7 +184,7 @@ Promise.prototype = {
}, },
resolve: function(value) { resolve: function(value) {
async(function() { RSVP.async(function() {
this.trigger('promise:resolved', { detail: value }); this.trigger('promise:resolved', { detail: value });
this.isResolved = value; this.isResolved = value;
}, this); }, this);
...@@ -192,7 +194,7 @@ Promise.prototype = { ...@@ -192,7 +194,7 @@ Promise.prototype = {
}, },
reject: function(value) { reject: function(value) {
async(function() { RSVP.async(function() {
this.trigger('promise:failed', { detail: value }); this.trigger('promise:failed', { detail: value });
this.isRejected = value; this.isRejected = value;
}, this); }, this);
......
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