From 32348a5387ed8607e4bd688eddd3aa87c17abc21 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Sat, 28 Dec 2024 21:59:21 +0000 Subject: [PATCH] fix: ensure $inspect.trace works correctly with null values (#14853) * fix: ensure $inspect.trace works correctly with null values * fix: ensure $inspect.trace works correctly with null values --- .changeset/rotten-ligers-agree.md | 5 +++++ packages/svelte/src/internal/client/dev/tracing.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/rotten-ligers-agree.md diff --git a/.changeset/rotten-ligers-agree.md b/.changeset/rotten-ligers-agree.md new file mode 100644 index 000000000000..53c62e7602e2 --- /dev/null +++ b/.changeset/rotten-ligers-agree.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: ensure $inspect.trace works correctly with null values diff --git a/packages/svelte/src/internal/client/dev/tracing.js b/packages/svelte/src/internal/client/dev/tracing.js index 1426e9efc9ed..302a8f648024 100644 --- a/packages/svelte/src/internal/client/dev/tracing.js +++ b/packages/svelte/src/internal/client/dev/tracing.js @@ -51,7 +51,9 @@ function log_entry(signal, entry) { status !== 'clean' ? 'color: CornflowerBlue; font-weight: bold' : 'color: grey; font-weight: bold', - typeof value === 'object' && STATE_SYMBOL in value ? snapshot(value, true) : value + typeof value === 'object' && value !== null && STATE_SYMBOL in value + ? snapshot(value, true) + : value ); if (type === '$derived') {