]> git.r.bdr.sh - rbdr/dotfiles/blob
7760b017826085fffb7e72d3dcc031acbe643ca0
[rbdr/dotfiles] /
1 'use strict';
2
3 var iteratorSymbol = require('es6-symbol').iterator
4 , Iterator = require('../');
5
6 module.exports = function (t, a) {
7 var obj;
8 a.throws(function () { t(); }, TypeError, "Undefined");
9 a.throws(function () { t({}); }, TypeError, "Plain object");
10 a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
11 obj = {};
12 obj[iteratorSymbol] = function () { return new Iterator([]); };
13 a(t(obj), obj, "Iterator");
14 obj = [];
15 a(t(obj), obj, 'Array');
16 };