Skip to content

Commit deef8c5

Browse files
committed
more
1 parent 8c61af6 commit deef8c5

File tree

1 file changed

+3
-18
lines changed
  • packages/svelte/src/internal/client

1 file changed

+3
-18
lines changed

packages/svelte/src/internal/client/proxy.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,6 @@ export function proxy(value, prev) {
4646
var stack = DEV && tracing_mode_flag ? get_stack('CreatedAt') : null;
4747
var reaction = active_reaction;
4848

49-
/**
50-
* @param {any} value
51-
* @param {Error | null | undefined} stack
52-
*/
53-
var child_source = (value, stack) => {
54-
var previous_reaction = active_reaction;
55-
set_active_reaction(reaction);
56-
var s = source(value, stack);
57-
set_active_reaction(previous_reaction);
58-
return s;
59-
};
60-
6149
/**
6250
* @template T
6351
* @param {() => T} fn
@@ -176,10 +164,7 @@ export function proxy(value, prev) {
176164

177165
// create a source, but only if it's an own property and not a prototype property
178166
if (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {
179-
s = child_source(
180-
with_parent(() => proxy(exists ? target[prop] : UNINITIALIZED)),
181-
stack
182-
);
167+
s = with_parent(() => source(proxy(exists ? target[prop] : UNINITIALIZED), stack));
183168
sources.set(prop, s);
184169
}
185170

@@ -247,7 +232,7 @@ export function proxy(value, prev) {
247232
(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))
248233
) {
249234
if (s === undefined) {
250-
s = child_source(has ? with_parent(() => proxy(target[prop])) : UNINITIALIZED, stack);
235+
s = with_parent(() => source(has ? proxy(target[prop]) : UNINITIALIZED, stack));
251236
sources.set(prop, s);
252237
}
253238

@@ -286,7 +271,7 @@ export function proxy(value, prev) {
286271
// object property before writing to that property.
287272
if (s === undefined) {
288273
if (!has || get_descriptor(target, prop)?.writable) {
289-
s = child_source(undefined, stack);
274+
s = with_parent(() => source(undefined, stack));
290275
set(
291276
s,
292277
with_parent(() => proxy(value))

0 commit comments

Comments
 (0)