Skip to main content

luaur_analysis/methods/
mapped_generic_environment_pop_frame.rs

1use crate::records::mapped_generic_environment::MappedGenericEnvironment;
2use luaur_common::macros::luau_assert::LUAU_ASSERT;
3
4impl MappedGenericEnvironment {
5    pub fn pop_frame(&mut self) {
6        LUAU_ASSERT!(self.current_scope_index.is_some());
7        if let Some(current_scope_index) = self.current_scope_index {
8            let new_frame_index = self.frames[current_scope_index].parent_scope_index;
9            self.current_scope_index = new_frame_index.unwrap_or(0 as usize).into();
10        }
11    }
12}