mirror of
https://github.com/hanzoai/es5-ext.git
synced 2026-09-24 16:58:43 +00:00
fix: improve error message readbility
This commit is contained in:
+1
-1
@@ -7,6 +7,6 @@ module.exports = function (value) {
|
||||
if (value && isCallable(value.toString)) return value.toString();
|
||||
return String(value);
|
||||
} catch (e) {
|
||||
return "<Non-coercible (to string) value>";
|
||||
return "<Non-coercible to string value>";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,5 +8,5 @@ module.exports = function (t, a) {
|
||||
a(t({ toString: function () { return "miszka"; } }), "miszka");
|
||||
// eslint-disable-next-line symbol-description
|
||||
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>");
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = function (t, a) {
|
||||
a(t({ toString: function () { return "miszka"; } }), "miszka");
|
||||
// eslint-disable-next-line symbol-description
|
||||
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("mar\ntoo\nfar"), "mar\\ntoo\\nfar");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user