From c6f7181e910b6b2ff1346b5486a31be87b1da5af Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 1 Jan 2019 12:14:56 -0200 Subject: No more LUA_ERRGCMM errors Errors in finalizers (__gc metamethods) are never propagated. Instead, they generate a warning. --- manual/manual.of | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'manual') diff --git a/manual/manual.of b/manual/manual.of index 196ea1ef..d64f0f1a 100644 --- a/manual/manual.of +++ b/manual/manual.of @@ -722,8 +722,6 @@ Lua calls the finalizers of all objects marked for finalization, following the reverse order that they were marked. If any finalizer marks objects for collection during that phase, these marks have no effect. -If any finalizer raises an error during that phase, -its execution is interrupted but the error is ignored. Finalizers cannot yield. @@ -2645,8 +2643,7 @@ by looking only at its arguments The third field, @T{x}, tells whether the function may raise errors: @Char{-} means the function never raises any error; -@Char{m} means the function may raise out-of-memory errors -and errors running a finalizer; +@Char{m} means the function may raise only out-of-memory errors; @Char{v} means the function may raise the errors explained in the text; @Char{e} means the function can run arbitrary Lua code, either directly or through metamethods, @@ -3364,12 +3361,6 @@ syntax error during precompilation;} @item{@Lid{LUA_ERRMEM}| @x{memory allocation (out-of-memory) error};} -@item{@Lid{LUA_ERRGCMM}| -error while running a @idx{__gc} metamethod. -(This error has no relation with the chunk being loaded. -It is generated by the garbage collector.) -} - } The @id{lua_load} function uses a user-supplied @id{reader} function @@ -3564,13 +3555,6 @@ For such errors, Lua does not call the @x{message handler}. error while running the @x{message handler}. } -@item{@defid{LUA_ERRGCMM}| -error while running a @idx{__gc} metamethod. -For such errors, Lua does not call the @x{message handler} -(as this kind of error typically has no relation -with the function being called). -} - } } @@ -6298,6 +6282,8 @@ The current value of this variable is @St{Lua 5.4}. @LibEntry{warn (message)| Emits a warning with the given message. +Note that messages not ending with an end-of-line +are assumed to be continued by the message in the next call. } @@ -8773,6 +8759,12 @@ so there is no need to check whether they are using the same address space.) } +@item{ +The constant @Lid{LUA_ERRGCMM} was removed. +Errors in finalizers are never propagated; +instead, they generate a warning. +} + } } -- cgit v1.2.3-55-g6feb