try.js 449 B

12345678910111213
  1. 'use strict';
  2. require('../../modules/es.promise');
  3. require('../../modules/esnext.promise.try');
  4. var call = require('../../internals/function-call');
  5. var isCallable = require('../../internals/is-callable');
  6. var path = require('../../internals/path');
  7. var Promise = path.Promise;
  8. var promiseTry = Promise['try'];
  9. module.exports = { 'try': function (callbackfn) {
  10. return call(promiseTry, isCallable(this) ? this : Promise, callbackfn);
  11. } }['try'];