2020-08-25 23:57:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
2021-02-26 03:58:33 +00:00
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
|
|
|
var callBind = require('call-bind');
|
2020-08-25 23:57:08 +00:00
|
|
|
|
2021-02-26 03:58:33 +00:00
|
|
|
var $resolve = GetIntrinsic('%Promise.resolve%', true);
|
|
|
|
var $PromiseResolve = $resolve && callBind($resolve);
|
2020-08-25 23:57:08 +00:00
|
|
|
|
2022-11-10 10:43:16 +00:00
|
|
|
// https://262.ecma-international.org/9.0/#sec-promise-resolve
|
2020-08-25 23:57:08 +00:00
|
|
|
|
|
|
|
module.exports = function PromiseResolve(C, x) {
|
|
|
|
if (!$PromiseResolve) {
|
|
|
|
throw new SyntaxError('This environment does not support Promises.');
|
|
|
|
}
|
|
|
|
return $PromiseResolve(C, x);
|
|
|
|
};
|
|
|
|
|