diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-10 13:23:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-10 13:23:14 -0300 |
commit | a93e0144479f1eb0ac19b8c31862f4cbc2fbe1c4 (patch) | |
tree | da550c2f101ae33b6a068936c5dc77064abf3951 /lcorolib.c | |
parent | 8ba4523cccf59093543cec988b07957193d55692 (diff) | |
download | lua-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -146,7 +146,8 @@ static int luaB_costatus (lua_State *L) { | |||
146 | 146 | ||
147 | 147 | ||
148 | static int luaB_yieldable (lua_State *L) { | 148 | static 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 | ||