[Development] JavaScript Promise implementation, Promise.all capability-executor-not-callable test case

Valery Kotov kotov.valery at gmail.com
Thu Feb 8 10:39:45 CET 2018

Dear all,

I'm working on JS Promise implementation:

I also would like the implementation to pass official ECMAScript test suite
<https://github.com/tc39/test262>. Though I faced some difficulty to
understand certain test cases.

E.g. notion of "IsCallable" seems to be a bit unclear to me.

It is stated here:
"8. If IsCallable(promiseCapability.[[Resolve]]) is false, throw a
TypeError exception."
"9. If IsCallable(promiseCapability.[[Reject]]) is false, throw a TypeError

Presumably the statement is supposed to be proved by test cases in the
file. E.g.
var checkPoint = "";
assert.throws(TypeError, function() {
  Promise.all.call(function(executor) {
    checkPoint += "a";
    executor(undefined, undefined);
    checkPoint += "b";
  }, []);
}, "executor called with (undefined, undefined)");
assert.sameValue(checkPoint, "ab", "executor called with (undefined,

The conclusion I could make looking at this, both check points should pass
and no exception should be raised during "executor(undefined, undefined)"
But does that mean "IsCallable(undefined) === true"?

Which is a bit confusing, sine one could get completely opposite conclusion
for example from the test here
To be honest, ECMAScript spec does not seem to be very helpful as well
since notion of callable object is a bit vague:
Also, unfortunately, I could not find clear answer in official tests for

It feels a bit like a contradiction. Thus, I'm a bit puzzled how to go
about it. Am I missing something?
I would appreciate some help or hints!

Sincerely yours,
Valery Kotov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20180208/6aa628e4/attachment.html>

More information about the Development mailing list