diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-02-28 10:10:27 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-02-28 10:10:27 -0300 |
| commit | 127a8e80fe0d74efd26994b3877cdc77b712ea56 (patch) | |
| tree | 12b8b3be0660884f4a1075af37e0f58cbd43a3d3 /ldo.c | |
| parent | f9e35627ed26dff4114a1d01ff113d8b4cc91ab5 (diff) | |
| download | lua-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.c | 4 |
1 files changed, 0 insertions, 4 deletions
| @@ -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 */ |
