diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-27 13:38:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-27 13:38:51 -0200 |
| commit | a654e82f5c0dcc57d5db385a359379d226054b39 (patch) | |
| tree | f2a805174cafd567d4e2035e6dc55013805ca76e | |
| parent | 3e41afcec550e8c5c3c4372f72efa48cbf7031a3 (diff) | |
| download | lua-a654e82f5c0dcc57d5db385a359379d226054b39.tar.gz lua-a654e82f5c0dcc57d5db385a359379d226054b39.tar.bz2 lua-a654e82f5c0dcc57d5db385a359379d226054b39.zip | |
coroutines may have C bodies
Diffstat (limited to '')
| -rw-r--r-- | lbaselib.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbaselib.c,v 1.227 2009/11/25 15:27:51 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.228 2009/11/26 11:39:20 roberto Exp roberto $ |
| 3 | ** Basic library | 3 | ** Basic library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -616,8 +616,7 @@ static int luaB_auxwrap (lua_State *L) { | |||
| 616 | 616 | ||
| 617 | static int luaB_cocreate (lua_State *L) { | 617 | static int luaB_cocreate (lua_State *L) { |
| 618 | lua_State *NL = lua_newthread(L); | 618 | lua_State *NL = lua_newthread(L); |
| 619 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, | 619 | luaL_checktype(L, 1, LUA_TFUNCTION); |
| 620 | "Lua function expected"); | ||
| 621 | lua_pushvalue(L, 1); /* move function to top */ | 620 | lua_pushvalue(L, 1); /* move function to top */ |
| 622 | lua_xmove(L, NL, 1); /* move function from L to NL */ | 621 | lua_xmove(L, NL, 1); /* move function from L to NL */ |
| 623 | return 1; | 622 | return 1; |
