2 var aFunction = require('../internals/a-function');
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 = aFunction(resolve);
12 this.reject = aFunction(reject);
15 // 25.4.1.5 NewPromiseCapability(C)
16 module.exports.f = function (C) {
17 return new PromiseCapability(C);