aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-02-28 10:10:27 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-02-28 10:10:27 -0300
commit127a8e80fe0d74efd26994b3877cdc77b712ea56 (patch)
tree12b8b3be0660884f4a1075af37e0f58cbd43a3d3 /ldo.c
parentf9e35627ed26dff4114a1d01ff113d8b4cc91ab5 (diff)
downloadlua-127a8e80fe0d74efd26994b3877cdc77b712ea56.tar.gz
lua-127a8e80fe0d74efd26994b3877cdc77b712ea56.tar.bz2
lua-127a8e80fe0d74efd26994b3877cdc77b712ea56.zip
'__close' gets no error object if there is no error
Instead of receiving nil as a second argument, __close metamethods are called with just one argument when there are no errors.
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/ldo.c b/ldo.c
index 4705b26c..3ddc5a4c 100644
--- a/ldo.c
+++ b/ldo.c
@@ -111,10 +111,6 @@ void luaD_seterrorobj (lua_State *L, TStatus errcode, StkId oldtop) {
111 setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); 111 setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling"));
112 break; 112 break;
113 } 113 }
114 case LUA_OK: { /* special case only for closing upvalues */
115 setnilvalue(s2v(oldtop)); /* no error message */
116 break;
117 }
118 default: { 114 default: {
119 lua_assert(errorstatus(errcode)); /* real error */ 115 lua_assert(errorstatus(errcode)); /* real error */
120 setobjs2s(L, oldtop, L->top.p - 1); /* error message on current top */ 116 setobjs2s(L, oldtop, L->top.p - 1); /* error message on current top */