pull/16060/head
ComputerGuy 4 months ago
parent e62c167748
commit 2f189ecd7e

@ -19,12 +19,14 @@ import { tracing_mode_flag } from '../flags/index.js';
* @template T * @template T
* @param {T} value * @param {T} value
* @param {string} [path] * @param {string} [path]
* @param {boolean} [rename_path]
* @returns {T} * @returns {T}
*/ */
export function proxy(value, path) { export function proxy(value, path, rename_path = true) {
// if `DEV`, change the proxy `path` since we don't know if its still "owned" by its original source // if `DEV`, change the proxy `path` since we don't know if its still "owned" by its original source
if ( if (
DEV && DEV &&
rename_path &&
typeof value === 'object' && typeof value === 'object' &&
value !== null && value !== null &&
STATE_SYMBOL in value && STATE_SYMBOL in value &&
@ -255,7 +257,7 @@ export function proxy(value, path) {
s = DEV ? tag_source(s, to_trace_name(prop)) : s; s = DEV ? tag_source(s, to_trace_name(prop)) : s;
set( set(
s, s,
with_parent(() => proxy(value, to_trace_name(prop))) with_parent(() => proxy(value, to_trace_name(prop), false))
); );
sources.set(prop, s); sources.set(prop, s);
} }
@ -263,7 +265,7 @@ export function proxy(value, path) {
has = s.v !== UNINITIALIZED; has = s.v !== UNINITIALIZED;
set( set(
s, s,
with_parent(() => proxy(value, to_trace_name(prop))) with_parent(() => proxy(value, to_trace_name(prop), false))
); );
} }

Loading…
Cancel
Save