Skip to content

Commit bf0a934

Browse files
committed
tweaks
1 parent b895533 commit bf0a934

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { array_from, is_array } from '../../../shared/utils.js';
3636
import { INERT } from '../../constants.js';
3737
import { queue_micro_task } from '../task.js';
3838
import { active_effect, active_reaction } from '../../runtime.js';
39-
import { legacy_mode_flag } from '../../../flags/index.js';
4039

4140
/**
4241
* The row of a keyed each block that is currently updating. We track this
@@ -494,7 +493,7 @@ function create_item(anchor, state, prev, next, value, key, index, render_fn, fl
494493
var reactive = (flags & EACH_ITEM_REACTIVE) !== 0;
495494
var mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;
496495

497-
var v = reactive ? (legacy_mode_flag && mutable ? mutable_source(value) : source(value)) : value;
496+
var v = reactive ? (mutable ? mutable_source(value) : source(value)) : value;
498497
var i = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);
499498

500499
/** @type {EachItem} */

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
BLOCK_EFFECT
3333
} from '../constants.js';
3434
import * as e from '../errors.js';
35+
import { legacy_mode_flag } from '../../flags/index.js';
3536

3637
export let inspect_effects = new Set();
3738

@@ -80,7 +81,7 @@ export function mutable_source(initial_value, immutable = false) {
8081

8182
// bind the signal to the component context, in case we need to
8283
// track updates to trigger beforeUpdate/afterUpdate callbacks
83-
if (component_context !== null && component_context.l !== null) {
84+
if (legacy_mode_flag && component_context !== null && component_context.l !== null) {
8485
(component_context.l.s ??= []).push(s);
8586
}
8687

0 commit comments

Comments
 (0)