is-error.js 532 B

123456789101112131415
  1. "use strict";
  2. module.exports = function (t, a) {
  3. a(t(), false, "Undefined");
  4. a(t(1), false, "Primitive");
  5. a(t({}), false, "Objectt");
  6. a(t({ toString: function () { return "[object Error]"; } }), false, "Fake error");
  7. a(t(new Error()), true, "Error");
  8. a(t(new EvalError()), true, "EvalError");
  9. a(t(new RangeError()), true, "RangeError");
  10. a(t(new ReferenceError()), true, "ReferenceError");
  11. a(t(new SyntaxError()), true, "SyntaxError");
  12. a(t(new TypeError()), true, "TypeError");
  13. a(t(new URIError()), true, "URIError");
  14. };