Skip to main content

luaur_analysis/methods/
frontend_get_environment_scope.rs

1use crate::records::frontend::Frontend;
2use crate::type_aliases::scope_ptr_type::ScopePtr;
3use alloc::string::String;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5
6impl Frontend {
7    pub fn get_environment_scope(&self, environment_name: String) -> ScopePtr {
8        if let Some(scope) = self.environments.get(&environment_name) {
9            return scope.clone();
10        }
11
12        LUAU_ASSERT!(false);
13        unsafe { core::mem::zeroed() }
14    }
15}