summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js')
-rw-r--r--tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js
new file mode 100644
index 0000000000..d277bc97f4
--- /dev/null
+++ b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var Iterator = require('../');
+
+module.exports = function (t, a) {
+ var obj;
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t({}); }, TypeError, "Plain object");
+ a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
+ obj = { '@@iterator': function () { return new Iterator([]); } };
+ a(t(obj), obj, "Iterator");
+ obj = [];
+ a(t(obj), obj, 'Array');
+};