aboutsummaryrefslogtreecommitdiff
path: root/lcorolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-10 13:23:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-10 13:23:14 -0300
commita93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4 (patch)
treeda550c2f101ae33b6a068936c5dc77064abf3951 /lcorolib.c
parent8ba4523cccf59093543cec988b07957193d55692 (diff)
downloadlua-a93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4.tar.gz
lua-a93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4.tar.bz2
lua-a93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4.zip
Added an optional parameter to 'coroutine.isyieldable'
Diffstat (limited to 'lcorolib.c')
-rw-r--r--lcorolib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lcorolib.c b/lcorolib.c
index cdb5fedc..f7c9e165 100644
--- a/lcorolib.c
+++ b/lcorolib.c
@@ -146,7 +146,8 @@ static int luaB_costatus (lua_State *L) {
146 146
147 147
148static int luaB_yieldable (lua_State *L) { 148static int luaB_yieldable (lua_State *L) {
149 lua_pushboolean(L, lua_isyieldable(L)); 149 lua_State *co = lua_isnone(L, 1) ? L : getco(L);
150 lua_pushboolean(L, lua_isyieldable(co));
150 return 1; 151 return 1;
151} 152}
152 153