You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
522 B
17 lines
522 B
![]()
1 week ago
|
'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
|
||
|
};
|
||
|
}
|
||
|
});
|