项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

31 lines
579 B

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