fix: improve error message readbility

This commit is contained in:
Mariusz Nowak
2018-06-01 14:23:50 +02:00
parent 926f7f0ffe
commit e67ce15c53
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -7,6 +7,6 @@ module.exports = function (value) {
if (value && isCallable(value.toString)) return value.toString(); if (value && isCallable(value.toString)) return value.toString();
return String(value); return String(value);
} catch (e) { } catch (e) {
return "<Non-coercible (to string) value>"; return "<Non-coercible to string value>";
} }
}; };
+1 -1
View File
@@ -8,5 +8,5 @@ module.exports = function (t, a) {
a(t({ toString: function () { return "miszka"; } }), "miszka"); a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description // eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
a(t(Object.create(null)), "<Non-coercible (to string) value>"); a(t(Object.create(null)), "<Non-coercible to string value>");
}; };
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = function (t, a) {
a(t({ toString: function () { return "miszka"; } }), "miszka"); a(t({ toString: function () { return "miszka"; } }), "miszka");
// eslint-disable-next-line symbol-description // eslint-disable-next-line symbol-description
if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
a(t(Object.create(null)), "<Non-coercible (to string) value>"); a(t(Object.create(null)), "<Non-coercible to string value>");
a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…"); a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…");
a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar"); a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar");
}; };