aboutsummaryrefslogtreecommitdiff
path: root/src/lib_table.c
diff options
context:
space:
mode:
authorMike Pall <mike>2013-11-25 15:17:44 +0100
committerMike Pall <mike>2013-11-25 15:17:44 +0100
commitc378f7dbb882068d1ae06edc8e7049fb1907db2d (patch)
tree2a99541a907ac84a3be740ef67dfadb640832dce /src/lib_table.c
parenta8c3862d63ad60acf07252304bbfd74bce35371c (diff)
downloadluajit-c378f7dbb882068d1ae06edc8e7049fb1907db2d.tar.gz
luajit-c378f7dbb882068d1ae06edc8e7049fb1907db2d.tar.bz2
luajit-c378f7dbb882068d1ae06edc8e7049fb1907db2d.zip
Abstract out post-registration handling of pre-registered modules.
Diffstat (limited to 'src/lib_table.c')
-rw-r--r--src/lib_table.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib_table.c b/src/lib_table.c
index 85ca660e..91c022bb 100644
--- a/src/lib_table.c
+++ b/src/lib_table.c
@@ -275,12 +275,7 @@ LJLIB_NOREG LJLIB_CF(table_new) LJLIB_REC(.)
275 275
276static int luaopen_table_new(lua_State *L) 276static int luaopen_table_new(lua_State *L)
277{ 277{
278 GCfunc *fn = lj_lib_pushcc(L, lj_cf_table_new, FF_table_new, 0); 278 return lj_lib_postreg(L, lj_cf_table_new, FF_table_new, "new");
279 GCtab *t = tabref(curr_func(L)->c.env); /* Reference to "table". */
280 setfuncV(L, lj_tab_setstr(L, t, lj_str_newlit(L, "new")), fn);
281 lj_gc_anybarriert(L, t);
282 setfuncV(L, L->top++, fn);
283 return 1;
284} 279}
285 280
286/* ------------------------------------------------------------------------ */ 281/* ------------------------------------------------------------------------ */