pub fn inner(&self, vm: &VM) -> Value {
        if let Some(val) = &self.closed {
            return val.clone();
        } else if let Some(index) = &self.location {
            let val = match index {
                UpValueLocation::StackIndex(idx) => vm.stack.get(*idx).clone(),
                UpValueLocation::UpValueIndex(idx) => {
                    let prev_frame = &vm.frames[vm.frame_count - 1].closure;

                    println!("[vm] previous frame name: {}", prev_frame.function.name);

                    let upval = &vm.frames[vm.frame_count - 1].closure.non_locals.borrow()[*idx];

                    let val = upval.inner(vm);
                    val
                }
            };

            val
        } else {
            unreachable!("Can't get inner value: Upvalue doesn't have a location or a value");
        }
    }
/// Get this upvalue's inner value.
Get this upvalue's inner value.
Get this upvalue ' s inner value .
pub fn inner(&self, vm: &VM) -> Value {
        if let Some(val) = &self.closed {
            return val.clone();
        } else if let Some(index) = &self.location {
            let val = match index {
                UpValueLocation::StackIndex(idx) => vm.stack.get(*idx).clone(),
                UpValueLocation::UpValueIndex(idx) => {
                    let prev_frame = &vm.frames[vm.frame_count - 1].closure;
                    println!("[vm] previous frame name: {}", prev_frame.function.name);
                    let upval = &vm.frames[vm.frame_count - 1].closure.non_locals.borrow()[*idx];
                    let val = upval.inner(vm);
                    val
                }
            };
            val
        } else {
            unreachable!("Can't get inner value: Upvalue doesn't have a location or a value");
        }
    }
pub fn inner ( & self , vm : & VM ) -> Value { if let Some ( val ) = & self . closed { return val . clone ( ) ; } else if let Some ( index ) = & self . location { let val = match index { UpValueLocation :: StackIndex ( idx ) => vm . stack . get ( * idx ) . clone ( ) , UpValueLocation :: UpValueIndex ( idx ) => { let prev_frame = & vm . frames [ vm . frame_count - 1 ] . closure ; println ! ( " " prev_frame function name ) ; let upval = & vm . frames [ vm . frame_count - 1 ] . closure . non_locals . borrow ( ) [ * idx ] ; let val = upval . inner ( vm ) ; val } } ; val } else { unreachable ! ( " " ) ; } }
Get this upvalue's inner value.
Get this upvalue ' s inner value .
&self
vm
&VM