Skip to content

Commit d630bc8

Browse files
authored
fix(runtime): pass blocks array to destroy_block in reconcile_by_key Map path (#788)
In reconcile_by_key's Map-based path, the fast_path_removal cleanup loop called destroy_block(a[a_start++]) where `a` is state.array (values). It should use a_blocks[a_start++] since destroy_block expects a Block object. Passing a plain value causes a TypeError when destroy_block accesses block properties (.fn, .p, .f, etc.).
1 parent 43aaafa commit d630bc8

File tree

1 file changed

+1
-1
lines changed
  • packages/ripple/src/runtime/internal/client

1 file changed

+1
-1
lines changed

packages/ripple/src/runtime/internal/client/for.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function reconcile_by_key(anchor, block, b, render_fn, is_controlled, is_indexed
436436
if (fast_path_removal) {
437437
fast_path_removal = false;
438438
while (i > a_start) {
439-
destroy_block(a[a_start++]);
439+
destroy_block(a_blocks[a_start++]);
440440
}
441441
}
442442
sources[j - b_start] = i + 1;

0 commit comments

Comments
 (0)