1
0

validate-stringifiable.js 467 B

12345678910111213141516
  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 () { t(Object.create(null)); }, TypeError, "Null prototype object");
  14. };