Skip to content

Commit

Permalink
Release v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
petkaantonov committed Feb 5, 2014
1 parent 919fdb4 commit b8faaf8
Show file tree
Hide file tree
Showing 12 changed files with 2,562 additions and 253 deletions.
2,661 changes: 2,486 additions & 175 deletions browser/bundle.js

Large diffs are not rendered by default.

39 changes: 19 additions & 20 deletions js/browser/bluebird.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* bluebird build version 1.0.2
* bluebird build version 1.0.3
* Features enabled: core, timers, race, any, call_get, filter, generators, map, nodeify, promisify, props, reduce, settle, some, progress, cancel, synchronous_inspection
*/
/**
Expand Down Expand Up @@ -1665,8 +1665,7 @@ module.exports = function(Promise, isPromiseArrayProxy) {
if (typeof handler === "function") {
handler.call(receiver, progressValue, promise);
}
else if (typeof receiver._isProxied === "function" &&
receiver._isProxied()) {
else if (Promise.is(receiver) && receiver._isProxied()) {
receiver._progressUnchecked(progressValue);
}
else if (isPromiseArrayProxy(receiver, promise)) {
Expand Down Expand Up @@ -2575,7 +2574,7 @@ Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) {
var done = false;
var isFulfilled = this.isFulfilled();
if (receiver !== void 0) {
if (typeof receiver._isProxied === "function" &&
if (receiver instanceof Promise &&
receiver._isProxied()) {
receiver._unsetProxied();

Expand Down Expand Up @@ -4690,6 +4689,20 @@ module.exports = function(Promise, INTERNAL) {
if (obj instanceof Promise) {
return obj;
}
else if (isAnyBluebirdPromise(obj)) {
var ret = new Promise(INTERNAL);
ret._setTrace(caller, void 0);
obj._then(
ret._fulfillUnchecked,
ret._rejectUnchecked,
ret._progressUnchecked,
ret,
null,
void 0
);
ret._setFollowing();
return ret;
}
var then = getThen(obj);
if (then === errorObj) {
caller = typeof caller === "function" ? caller : Promise$_Cast;
Expand All @@ -4706,26 +4719,12 @@ module.exports = function(Promise, INTERNAL) {
return obj;
}

var hasProp = {}.hasOwnProperty;
function isAnyBluebirdPromise(obj) {
try {
return typeof obj._resolveFromSyncValue === "function";
}
catch(ignore) {
return false;
}
return hasProp.call(obj, "_promise0");
}

function Promise$_doThenable(x, then, caller, originalPromise) {
if (isAnyBluebirdPromise(x)) {
var ret = new Promise(INTERNAL);
ret._follow(x);
ret._setTrace(caller, void 0);
return ret;
}
return Promise$_doThenableSlowCase(x, then, caller, originalPromise);
}

function Promise$_doThenableSlowCase(x, then, caller, originalPromise) {
var resolver = Promise.defer(caller);
var called = false;
try {
Expand Down
3 changes: 1 addition & 2 deletions js/debug/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ module.exports = function(Promise, isPromiseArrayProxy) {
if (typeof handler === "function") {
handler.call(receiver, progressValue, promise);
}
else if (typeof receiver._isProxied === "function" &&
receiver._isProxied()) {
else if (Promise.is(receiver) && receiver._isProxied()) {
receiver._progressUnchecked(progressValue);
}
else if (isPromiseArrayProxy(receiver, promise)) {
Expand Down
4 changes: 3 additions & 1 deletion js/debug/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,8 @@ function Promise$_follow(promise) {
"arguments.length === 1");
ASSERT((this._isFollowingOrFulfilledOrRejected() === false),
"this._isFollowingOrFulfilledOrRejected() === false");
ASSERT(isPromise(promise),
"isPromise(promise)");
ASSERT((promise !== this),
"promise !== this");
this._setFollowing();
Expand Down Expand Up @@ -963,7 +965,7 @@ Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) {
var done = false;
var isFulfilled = this.isFulfilled();
if (receiver !== void 0) {
if (typeof receiver._isProxied === "function" &&
if (receiver instanceof Promise &&
receiver._isProxied()) {
ASSERT((! isPromise(promise)),
"!isPromise(promise)");
Expand Down
32 changes: 16 additions & 16 deletions js/debug/thenables.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ module.exports = function(Promise, INTERNAL) {
if (obj instanceof Promise) {
return obj;
}
else if (isAnyBluebirdPromise(obj)) {
var ret = new Promise(INTERNAL);
ret._setTrace(caller, void 0);
obj._then(
ret._fulfillUnchecked,
ret._rejectUnchecked,
ret._progressUnchecked,
ret,
null,
void 0
);
ret._setFollowing();
return ret;
}
var then = getThen(obj);
if (then === errorObj) {
caller = typeof caller === "function" ? caller : Promise$_Cast;
Expand All @@ -60,30 +74,16 @@ module.exports = function(Promise, INTERNAL) {
return obj;
}

var hasProp = {}.hasOwnProperty;
function isAnyBluebirdPromise(obj) {
try {
return typeof obj._resolveFromSyncValue === "function";
}
catch(ignore) {
return false;
}
return hasProp.call(obj, "_promise0");
}

function Promise$_doThenable(x, then, caller, originalPromise) {
ASSERT(((typeof then) === "function"),
"typeof then === \u0022function\u0022");
ASSERT((arguments.length === 4),
"arguments.length === 4");
if (isAnyBluebirdPromise(x)) {
var ret = new Promise(INTERNAL);
ret._follow(x);
ret._setTrace(caller, void 0);
return ret;
}
return Promise$_doThenableSlowCase(x, then, caller, originalPromise);
}

function Promise$_doThenableSlowCase(x, then, caller, originalPromise) {
var resolver = Promise.defer(caller);
var called = false;
try {
Expand Down
3 changes: 1 addition & 2 deletions js/main/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ module.exports = function(Promise, isPromiseArrayProxy) {
if (typeof handler === "function") {
handler.call(receiver, progressValue, promise);
}
else if (typeof receiver._isProxied === "function" &&
receiver._isProxied()) {
else if (Promise.is(receiver) && receiver._isProxied()) {
receiver._progressUnchecked(progressValue);
}
else if (isPromiseArrayProxy(receiver, promise)) {
Expand Down
2 changes: 1 addition & 1 deletion js/main/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) {
var done = false;
var isFulfilled = this.isFulfilled();
if (receiver !== void 0) {
if (typeof receiver._isProxied === "function" &&
if (receiver instanceof Promise &&
receiver._isProxied()) {
receiver._unsetProxied();

Expand Down
32 changes: 16 additions & 16 deletions js/main/thenables.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ module.exports = function(Promise, INTERNAL) {
if (obj instanceof Promise) {
return obj;
}
else if (isAnyBluebirdPromise(obj)) {
var ret = new Promise(INTERNAL);
ret._setTrace(caller, void 0);
obj._then(
ret._fulfillUnchecked,
ret._rejectUnchecked,
ret._progressUnchecked,
ret,
null,
void 0
);
ret._setFollowing();
return ret;
}
var then = getThen(obj);
if (then === errorObj) {
caller = typeof caller === "function" ? caller : Promise$_Cast;
Expand All @@ -58,26 +72,12 @@ module.exports = function(Promise, INTERNAL) {
return obj;
}

var hasProp = {}.hasOwnProperty;
function isAnyBluebirdPromise(obj) {
try {
return typeof obj._resolveFromSyncValue === "function";
}
catch(ignore) {
return false;
}
return hasProp.call(obj, "_promise0");
}

function Promise$_doThenable(x, then, caller, originalPromise) {
if (isAnyBluebirdPromise(x)) {
var ret = new Promise(INTERNAL);
ret._follow(x);
ret._setTrace(caller, void 0);
return ret;
}
return Promise$_doThenableSlowCase(x, then, caller, originalPromise);
}

function Promise$_doThenableSlowCase(x, then, caller, originalPromise) {
var resolver = Promise.defer(caller);
var called = false;
try {
Expand Down
3 changes: 1 addition & 2 deletions js/zalgo/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ module.exports = function(Promise, isPromiseArrayProxy) {
if (typeof handler === "function") {
handler.call(receiver, progressValue, promise);
}
else if (typeof receiver._isProxied === "function" &&
receiver._isProxied()) {
else if (Promise.is(receiver) && receiver._isProxied()) {
receiver._progressUnchecked(progressValue);
}
else if (isPromiseArrayProxy(receiver, promise)) {
Expand Down
2 changes: 1 addition & 1 deletion js/zalgo/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ Promise.prototype._settlePromiseAt = function Promise$_settlePromiseAt(index) {
var done = false;
var isFulfilled = this.isFulfilled();
if (receiver !== void 0) {
if (typeof receiver._isProxied === "function" &&
if (receiver instanceof Promise &&
receiver._isProxied()) {
receiver._unsetProxied();

Expand Down
32 changes: 16 additions & 16 deletions js/zalgo/thenables.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ module.exports = function(Promise, INTERNAL) {
if (obj instanceof Promise) {
return obj;
}
else if (isAnyBluebirdPromise(obj)) {
var ret = new Promise(INTERNAL);
ret._setTrace(caller, void 0);
obj._then(
ret._fulfillUnchecked,
ret._rejectUnchecked,
ret._progressUnchecked,
ret,
null,
void 0
);
ret._setFollowing();
return ret;
}
var then = getThen(obj);
if (then === errorObj) {
caller = typeof caller === "function" ? caller : Promise$_Cast;
Expand All @@ -58,26 +72,12 @@ module.exports = function(Promise, INTERNAL) {
return obj;
}

var hasProp = {}.hasOwnProperty;
function isAnyBluebirdPromise(obj) {
try {
return typeof obj._resolveFromSyncValue === "function";
}
catch(ignore) {
return false;
}
return hasProp.call(obj, "_promise0");
}

function Promise$_doThenable(x, then, caller, originalPromise) {
if (isAnyBluebirdPromise(x)) {
var ret = new Promise(INTERNAL);
ret._follow(x);
ret._setTrace(caller, void 0);
return ret;
}
return Promise$_doThenableSlowCase(x, then, caller, originalPromise);
}

function Promise$_doThenableSlowCase(x, then, caller, originalPromise) {
var resolver = Promise.defer(caller);
var called = false;
try {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
"version": "1.0.2",
"version": "1.0.3",
"keywords": [
"promise",
"performance",
Expand Down

0 comments on commit b8faaf8

Please sign in to comment.