valid-function.js 370 B

1234567891011121314
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var f = function () {};
  4. a(t(f), f, "Function");
  5. // eslint-disable-next-line no-new-func
  6. f = new Function();
  7. a(t(f), f, "Function");
  8. a.throws(function () { t({}); }, "Object");
  9. a.throws(function () { t(/re/); }, "RegExp");
  10. a.throws(function () {
  11. t({ call: function () { return 20; } });
  12. }, "Plain object");
  13. };