Skip to content

Commit 78e7963

Browse files
committed
tidy up
1 parent 9eb17cf commit 78e7963

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ export function proxy(value, immutable = true, owners) {
7575
});
7676

7777
if (DEV) {
78+
// set ownership — either of the parent proxy's owners (if provided) or,
79+
// when calling `$.proxy(...)`, to the current component if such there be
7880
// @ts-expect-error
7981
value[STATE_SYMBOL].o =
8082
owners === undefined
@@ -260,9 +262,7 @@ const state_proxy_handler = {
260262
set(target, prop, value) {
261263
const metadata = target[STATE_SYMBOL];
262264
const s = metadata.s.get(prop);
263-
if (s !== undefined) {
264-
set(s, proxy(value, metadata.i, metadata.o));
265-
}
265+
if (s !== undefined) set(s, proxy(value, metadata.i, metadata.o));
266266
const is_array = metadata.a;
267267
const not_has = !(prop in target);
268268

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -934,15 +934,11 @@ export function unsubscribe_on_destroy(stores) {
934934
* @returns {V}
935935
*/
936936
export function get(signal) {
937-
if (DEV) {
938-
const debuggable = /** @type {import('./types.js').SignalDebug} */ (signal);
939-
937+
// @ts-expect-error
938+
if (DEV && signal.inspect && inspect_fn) {
939+
/** @type {import('./types.js').SignalDebug} */ (signal).inspect.add(inspect_fn);
940940
// @ts-expect-error
941-
if (signal.inspect && inspect_fn) {
942-
debuggable.inspect.add(inspect_fn);
943-
// @ts-expect-error
944-
inspect_captured_signals.push(signal);
945-
}
941+
inspect_captured_signals.push(signal);
946942
}
947943

948944
const flags = signal.f;
@@ -1996,7 +1992,7 @@ export function init() {
19961992
* @param {Set<any>} visited
19971993
* @returns {void}
19981994
*/
1999-
export function deep_read(value, visited = new Set()) {
1995+
function deep_read(value, visited = new Set()) {
20001996
if (typeof value === 'object' && value !== null && !visited.has(value)) {
20011997
visited.add(value);
20021998
for (let key in value) {

0 commit comments

Comments
 (0)