Skip to content

Commit

Permalink
tweak comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Sep 10, 2024
1 parent fc00683 commit 3ee8fe1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/svelte/src/internal/client/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ export function proxy(value, parent = null, prev) {

// In case of something like `foo = bar.map(...)`, foo would have ownership
// of the array itself, while the individual items would have ownership
// of the component that created the proxy. That means if we later do
// `foo[0].baz = 42`, we could get a false-positive ownership violation,
// since the two proxies are not connected to each other via the parent
// relationship. For this reason, we need to widen the ownership of the
// children upon access when we detect they are not connected.
// of the component that created bar. That means if we later do `foo[0].baz = 42`,
// we could get a false-positive ownership violation, since the two proxies
// are not connected to each other via the parent metadata relationship.
// For this reason, we need to widen the ownership of the children
// upon access when we detect they are not connected.
if (DEV) {
/** @type {ProxyMetadata | undefined} */
var prop_metadata = v?.[STATE_SYMBOL_METADATA];
Expand Down

0 comments on commit 3ee8fe1

Please sign in to comment.