runtime, macros: unify NaN-boxed value API under ValueVariant trait
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user