Skip to content

Commit 0b7d37c

Browse files
committed
feedback
1 parent 955c959 commit 0b7d37c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/svelte/src/internal/client/render.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ export function set_should_intro(value) {
4949
*/
5050
export function set_text(text, value) {
5151
// For objects, we apply string coercion before diffing
52-
if (typeof value === 'object' && value !== null) {
53-
value = value + '';
54-
}
52+
var str = value == null ? '' : typeof value === 'object' ? value + '' : value;
5553
// @ts-expect-error
56-
if (value !== (text.__t ??= text.nodeValue)) {
54+
if (str !== (text.__t ??= text.nodeValue)) {
5755
// @ts-expect-error
58-
text.__t = value;
59-
text.nodeValue = value == null ? '' : value + '';
56+
text.__t = str;
57+
text.nodeValue = str == null ? '' : str + '';
6058
}
6159
}
6260

0 commit comments

Comments
 (0)