PromiseResolve.js 457 B

1234567891011121314151617
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var callBind = require('call-bind');
  4. var $resolve = GetIntrinsic('%Promise.resolve%', true);
  5. var $PromiseResolve = $resolve && callBind($resolve);
  6. // https://262.ecma-international.org/9.0/#sec-promise-resolve
  7. module.exports = function PromiseResolve(C, x) {
  8. if (!$PromiseResolve) {
  9. throw new SyntaxError('This environment does not support Promises.');
  10. }
  11. return $PromiseResolve(C, x);
  12. };