valid-array.js 587 B

1234567891011121314151617181920
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var x;
  4. a.throws(function () { t(); }, TypeError, "Undefined");
  5. a.throws(function () { t(null); }, TypeError, "Null");
  6. a.throws(function () { t(0); }, TypeError, "Number");
  7. a.throws(function () { t(true); }, TypeError, "Boolean");
  8. a.throws(function () { t("raz"); }, TypeError, "String");
  9. a.throws(
  10. function () {
  11. t(function () {});
  12. },
  13. TypeError,
  14. "Function"
  15. );
  16. a.throws(function () { t({}); }, TypeError, "Object");
  17. a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
  18. a(t((x = [])), x, "Array");
  19. };