Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/helpers/callBound.js')
-rw-r--r--node_modules/es-abstract/helpers/callBound.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/es-abstract/helpers/callBound.js b/node_modules/es-abstract/helpers/callBound.js
new file mode 100644
index 000000000..9dc8fc518
--- /dev/null
+++ b/node_modules/es-abstract/helpers/callBound.js
@@ -0,0 +1,15 @@
+'use strict';
+
+var GetIntrinsic = require('../GetIntrinsic');
+
+var callBind = require('./callBind');
+
+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.')) {
+ return callBind(intrinsic);
+ }
+ return intrinsic;
+};