]> git.r.bdr.sh - rbdr/dotfiles/blob
bcc2ad3d0aa1c974594d9f55e0e64d65e52f8478
[rbdr/dotfiles] /
1 'use strict';
2
3 var iteratorSymbol = require('es6-symbol').iterator;
4
5 module.exports = function (t, a) {
6 var x;
7 a.throws(function () { t(0); }, TypeError, "0");
8 a.throws(function () { t(false); }, TypeError, "false");
9 a(t(''), '', "''");
10 a.throws(function () { t({}); }, TypeError, "Plain Object");
11 a.throws(function () { t(function () {}); }, TypeError, "Function");
12 a(t(x = new String('raz')), x, "String object"); //jslint: ignore
13
14 a(t(x = { length: 1 }), x, "Array like");
15 a.throws(function () { t(); }, TypeError, "Undefined");
16 a.throws(function () { t(null); }, TypeError, "null");
17 x = {};
18 x[iteratorSymbol] = function () {};
19 a(t(x), x, "Iterable");
20 };