]> git.r.bdr.sh - rbdr/dotfiles/blob
7309590cba56890d0868f3195f7e63f77c3725fd
[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 iterator;
8 a.throws(function () { t(); }, TypeError, "Null");
9 a.throws(function () { t({}); }, TypeError, "Plain object");
10 a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
11 iterator = {};
12 iterator[iteratorSymbol] = function () { return new Iterator([]); };
13 a(t(iterator) instanceof Iterator, true, "Iterator");
14 a(String(t([])), '[object Array Iterator]', " Array");
15 a(String(t('foo')), '[object String Iterator]', "String");
16 };