Skip to content

Commit

Permalink
Keep variable name as x
Browse files Browse the repository at this point in the history
  • Loading branch information
petkaantonov committed Dec 27, 2014
1 parent a986b60 commit 3e4bbe3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,17 +611,17 @@ Promise.prototype._settlePromiseFromHandler = function (
if (x !== NEXT_FILTER) promise._attachExtraTrace(trace);
promise._rejectUnchecked(err, trace);
} else {
var castValue = tryConvertToPromise(x, promise);
if (castValue instanceof Promise) {
if (castValue.isRejected() &&
!castValue._isCarryingStackTrace() &&
!canAttachTrace(castValue._settledValue)) {
var trace = new Error(castValue._settledValue + "");
x = tryConvertToPromise(x, promise);
if (x instanceof Promise) {
if (x.isRejected() &&
!x._isCarryingStackTrace() &&
!canAttachTrace(x._settledValue)) {
var trace = new Error(x._settledValue + "");
promise._attachExtraTrace(trace);
castValue._setCarriedStackTrace(trace);
x._setCarriedStackTrace(trace);
}
promise._follow(castValue);
promise._propagateFrom(castValue, PROPAGATE_CANCEL);
promise._follow(x);
promise._propagateFrom(x, PROPAGATE_CANCEL);
} else {
promise._fulfillUnchecked(x);
}
Expand Down Expand Up @@ -753,6 +753,7 @@ Promise.prototype._settlePromiseAt = function (index) {
if (receiver instanceof Promise &&
receiver._isProxied()) {
if (receiver.isRejected()) return;

ASSERT(!receiver.isFulfilled() && !receiver.isRejected());
//Must be smuggled data if proxied
receiver._unsetProxied();
Expand Down

0 comments on commit 3e4bbe3

Please sign in to comment.