diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.88 2002/06/26 20:36:17 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.89 2002/07/01 19:23:58 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -571,11 +571,11 @@ static void base_open (lua_State *L) { | |||
571 | /* `newproxy' needs a weaktable as upvalue */ | 571 | /* `newproxy' needs a weaktable as upvalue */ |
572 | lua_pushliteral(L, "newproxy"); | 572 | lua_pushliteral(L, "newproxy"); |
573 | lua_newtable(L); /* new table `w' */ | 573 | lua_newtable(L); /* new table `w' */ |
574 | lua_newtable(L); /* create `w's metatable */ | 574 | lua_pushvalue(L, -1); /* `w' will be its own metatable */ |
575 | lua_setmetatable(L, -2); | ||
575 | lua_pushliteral(L, "__mode"); | 576 | lua_pushliteral(L, "__mode"); |
576 | lua_pushliteral(L, "k"); | 577 | lua_pushliteral(L, "k"); |
577 | lua_rawset(L, -3); /* metatable(w).__mode = "k" */ | 578 | lua_rawset(L, -3); /* metatable(w).__mode = "k" */ |
578 | lua_setmetatable(L, -2); | ||
579 | lua_pushcclosure(L, luaB_newproxy, 1); | 579 | lua_pushcclosure(L, luaB_newproxy, 1); |
580 | lua_rawset(L, -3); /* set global `newproxy' */ | 580 | lua_rawset(L, -3); /* set global `newproxy' */ |
581 | lua_rawset(L, -1); /* set global _G */ | 581 | lua_rawset(L, -1); /* set global _G */ |