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 /manual | |
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 'manual')
-rw-r--r-- | manual/manual.of | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/manual/manual.of b/manual/manual.of index a55c7b49..ff4e79fe 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -1612,10 +1612,11 @@ or exiting by an error. | |||
1612 | Here, to @emph{close} a value means | 1612 | Here, to @emph{close} a value means |
1613 | to call its @idx{__close} metamethod. | 1613 | to call its @idx{__close} metamethod. |
1614 | When calling the metamethod, | 1614 | When calling the metamethod, |
1615 | the value itself is passed as the first argument | 1615 | the value itself is passed as the first argument. |
1616 | and the error object that caused the exit (if any) | 1616 | If there was an error, |
1617 | the error object that caused the exit | ||
1617 | is passed as a second argument; | 1618 | is passed as a second argument; |
1618 | if there was no error, the second argument is @nil. | 1619 | otherwise, there is no second argument. |
1619 | 1620 | ||
1620 | The value assigned to a to-be-closed variable | 1621 | The value assigned to a to-be-closed variable |
1621 | must have a @idx{__close} metamethod | 1622 | must have a @idx{__close} metamethod |