web 3d图形渲染器
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.

12 lines
427 B

  1. var anObject = require('../internals/an-object');
  2. var isObject = require('../internals/is-object');
  3. var newPromiseCapability = require('../internals/new-promise-capability');
  4. module.exports = function (C, x) {
  5. anObject(C);
  6. if (isObject(x) && x.constructor === C) return x;
  7. var promiseCapability = newPromiseCapability.f(C);
  8. var resolve = promiseCapability.resolve;
  9. resolve(x);
  10. return promiseCapability.promise;
  11. };