Skip to content

Commit 2e2920d

Browse files
committed
fix(runtime): journal binding.block during scalar-to-block style upgrade
The scalar-to-block upgrade path in nativePresentationBinding assigned binding.block without journaling it. On transition rollback, the JOURNAL_CREATED entry would unmount and dispose the block, but binding.block still pointed at the disposed block, leaving a dangling reference that could cause later renderBlock calls to operate on a disposed block or let the block keep writing styles after rollback. Add journalRootProperty(binding, 'block', binding.block) before the assignment so rollback restores the binding to the scalar path.
1 parent 699ab35 commit 2e2920d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/octane/src/runtime.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ function nativePresentationBinding(
12781278
const block = createBlock('control-flow', owner.block, el, null, null, body, props);
12791279
block.parent = owner;
12801280
if (binding.el === el) block.slots[0] = binding.style;
1281+
journalRootProperty(binding, 'block', binding.block);
12811282
binding.block = block;
12821283
} else {
12831284
const block = binding.block!;

0 commit comments

Comments
 (0)