diff --git a/packages/svelte/src/internal/client/reactivity/computations.js b/packages/svelte/src/internal/client/reactivity/computations.js index fabd86a09d..7897f39590 100644 --- a/packages/svelte/src/internal/client/reactivity/computations.js +++ b/packages/svelte/src/internal/client/reactivity/computations.js @@ -24,66 +24,30 @@ import { default_equals, safe_equal } from './equality.js'; * @param {import('../types.js').SignalFlags} flags * @param {V} value * @param {import('../types.js').Block | null} block - * @returns {import('../types.js').ComputationSignal | import('../types.js').ComputationSignal & import('../types.js').SourceSignalDebug} */ function create_computation_signal(flags, value, block) { - if (DEV) { - return { - // block - b: block, - // consumers - c: null, - // destroy - d: null, - // equals - e: null, - // flags - f: flags, - // init - i: null, - // level - l: 0, - // references - r: null, - // value - v: value, - // write version - w: 0, - // context: We can remove this if we get rid of beforeUpdate/afterUpdate - x: null, - // destroy - y: null, - // this is for DEV only - inspect: new Set() - }; - } - - return { - // block + /** @type {import('../types.js').ComputationSignal} */ + const signal = { b: block, - // consumers c: null, - // destroy d: null, - // equals e: null, - // flags f: flags, - // level l: 0, - // init i: null, - // references r: null, - // value v: value, - // write version w: 0, - // context: We can remove this if we get rid of beforeUpdate/afterUpdate x: null, - // destroy y: null }; + + if (DEV) { + // @ts-expect-error + signal.inspect = new Set(); + } + + return signal; } /**