From 44d4a28428884e6885da4e7959297ef4871912f3 Mon Sep 17 00:00:00 2001 From: daishi Date: Wed, 30 Oct 2024 22:35:08 +0800 Subject: [PATCH] Revert "fix(vanilla): createSnapshot (#970)" This reverts commit 487ded5b68f168b98e9428ff35d5d3cb6e4ed399. --- src/vanilla.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vanilla.ts b/src/vanilla.ts index 32430930..ab471238 100644 --- a/src/vanilla.ts +++ b/src/vanilla.ts @@ -92,8 +92,10 @@ const createSnapshotDefault = ( if (refSet.has(value as object)) { markToTrack(value as object, false) // mark not to track } else if (proxyStateMap.has(value as object)) { - const [target] = proxyStateMap.get(value as object) as ProxyState - desc.value = createSnapshotDefault(target, version) as Snapshot + const [target, ensureVersion] = proxyStateMap.get( + value as object, + ) as ProxyState + desc.value = createSnapshotDefault(target, ensureVersion()) as Snapshot } Object.defineProperty(snap, key, desc) })