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/test/helpers/createBoundESNamespace.js')
-rw-r--r--node_modules/es-abstract/test/helpers/createBoundESNamespace.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/es-abstract/test/helpers/createBoundESNamespace.js b/node_modules/es-abstract/test/helpers/createBoundESNamespace.js
new file mode 100644
index 000000000..880ba3d51
--- /dev/null
+++ b/node_modules/es-abstract/test/helpers/createBoundESNamespace.js
@@ -0,0 +1,21 @@
+'use strict';
+
+var bind = require('function-bind');
+
+var OwnPropertyKeys = require('../../helpers/OwnPropertyKeys');
+
+module.exports = function createBoundESNamespace(ES) {
+ var keys = OwnPropertyKeys(ES);
+ var result = {};
+
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ var prop = ES[key];
+ if (typeof prop === 'function') {
+ prop = bind.call(prop, undefined);
+ }
+ result[key] = prop;
+ }
+
+ return result;
+};