luaur-compiler 0.1.3

Luau source-to-bytecode compiler (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::records::builtin::Builtin;

impl Builtin {
    pub fn is_method(&self, table: &str, name: &str) -> bool {
        unsafe {
            if self.object.value.is_null() || self.method.value.is_null() {
                return false;
            }
            let obj_bytes = core::ffi::CStr::from_ptr(self.object.value).to_bytes();
            let method_bytes = core::ffi::CStr::from_ptr(self.method.value).to_bytes();
            obj_bytes == table.as_bytes() && method_bytes == name.as_bytes()
        }
    }
}