Skip to content

Commit

Permalink
Proxy: Ignore setting a reference to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
smirea committed Oct 21, 2020
1 parent 9007be0 commit 6991d82
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export const objectTraps: ProxyHandler<ProxyState> = {
prepareCopy(state)
markChanged(state)
}

if (state.copy_![prop] === value && typeof value !== "number") return true

// @ts-ignore
state.copy_![prop] = value
state.assigned_[prop] = true
Expand Down

0 comments on commit 6991d82

Please sign in to comment.