Ensure toString coerces nullish values in arrays to strings.

This commit is contained in:
John-David Dalton
2017-02-25 20:22:25 -08:00
parent 3e80dffd48
commit 2fd70c8eca

View File

@@ -37,7 +37,7 @@ function toString(value) {
}
if (Array.isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return `${ arrayMap(value, toString) }`
return `${ arrayMap(value, (other) => other == null ? other : toString(other)) }`
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : ''