diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 09:51:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 09:51:54 -0300 |
commit | ca13be9af784b7288d3a07d9b5bccb329086e885 (patch) | |
tree | c027419f98064d681518a4130439920a13a11b06 /lstate.c | |
parent | a1d8eb27431c02c4529be1efd92143ad65434f3a (diff) | |
download | lua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.gz lua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.bz2 lua-ca13be9af784b7288d3a07d9b5bccb329086e885.zip |
Supressed errors in '__close' generate warnings
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -443,3 +443,19 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) { | |||
443 | } | 443 | } |
444 | 444 | ||
445 | 445 | ||
446 | /* | ||
447 | ** Generate a warning from an error message | ||
448 | */ | ||
449 | void luaE_warnerror (lua_State *L, const char *where) { | ||
450 | TValue *errobj = s2v(L->top - 1); /* error object */ | ||
451 | const char *msg = (ttisstring(errobj)) | ||
452 | ? svalue(errobj) | ||
453 | : "error object is not a string"; | ||
454 | /* produce warning "error in %s (%s)" (where, msg) */ | ||
455 | luaE_warning(L, "error in ", 1); | ||
456 | luaE_warning(L, where, 1); | ||
457 | luaE_warning(L, " (", 1); | ||
458 | luaE_warning(L, msg, 1); | ||
459 | luaE_warning(L, ")", 0); | ||
460 | } | ||
461 | |||