| 6878 | } |
| 6879 | |
| 6880 | append(value) { |
| 6881 | // This check protects us from the rare case where an object has overriden |
| 6882 | // `toString()` with an invalid implementation (returning a non-string). |
| 6883 | if (typeof value !== "string") { |
| 6884 | value = Object.prototype.toString.call(value) |
| 6885 | } |
| 6886 | |
| 6887 | const result = truncate(value, j$.MAX_PRETTY_PRINT_CHARS - this.length) |
| 6888 | this.length += result.value.length |
| 6889 | this.stringParts.push(result.value) |
| 6890 | |
| 6891 | if (result.truncated) { |
| 6892 | throw new MaxCharsReachedError() |
| 6893 | } |
| 6894 | } |
| 6895 | } |
| 6896 | |
| 6897 | function hasCustomToString(value) { |