aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-02-28 10:10:27 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-02-28 10:10:27 -0300
commit127a8e80fe0d74efd26994b3877cdc77b712ea56 (patch)
tree12b8b3be0660884f4a1075af37e0f58cbd43a3d3 /manual
parentf9e35627ed26dff4114a1d01ff113d8b4cc91ab5 (diff)
downloadlua-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.of7
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.
1612Here, to @emph{close} a value means 1612Here, to @emph{close} a value means
1613to call its @idx{__close} metamethod. 1613to call its @idx{__close} metamethod.
1614When calling the metamethod, 1614When calling the metamethod,
1615the value itself is passed as the first argument 1615the value itself is passed as the first argument.
1616and the error object that caused the exit (if any) 1616If there was an error,
1617the error object that caused the exit
1617is passed as a second argument; 1618is passed as a second argument;
1618if there was no error, the second argument is @nil. 1619otherwise, there is no second argument.
1619 1620
1620The value assigned to a to-be-closed variable 1621The value assigned to a to-be-closed variable
1621must have a @idx{__close} metamethod 1622must have a @idx{__close} metamethod