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