source: imaps-frontend/node_modules/core-js/internals/new-promise-capability.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 618 bytes
RevLine 
[79a0317]1'use strict';
2var aCallable = require('../internals/a-callable');
3
4var $TypeError = TypeError;
5
6var PromiseCapability = function (C) {
7 var resolve, reject;
8 this.promise = new C(function ($$resolve, $$reject) {
9 if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
10 resolve = $$resolve;
11 reject = $$reject;
12 });
13 this.resolve = aCallable(resolve);
14 this.reject = aCallable(reject);
15};
16
17// `NewPromiseCapability` abstract operation
18// https://tc39.es/ecma262/#sec-newpromisecapability
19module.exports.f = function (C) {
20 return new PromiseCapability(C);
21};
Note: See TracBrowser for help on using the repository browser.