mirror of
https://github.com/1disk/edp445.git
synced 2024-08-14 22:47:02 +00:00
15 lines
413 B
JavaScript
15 lines
413 B
JavaScript
'use strict';
|
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
|
|
|
var callBind = require('./');
|
|
|
|
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
|
|
|
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
return callBind(intrinsic);
|
|
}
|
|
return intrinsic;
|
|
};
|