Dear all,

I'm working on JS Promise implementation:

I also would like the implementation to pass official ECMAScript test suite
<>. 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() { {
    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
Development mailing list

Reply via email to