We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f6adbe commit f31ba3aCopy full SHA for f31ba3a
docs/usage/cclass.c
@@ -36,10 +36,7 @@ int main(void) {
36
37
// leaves a copy of the class on the stack which can be modified and/or
38
// loaded as a package
39
- lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
40
- lua_insert(L, -2);
41
- lua_setfield(L, -2, "MyClass");
42
- lua_pop(L, 1);
+ luaC_setpackageloaded(L, "MyClass");
43
44
lua_pushnumber(L, 12);
45
luaC_construct(L, 1, "MyClass");
0 commit comments