aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-19 12:52:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-03-19 12:52:48 -0300
commit62840c5fadafe0abe8b524601f0367db297c0653 (patch)
tree5031ff7a9c61465be92eef2c6cb76c3472fa74eb
parent5ca7cdd709e72766c2bfd145815bcb9f0dbaed63 (diff)
downloadlua-62840c5fadafe0abe8b524601f0367db297c0653.tar.gz
lua-62840c5fadafe0abe8b524601f0367db297c0653.tar.bz2
lua-62840c5fadafe0abe8b524601f0367db297c0653.zip
'ipairs' is deprecated
-rw-r--r--lbaselib.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 1b2c687c..3af55a79 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.236 2010/03/12 19:14:06 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.237 2010/03/13 03:57:46 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*/
@@ -252,6 +252,8 @@ static int luaB_pairs (lua_State *L) {
252} 252}
253 253
254 254
255#if defined(LUA_COMPAT_IPAIRS)
256
255static int ipairsaux (lua_State *L) { 257static int ipairsaux (lua_State *L) {
256 int i = luaL_checkint(L, 2); 258 int i = luaL_checkint(L, 2);
257 luaL_checktype(L, 1, LUA_TTABLE); 259 luaL_checktype(L, 1, LUA_TTABLE);
@@ -266,6 +268,16 @@ static int luaB_ipairs (lua_State *L) {
266 return pairsmeta(L, "__ipairs", 1); 268 return pairsmeta(L, "__ipairs", 1);
267} 269}
268 270
271#else
272
273#define ipairsaux luaB_ipairs
274
275static int luaB_ipairs (lua_State *L) {
276 return luaL_error(L, "'ipairs' deprecated");
277}
278
279#endif
280
269 281
270static int load_aux (lua_State *L, int status) { 282static int load_aux (lua_State *L, int status) {
271 if (status == LUA_OK) 283 if (status == LUA_OK)