Kargi-Sitesi/node_modules/core-js/modules/es.promise.with-resolvers.js

17 lines
522 B
JavaScript
Raw Normal View History

2024-11-04 02:30:09 +00:00
'use strict';
var $ = require('../internals/export');
var newPromiseCapabilityModule = require('../internals/new-promise-capability');
// `Promise.withResolvers` method
// https://tc39.es/ecma262/#sec-promise.withResolvers
$({ target: 'Promise', stat: true }, {
withResolvers: function withResolvers() {
var promiseCapability = newPromiseCapabilityModule.f(this);
return {
promise: promiseCapability.promise,
resolve: promiseCapability.resolve,
reject: promiseCapability.reject
};
}
});