2 var aCallable = require('../internals/a-callable');
4 var PromiseCapability = function (C) {
6 this.promise = new C(function ($$resolve, $$reject) {
7 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
11 this.resolve = aCallable(resolve);
12 this.reject = aCallable(reject);
15 // `NewPromiseCapability` abstract operation
16 // https://tc39.es/ecma262/#sec-newpromisecapability
17 module.exports.f = function (C) {
18 return new PromiseCapability(C);