Skip to content

Commit

Permalink
Fix bug in IfIline opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
chancancode committed Dec 13, 2023
1 parent 28b2e2e commit 57d1d3d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,13 @@ APPEND_OPCODES.add(Op.IfInline, (vm) => {
let truthy = check(vm.stack.pop(), CheckReactive);
let falsy = check(vm.stack.pop(), CheckReactive);

return ResultFormula(() => {
return chainResult(readReactive(condition), (condition) => {
return toBool(condition) ? readReactive(truthy) : readReactive(falsy);
});
});
vm.stack.push(
ResultFormula(() => {
return chainResult(readReactive(condition), (condition) => {
return toBool(condition) ? readReactive(truthy) : readReactive(falsy);
});
})
);
});

APPEND_OPCODES.add(Op.Not, (vm) => {
Expand Down

0 comments on commit 57d1d3d

Please sign in to comment.