Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

d

  • Loading branch information...
commit 7a87781a89db4e90c5a26b02a767a618023610de 1 parent e4746de
杨杰 authored
Showing with 9 additions and 1 deletion.
  1. +2 −0  lib/index.js
  2. +7 −1 lib/promise.js
2  lib/index.js
View
@@ -36,6 +36,8 @@ module.exports = {
return new EnhancedPreservedEvent();
},
+ wrap: wrap,
+
then: promise.then,
when: promise.when,
8 lib/promise.js
View
@@ -94,8 +94,8 @@ var Promise = PromiseInterFace.extend(
};
var dispose = handle(evaluateArgs);
- // if return something that was not a dispose
+ // if return something that was not a dispose
if (returnValueNeedToBeEvaluate(dispose)) {
evaluateArgs(dispose);
}
@@ -220,6 +220,12 @@ var checkEachSubscribables = function(subscribables, check) {
var never = new Promise(noop);
var aggregate = {
+ wrap: function() {
+ var proto = Object.create(ReturnObjectPromise.prototype);
+ ReturnObjectPromise.apply(proto, arguments);
+ return proto;
+ },
+
then: function(fn) {
return new Promise(fn);
},
Please sign in to comment.
Something went wrong with that request. Please try again.