mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 973988 - DOM Promise constructor should call the executor with "undefined" as thisArg. r=bz
This commit is contained in:
parent
b155fee5b9
commit
6062bcb8be
@ -482,8 +482,7 @@ Promise::Constructor(const GlobalObject& aGlobal,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
aInit.Call(promise, resolveFunc, rejectFunc, aRv,
|
||||
CallbackObject::eRethrowExceptions);
|
||||
aInit.Call(resolveFunc, rejectFunc, aRv, CallbackObject::eRethrowExceptions);
|
||||
aRv.WouldReportJSException();
|
||||
|
||||
if (aRv.IsJSException()) {
|
||||
|
@ -573,6 +573,14 @@ function promiseStrictHandlers() {
|
||||
});
|
||||
}
|
||||
|
||||
function promiseStrictExecutorThisArg() {
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
"use strict";
|
||||
ok(this === undefined, "thisArg should be undefined.");
|
||||
runTest();
|
||||
});
|
||||
}
|
||||
|
||||
function promiseResolveArray() {
|
||||
var p = Promise.resolve([1,2,3]);
|
||||
ok(p instanceof Promise, "Should return a Promise.");
|
||||
@ -636,6 +644,7 @@ var tests = [ promiseResolve, promiseReject,
|
||||
promiseThenableRejectThenResolve,
|
||||
promiseWithThenReplaced,
|
||||
promiseStrictHandlers,
|
||||
promiseStrictExecutorThisArg,
|
||||
promiseResolveArray,
|
||||
promiseResolveThenable,
|
||||
promiseResolvePromise,
|
||||
|
Loading…
x
Reference in New Issue
Block a user