luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
use crate::records::thread_context::ThreadContext;

#[allow(non_camel_case_types)]
#[derive(Debug)]
pub struct Scope {
    pub(crate) context: *mut ThreadContext,
}

impl Drop for Scope {
    fn drop(&mut self) {
        #[cfg(feature = "luau_enable_time_trace")]
        {
            if crate::FFlag::DebugLuauTimeTracing.get() {
                unsafe {
                    (*self.context).event_leave();
                }
            }
        }
    }
}