diff --git a/.changeset/wise-radios-exercise.md b/.changeset/wise-radios-exercise.md new file mode 100644 index 0000000000..1d13af7758 --- /dev/null +++ b/.changeset/wise-radios-exercise.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: improve unstate handling of non enumerable properties diff --git a/packages/svelte/src/internal/client/proxy.js b/packages/svelte/src/internal/client/proxy.js index 23440a56e4..8add490a10 100644 --- a/packages/svelte/src/internal/client/proxy.js +++ b/packages/svelte/src/internal/client/proxy.js @@ -84,10 +84,11 @@ function unwrap(value, already_unwrapped = new Map()) { } else { /** @type {Record} */ const obj = {}; - const keys = object_keys(value); + const keys = Reflect.ownKeys(value); const descriptors = get_descriptors(value); already_unwrapped.set(value, obj); for (const key of keys) { + if (key === STATE_SYMBOL || (DEV && key === READONLY_SYMBOL)) continue; if (descriptors[key].get) { define_property(obj, key, descriptors[key]); } else {