summaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-01-11 15:03:01 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-01-11 15:03:01 -0300
commitcc1692515e2a6aabc6d07159e7926656e38eda53 (patch)
treebc89a17cdc55a52897cc0d5a862cbc34314ada93 /ltests.c
parentce101dcaf73ff6d610593230d41b63c163a91519 (diff)
downloadlua-github-cc1692515e2a6aabc6d07159e7926656e38eda53.tar.gz
New API function 'lua_closeslot'
Closing a to-be-closed variable with 'lua_settop' is too restrictive, as it erases all slots above the variable. Moreover, it adds side effects to 'lua_settop', which should be a fairly basic function.
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ltests.c b/ltests.c
index 6920dd69..9c13338a 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1766,6 +1766,9 @@ static struct X { int x; } x;
else if EQ("toclose") {
lua_toclose(L1, getnum);
}
+ else if EQ("closeslot") {
+ lua_closeslot(L1, getnum);
+ }
else luaL_error(L, "unknown instruction %s", buff);
}
return 0;