зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e449addcdf75 (bug 1062323) for gaia-unit test failures in compose_test.js
This commit is contained in:
Родитель
e9a4b9b26c
Коммит
65c7f7ccb7
|
@ -203,13 +203,13 @@ WrapperPromiseCallback::Call(JSContext* aCx,
|
|||
|
||||
ErrorResult rv;
|
||||
|
||||
// PromiseReactionTask step 6
|
||||
// If invoking callback threw an exception, run resolver's reject with the
|
||||
// thrown exception as argument and the synchronous flag set.
|
||||
JS::Rooted<JS::Value> retValue(aCx);
|
||||
mCallback->Call(value, &retValue, rv, CallbackObject::eRethrowExceptions);
|
||||
|
||||
rv.WouldReportJSException();
|
||||
|
||||
// PromiseReactionTask step 7
|
||||
if (rv.Failed() && rv.IsJSException()) {
|
||||
JS::Rooted<JS::Value> value(aCx);
|
||||
rv.StealJSException(aCx, &value);
|
||||
|
@ -219,7 +219,7 @@ WrapperPromiseCallback::Call(JSContext* aCx,
|
|||
return;
|
||||
}
|
||||
|
||||
mNextPromise->RejectInternal(aCx, value);
|
||||
mNextPromise->RejectInternal(aCx, value, Promise::SyncTask);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -284,13 +284,14 @@ WrapperPromiseCallback::Call(JSContext* aCx,
|
|||
}
|
||||
}
|
||||
|
||||
// Otherwise, run resolver's resolve with value.
|
||||
// Otherwise, run resolver's resolve with value and the synchronous flag
|
||||
// set.
|
||||
if (!JS_WrapValue(aCx, &retValue)) {
|
||||
NS_WARNING("Failed to wrap value into the right compartment.");
|
||||
return;
|
||||
}
|
||||
|
||||
mNextPromise->ResolveInternal(aCx, retValue);
|
||||
mNextPromise->ResolveInternal(aCx, retValue, Promise::SyncTask);
|
||||
}
|
||||
|
||||
// NativePromiseCallback
|
||||
|
|
|
@ -674,45 +674,6 @@ function promiseTestAsyncThenableResolution()
|
|||
});
|
||||
}
|
||||
|
||||
// Bug 1062323
|
||||
function promiseWrapperAsyncResolution()
|
||||
{
|
||||
var p = new Promise(function(resolve, reject){
|
||||
resolve();
|
||||
});
|
||||
|
||||
var results = [];
|
||||
var q = p.then(function () {
|
||||
results.push("1-1");
|
||||
}).then(function () {
|
||||
results.push("1-2");
|
||||
}).then(function () {
|
||||
results.push("1-3");
|
||||
});
|
||||
|
||||
var r = p.then(function () {
|
||||
results.push("2-1");
|
||||
}).then(function () {
|
||||
results.push("2-2");
|
||||
}).then(function () {
|
||||
results.push("2-3");
|
||||
});
|
||||
|
||||
Promise.all([q, r]).then(function() {
|
||||
var match = results[0] == "1-1" &&
|
||||
results[1] == "2-1" &&
|
||||
results[2] == "1-2" &&
|
||||
results[3] == "2-2" &&
|
||||
results[4] == "1-3" &&
|
||||
results[5] == "2-3";
|
||||
ok(match, "Chained promises should resolve asynchronously.");
|
||||
runTest();
|
||||
}, function() {
|
||||
ok(false, "promiseWrapperAsyncResolution: One of the promises failed.");
|
||||
runTest();
|
||||
});
|
||||
}
|
||||
|
||||
var tests = [ promiseResolve, promiseReject,
|
||||
promiseException, promiseGC, promiseAsync,
|
||||
promiseDoubleThen, promiseThenException,
|
||||
|
@ -745,7 +706,6 @@ var tests = [ promiseResolve, promiseReject,
|
|||
promiseResolvePromise,
|
||||
promiseResolveThenableCleanStack,
|
||||
promiseTestAsyncThenableResolution,
|
||||
promiseWrapperAsyncResolution,
|
||||
];
|
||||
|
||||
function runTest() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче