Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
427 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var anObject = require('../internals/an-object');
|
---|
| 2 | var isObject = require('../internals/is-object');
|
---|
| 3 | var newPromiseCapability = require('../internals/new-promise-capability');
|
---|
| 4 |
|
---|
| 5 | module.exports = function (C, x) {
|
---|
| 6 | anObject(C);
|
---|
| 7 | if (isObject(x) && x.constructor === C) return x;
|
---|
| 8 | var promiseCapability = newPromiseCapability.f(C);
|
---|
| 9 | var resolve = promiseCapability.resolve;
|
---|
| 10 | resolve(x);
|
---|
| 11 | return promiseCapability.promise;
|
---|
| 12 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.