summaryrefslogtreecommitdiff
path: root/plugins/MirLua/Modules/m_enumerable/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/Modules/m_enumerable/src/main.cpp')
-rw-r--r--plugins/MirLua/Modules/m_enumerable/src/main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/MirLua/Modules/m_enumerable/src/main.cpp b/plugins/MirLua/Modules/m_enumerable/src/main.cpp
index b905b18b62..8494c1385a 100644
--- a/plugins/MirLua/Modules/m_enumerable/src/main.cpp
+++ b/plugins/MirLua/Modules/m_enumerable/src/main.cpp
@@ -429,9 +429,6 @@ extern "C" LUAMOD_API int luaopen_m_enumerable(lua_State *L)
{
luaL_newlib(L, methods);
- lua_pushcfunction(L, lua__new);
- lua_setglobal(L, MT_ENUMERABLE);
-
luaL_newmetatable(L, MT_ENUMERABLE);
luaL_setfuncs(L, enumerableMeta, 0);
lua_pushvalue(L, -1);
@@ -439,5 +436,12 @@ extern "C" LUAMOD_API int luaopen_m_enumerable(lua_State *L)
luaL_setfuncs(L, enumerableApi, 0);
lua_pop(L, 1);
+ lua_createtable(L, 0, 1);
+ lua_pushcfunction(L, lua__new);
+ lua_setfield(L, -2, "new");
+ lua_pushvalue(L, -1);
+ lua_setglobal(L, MT_ENUMERABLE);
+ lua_pop(L, 1);
+
return 1;
}