Fix executor arguments validation in Promise subclass test

This commit is contained in:
André Bargull 2017-02-10 17:12:08 +01:00
parent 8a4abc2a00
commit 7e94b8b7ac
1 changed files with 6 additions and 4 deletions

View File

@ -23,12 +23,14 @@ assert.throws(TypeError, function() {
});
var calledExecutor = false;
var executorArguments;
var prom1 = new Prom(function(resolve) {
var prom1 = new Prom(function() {
calledExecutor = true;
assert.sameValue(arguments.length, 2);
assert(arguments[0] === Promise.resolve);
assert(arguments[1] === Promise.reject);
executorArguments = arguments;
});
assert(calledExecutor);
assert.sameValue(executorArguments.length, 2);
assert.sameValue(typeof executorArguments[0], "function");
assert.sameValue(typeof executorArguments[1], "function");