diff options
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.rs b/src/util.rs index cd0f32e..690a9e1 100644 --- a/src/util.rs +++ b/src/util.rs @@ -460,6 +460,11 @@ unsafe fn init_userdata_metatable_index(state: *mut ffi::lua_State) -> Result<() ffi::lua_pushcfunction(state, lua_isfunction_impl); ffi::lua_call(state, 2, 1); + #[cfg(feature = "luau-jit")] + if ffi::luau_codegen_supported() != 0 { + ffi::luau_codegen_compile(state, -1); + } + // Store in the registry ffi::lua_pushvalue(state, -1); ffi::lua_rawsetp(state, ffi::LUA_REGISTRYINDEX, index_key); @@ -508,6 +513,11 @@ pub unsafe fn init_userdata_metatable_newindex(state: *mut ffi::lua_State) -> Re ffi::lua_pushcfunction(state, lua_isfunction_impl); ffi::lua_call(state, 2, 1); + #[cfg(feature = "luau-jit")] + if ffi::luau_codegen_supported() != 0 { + ffi::luau_codegen_compile(state, -1); + } + // Store in the registry ffi::lua_pushvalue(state, -1); ffi::lua_rawsetp(state, ffi::LUA_REGISTRYINDEX, newindex_key); |