mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
'ipairs' is deprecated
This commit is contained in:
parent
5ca7cdd709
commit
62840c5fad
1 changed files with 13 additions and 1 deletions
14
lbaselib.c
14
lbaselib.c
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lbaselib.c,v 1.236 2010/03/12 19:14:06 roberto Exp roberto $
|
** $Id: lbaselib.c,v 1.237 2010/03/13 03:57:46 roberto Exp roberto $
|
||||||
** Basic library
|
** Basic library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
|
@ -252,6 +252,8 @@ static int luaB_pairs (lua_State *L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(LUA_COMPAT_IPAIRS)
|
||||||
|
|
||||||
static int ipairsaux (lua_State *L) {
|
static int ipairsaux (lua_State *L) {
|
||||||
int i = luaL_checkint(L, 2);
|
int i = luaL_checkint(L, 2);
|
||||||
luaL_checktype(L, 1, LUA_TTABLE);
|
luaL_checktype(L, 1, LUA_TTABLE);
|
||||||
|
|
@ -266,6 +268,16 @@ static int luaB_ipairs (lua_State *L) {
|
||||||
return pairsmeta(L, "__ipairs", 1);
|
return pairsmeta(L, "__ipairs", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define ipairsaux luaB_ipairs
|
||||||
|
|
||||||
|
static int luaB_ipairs (lua_State *L) {
|
||||||
|
return luaL_error(L, "'ipairs' deprecated");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static int load_aux (lua_State *L, int status) {
|
static int load_aux (lua_State *L, int status) {
|
||||||
if (status == LUA_OK)
|
if (status == LUA_OK)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue