summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-04-11 16:18:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-04-11 16:18:40 -0300
commit82a8e065247f710aea237563815d82aa5f515905 (patch)
tree25ffe8a0c61e38bacb16550913c77576955a5b09
parentc258870c59a82e344b3155a271d25b389b5a7422 (diff)
downloadlua-82a8e065247f710aea237563815d82aa5f515905.tar.gz
lua-82a8e065247f710aea237563815d82aa5f515905.tar.bz2
lua-82a8e065247f710aea237563815d82aa5f515905.zip
details ('error' does not coerce numbers to strings + comments)
-rw-r--r--lbaselib.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 95ea7dd5..d4c8fef2 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.311 2015/06/26 19:25:45 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.312 2015/10/29 15:21:04 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*/
@@ -102,8 +102,8 @@ static int luaB_tonumber (lua_State *L) {
102static int luaB_error (lua_State *L) { 102static int luaB_error (lua_State *L) {
103 int level = (int)luaL_optinteger(L, 2, 1); 103 int level = (int)luaL_optinteger(L, 2, 1);
104 lua_settop(L, 1); 104 lua_settop(L, 1);
105 if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ 105 if (lua_type(L, 1) == LUA_TSTRING && level > 0) {
106 luaL_where(L, level); 106 luaL_where(L, level); /* add extra information */
107 lua_pushvalue(L, 1); 107 lua_pushvalue(L, 1);
108 lua_concat(L, 2); 108 lua_concat(L, 2);
109 } 109 }
@@ -251,9 +251,8 @@ static int ipairsaux (lua_State *L) {
251 251
252 252
253/* 253/*
254** This function will use either 'ipairsaux' or 'ipairsaux_raw' to 254** 'ipairs' function. Returns 'ipairsaux', given "table", 0.
255** traverse a table, depending on whether the table has metamethods 255** (The given "table" may not be a table.)
256** that can affect the traversal.
257*/ 256*/
258static int luaB_ipairs (lua_State *L) { 257static int luaB_ipairs (lua_State *L) {
259#if defined(LUA_COMPAT_IPAIRS) 258#if defined(LUA_COMPAT_IPAIRS)