runtime, macros: unify NaN-boxed value API under ValueVariant trait

This commit is contained in:
2026-07-14 23:14:18 +08:00
parent 7220b42024
commit abf7dc0855
28 changed files with 475 additions and 362 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ pub(crate) fn op_jump_if_false<'gc, M: Machine<'gc>>(
) -> Step {
let offset = reader.read_i32();
let cond = m.force_and_retry::<StrictValue>(reader, mc)?;
if cond.as_inline::<bool>() == Some(false) {
if cond.downcast::<bool>() == Some(false) {
reader.set_pc(((reader.pc() as isize) + (offset as isize)) as usize);
}
Step::Continue(())
@@ -26,7 +26,7 @@ pub(crate) fn op_jump_if_true<'gc, M: Machine<'gc>>(
) -> Step {
let offset = reader.read_i32();
let cond = m.force_and_retry::<StrictValue>(reader, mc)?;
if cond.as_inline::<bool>() == Some(true) {
if cond.downcast::<bool>() == Some(true) {
reader.set_pc(((reader.pc() as isize) + (offset as isize)) as usize);
}
Step::Continue(())