aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/internals/get-built-in.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/internals/get-built-in.js')
-rw-r--r--node_modules/core-js/internals/get-built-in.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/node_modules/core-js/internals/get-built-in.js b/node_modules/core-js/internals/get-built-in.js
new file mode 100644
index 0000000..8fcff26
--- /dev/null
+++ b/node_modules/core-js/internals/get-built-in.js
@@ -0,0 +1,11 @@
+var path = require('../internals/path');
+var global = require('../internals/global');
+
+var aFunction = function (variable) {
+ return typeof variable == 'function' ? variable : undefined;
+};
+
+module.exports = function (namespace, method) {
+ return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
+ : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
+};