diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-01-01 12:14:56 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-01-01 12:14:56 -0200 |
| commit | c6f7181e910b6b2ff1346b5486a31be87b1da5af (patch) | |
| tree | 92cc716487c83ecd9860444f23fd55ef65358cbb /manual | |
| parent | 437a5b07d415e1a74160ddfd804017171d6cc5cb (diff) | |
| download | lua-c6f7181e910b6b2ff1346b5486a31be87b1da5af.tar.gz lua-c6f7181e910b6b2ff1346b5486a31be87b1da5af.tar.bz2 lua-c6f7181e910b6b2ff1346b5486a31be87b1da5af.zip | |
No more LUA_ERRGCMM errors
Errors in finalizers (__gc metamethods) are never propagated.
Instead, they generate a warning.
Diffstat (limited to 'manual')
| -rw-r--r-- | manual/manual.of | 26 |
1 files changed, 9 insertions, 17 deletions
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, | |||
| 722 | following the reverse order that they were marked. | 722 | following the reverse order that they were marked. |
| 723 | If any finalizer marks objects for collection during that phase, | 723 | If any finalizer marks objects for collection during that phase, |
| 724 | these marks have no effect. | 724 | these marks have no effect. |
| 725 | If any finalizer raises an error during that phase, | ||
| 726 | its execution is interrupted but the error is ignored. | ||
| 727 | 725 | ||
| 728 | Finalizers cannot yield. | 726 | Finalizers cannot yield. |
| 729 | 727 | ||
| @@ -2645,8 +2643,7 @@ by looking only at its arguments | |||
| 2645 | The third field, @T{x}, | 2643 | The third field, @T{x}, |
| 2646 | tells whether the function may raise errors: | 2644 | tells whether the function may raise errors: |
| 2647 | @Char{-} means the function never raises any error; | 2645 | @Char{-} means the function never raises any error; |
| 2648 | @Char{m} means the function may raise out-of-memory errors | 2646 | @Char{m} means the function may raise only out-of-memory errors; |
| 2649 | and errors running a finalizer; | ||
| 2650 | @Char{v} means the function may raise the errors explained in the text; | 2647 | @Char{v} means the function may raise the errors explained in the text; |
| 2651 | @Char{e} means the function can run arbitrary Lua code, | 2648 | @Char{e} means the function can run arbitrary Lua code, |
| 2652 | either directly or through metamethods, | 2649 | either directly or through metamethods, |
| @@ -3364,12 +3361,6 @@ syntax error during precompilation;} | |||
| 3364 | @item{@Lid{LUA_ERRMEM}| | 3361 | @item{@Lid{LUA_ERRMEM}| |
| 3365 | @x{memory allocation (out-of-memory) error};} | 3362 | @x{memory allocation (out-of-memory) error};} |
| 3366 | 3363 | ||
| 3367 | @item{@Lid{LUA_ERRGCMM}| | ||
| 3368 | error while running a @idx{__gc} metamethod. | ||
| 3369 | (This error has no relation with the chunk being loaded. | ||
| 3370 | It is generated by the garbage collector.) | ||
| 3371 | } | ||
| 3372 | |||
| 3373 | } | 3364 | } |
| 3374 | 3365 | ||
| 3375 | The @id{lua_load} function uses a user-supplied @id{reader} function | 3366 | 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}. | |||
| 3564 | error while running the @x{message handler}. | 3555 | error while running the @x{message handler}. |
| 3565 | } | 3556 | } |
| 3566 | 3557 | ||
| 3567 | @item{@defid{LUA_ERRGCMM}| | ||
| 3568 | error while running a @idx{__gc} metamethod. | ||
| 3569 | For such errors, Lua does not call the @x{message handler} | ||
| 3570 | (as this kind of error typically has no relation | ||
| 3571 | with the function being called). | ||
| 3572 | } | ||
| 3573 | |||
| 3574 | } | 3558 | } |
| 3575 | 3559 | ||
| 3576 | } | 3560 | } |
| @@ -6298,6 +6282,8 @@ The current value of this variable is @St{Lua 5.4}. | |||
| 6298 | @LibEntry{warn (message)| | 6282 | @LibEntry{warn (message)| |
| 6299 | 6283 | ||
| 6300 | Emits a warning with the given message. | 6284 | Emits a warning with the given message. |
| 6285 | Note that messages not ending with an end-of-line | ||
| 6286 | are assumed to be continued by the message in the next call. | ||
| 6301 | 6287 | ||
| 6302 | } | 6288 | } |
| 6303 | 6289 | ||
| @@ -8773,6 +8759,12 @@ so there is no need to check whether they are using the same | |||
| 8773 | address space.) | 8759 | address space.) |
| 8774 | } | 8760 | } |
| 8775 | 8761 | ||
| 8762 | @item{ | ||
| 8763 | The constant @Lid{LUA_ERRGCMM} was removed. | ||
| 8764 | Errors in finalizers are never propagated; | ||
| 8765 | instead, they generate a warning. | ||
| 8766 | } | ||
| 8767 | |||
| 8776 | } | 8768 | } |
| 8777 | 8769 | ||
| 8778 | } | 8770 | } |
