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.

15 lines
418 B

4 years ago
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var callBind = require('./callBind');
  4. var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
  5. module.exports = function callBoundIntrinsic(name, allowMissing) {
  6. var intrinsic = GetIntrinsic(name, !!allowMissing);
  7. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
  8. return callBind(intrinsic);
  9. }
  10. return intrinsic;
  11. };