Skip to content

Commit

Permalink
Fixed regression introduced by the makePromise name-change.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jan 29, 2011
1 parent f5ca7a1 commit bd93de1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/q.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ function defer() {
* of the returned object, apart from that it is usable whereever promises are
* bought and sold.
*/
exports.makePromise = makePromise;
exports.Promise = makePromise; // deprecated
exports.makePromise = Promise;
exports.Promise = Promise; // deprecated

function makePromise(descriptor, fallback, valueOf) {
function Promise(descriptor, fallback, valueOf) {

if (fallback === undefined) {
fallback = function (op) {
Expand Down Expand Up @@ -229,7 +229,7 @@ function isRejected(object) {
*/
exports.reject = reject;
function reject(reason) {
return makePromise({
return Promise({
"when": function (rejected) {
return rejected ? rejected(reason) : reject(reason);
}
Expand Down Expand Up @@ -260,7 +260,7 @@ function ref(object) {
// not already Promises.
if (isPromise(object))
return object;
return makePromise({
return Promise({
"when": function (rejected) {
return object;
},
Expand Down Expand Up @@ -299,7 +299,7 @@ function ref(object) {
*/
exports.def = def;
function def(object) {
return makePromise({
return Promise({
"isDef": function () {}
}, function fallback(op, resolved) {
var args = Array.prototype.slice.call(arguments, 2);
Expand Down

0 comments on commit bd93de1

Please sign in to comment.