validate-stringifiable.js 469 B

123456789101112131415161718
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var x;
  4. a(t(), "undefined", "Undefined");
  5. a(t(null), "null", "Null");
  6. a(t(0), "0");
  7. a(t(false), "false");
  8. a(t(""), "");
  9. a(t({}), String({}), "Object");
  10. a(t(x = function () {}), String(x), "Function");
  11. a(t(x = new String("raz")), String(x), "String object"); // Jslint: ignore
  12. a(t(x = new Date()), String(x), "Date");
  13. a.throws(function () {
  14. t(Object.create(null));
  15. }, TypeError, "Null prototype object");
  16. };