valid-function.js 335 B

1234567891011121314151617
  1. 'use strict';
  2. module.exports = function (t, a) {
  3. var f = function () {};
  4. a(t(f), f, "Function");
  5. f = new Function();
  6. a(t(f), f, "Function");
  7. a.throws(function () {
  8. t({});
  9. }, "Object");
  10. a.throws(function () {
  11. t(/re/);
  12. }, "RegExp");
  13. a.throws(function () {
  14. t({ call: function () { return 20; } });
  15. }, "Plain object");
  16. };