aboutsummaryrefslogtreecommitdiff
path: root/testes/errors.lua (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-01-08Optional 'init' argument to 'string.gmatch'Roberto Ierusalimschy6-52/+116
The function 'string.gmatch' now has an optional 'init' argument, similar to 'string.find' and 'string.match'. Moreover, there was some reorganization in the manipulation of indices in the string library. This commit also includes small janitorial work in the manual and in comments in the interpreter loop.
2019-01-04No more to-be-closed functionsRoberto Ierusalimschy8-68/+97
To-be-closed variables must contain objects with '__toclose' metamethods (or nil). Functions were removed for several reasons: * Functions interact badly with sandboxes. If a sandbox raises an error to interrupt a script, a to-be-closed function still can hijack control and continue running arbitrary sandboxed code. * Functions interact badly with coroutines. If a coroutine yields and is never resumed again, its to-be-closed functions will never run. To-be-closed objects, on the other hand, will still be closed, provided they have appropriate finalizers. * If you really need a function, it is easy to create a dummy object to run that function in its '__toclose' metamethod. This comit also adds closing of variables in case of panic.
2019-01-01No more LUA_ERRGCMM errorsRoberto Ierusalimschy10-111/+145
Errors in finalizers (__gc metamethods) are never propagated. Instead, they generate a warning.
2018-12-28Added a warning system to LuaRoberto Ierusalimschy10-15/+173
The warning system is just a way for Lua to emit warnings, messages to the programmer that do not interfere with the running program.
2018-12-27Changes in the control of C-stack overflowRoberto Ierusalimschy12-74/+170
* unification of the 'nny' and 'nCcalls' counters; * external C functions ('lua_CFunction') count more "slots" in the C stack (to allow for their possible use of buffers) * added a new test script specific for C-stack overflows. (Most of those tests were already present, but concentrating them in a single script easies the task of checking whether 'LUAI_MAXCCALLS' is adequate in a system.)
2018-12-27DetailRoberto Ierusalimschy2-3/+2
Slightly better error message for invalid conversions in 'string.format'.
2018-12-19'all' script automatically 'make's everythingRoberto Ierusalimschy3-6/+10
The script 'all', to run all tests, automatically ensures that the Lua interpreter and the test C libraries (in 'testes/libs/') are updated with any changes in 'luaconf.h'.