Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 02c88f9

Browse files
committed
refactor($q): make $q Promises A+ v1.1 compilant
Refactor to make $q Promises A+ v1.1 compilant
1 parent 756c52d commit 02c88f9

File tree

4 files changed

+132
-183
lines changed

4 files changed

+132
-183
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
var isFunction = function isFunction(value){return typeof value == 'function';}
2+
var isObject = function isObject(value){return value != null && typeof value === 'object';}
23

34
var $q = qFactory(process.nextTick, function noopExceptionHandler() {});
45

5-
exports.fulfilled = $q.resolve;
6+
//exports.resolved = $q.resolve;
67
exports.rejected = $q.reject;
7-
exports.pending = function () {
8-
var deferred = $q.defer();
8+
exports.deferred = function () {
9+
var deferred = $q.defer();
910

10-
return {
11-
promise: deferred.promise,
12-
fulfill: deferred.resolve,
13-
reject: deferred.reject
14-
};
11+
return {
12+
promise: deferred.promise,
13+
resolve: deferred.resolve,
14+
reject: deferred.reject
15+
};
1516
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"grunt-parallel": "~0.3.1",
3838
"grunt-ddescribe-iit": "~0.0.1",
3939
"grunt-merge-conflict": "~0.0.1",
40-
"promises-aplus-tests": "~1.3.2",
40+
"promises-aplus-tests": "~2.0.3",
4141
"grunt-shell": "~0.4.0",
4242
"semver": "~2.1.0",
4343
"lodash": "~2.1.0",

0 commit comments

Comments
 (0)