main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
413 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var callBind = require('./');
|
---|
| 6 |
|
---|
| 7 | var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
---|
| 8 |
|
---|
| 9 | module.exports = function callBoundIntrinsic(name, allowMissing) {
|
---|
| 10 | var intrinsic = GetIntrinsic(name, !!allowMissing);
|
---|
| 11 | if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
---|
| 12 | return callBind(intrinsic);
|
---|
| 13 | }
|
---|
| 14 | return intrinsic;
|
---|
| 15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.