fn error(&mut self, env: &Environment, kind: ErrorKind) -> Error {
      self.halted = true;
      Error::Runtime {
         kind,
         call_stack: self
            .call_stack
            .iter()
            .map(|return_point| StackTraceEntry {
               function_name: if let Some(closure) = &return_point.closure {
                  let closure = unsafe { closure.get() };
                  let function = unsafe { env.get_function_unchecked(closure.function_id) };
                  Rc::clone(&function.name)
               } else {
                  Rc::from("<main>")
               },
               module_name: if let Some(chunk) = &return_point.chunk {
                  Rc::clone(&chunk.module_name)
               } else {
                  Rc::from("<FFI>")
               },
               location: if let Some(chunk) = &return_point.chunk {
                  chunk.location(return_point.pc - Opcode::INSTRUCTION_SIZE)
               } else {
                  Location::UNINIT
               },
            })
            .collect(),
      }
   }
/// Halts the VM and produces an error.
Halts the VM and produces an error.
Halts the VM and produces an error .
fn error(&mut self, env: &Environment, kind: ErrorKind) -> Error {
      self.halted = true;
      Error::Runtime {
         kind,
         call_stack: self
            .call_stack
            .iter()
            .map(|return_point| StackTraceEntry {
               function_name: if let Some(closure) = &return_point.closure {
                  let closure = unsafe { closure.get() };
                  let function = unsafe { env.get_function_unchecked(closure.function_id) };
                  Rc::clone(&function.name)
               } else {
                  Rc::from("<main>")
               },
               module_name: if let Some(chunk) = &return_point.chunk {
                  Rc::clone(&chunk.module_name)
               } else {
                  Rc::from("<FFI>")
               },
               location: if let Some(chunk) = &return_point.chunk {
                  chunk.location(return_point.pc - Opcode::INSTRUCTION_SIZE)
               } else {
                  Location::UNINIT
               },
            })
            .collect(),
      }
   }
fn error ( & mut self , env : & Environment , kind : ErrorKind ) -> Error { self . halted = true ; Error :: Runtime { kind , call_stack : self . call_stack . iter ( ) . map ( | return_point | StackTraceEntry { function_name : if let Some ( closure ) = & return_point . closure { let closure = unsafe { closure . get ( ) } ; let function = unsafe { env . get_function_unchecked ( closure . function_id ) } ; Rc :: clone ( & function . name ) } else { Rc :: from ( " " ) } , module_name : if let Some ( chunk ) = & return_point . chunk { Rc :: clone ( & chunk . module_name ) } else { Rc :: from ( " " ) } , location : if let Some ( chunk ) = & return_point . chunk { chunk . location ( return_point . pc - Opcode :: INSTRUCTION_SIZE ) } else { Location :: UNINIT } , } ) . collect ( ) , } }
Halts the VM and produces an error.
Halts the VM and produces an error .
&mut self
env
&Environment
kind
ErrorKind