new API functions lua_getstr/lua_setstr

This commit is contained in:
Roberto Ierusalimschy
2001-12-10 20:09:51 -02:00
parent 592a309177
commit 9cd36059ad
7 changed files with 30 additions and 45 deletions

View File

@@ -228,9 +228,8 @@ LUALIB_API int luaL_ref (lua_State *L, int t) {
}
else { /* no free elements */
ref = lua_getn(L, t) + 1; /* use next `n' */
lua_pushliteral(L, "n");
lua_pushnumber(L, ref);
lua_settable(L, t); /* n = n+1 */
lua_setstr(L, t, "n"); /* n = n+1 */
}
lua_rawseti(L, t, ref);
return ref;