Skip to main content

luaur_bytecode/methods/
bc_function_vm_const.rs

1use crate::enums::bc_op_kind::BcOpKind;
2use crate::records::bc_function::{BcFunction, VmConst};
3use crate::records::bc_op::BcOp;
4use crate::records::bc_ref::BcRef;
5use luaur_common::macros::luau_assert::LUAU_ASSERT;
6
7impl BcFunction {
8    pub fn vm_const<'a>(&'a self, op: BcOp) -> BcRef<'a, VmConst> {
9        LUAU_ASSERT!(op.kind == BcOpKind::VmConst);
10        BcRef {
11            vec: &self.constants,
12            op,
13        }
14    }
15}