diff options
author | daurnimator <quae@daurnimator.com> | 2017-04-26 17:26:00 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-04-26 17:27:03 +1000 |
commit | 992285ba12d217a3def72e49a29fba70e4e48f2f (patch) | |
tree | 5d84504946443de0c86b3419c871a38f59322364 /src/lcorolib.js | |
parent | 382e28086f97085edbf099247949c3f801cc0ed0 (diff) | |
download | fengari-992285ba12d217a3def72e49a29fba70e4e48f2f.tar.gz fengari-992285ba12d217a3def72e49a29fba70e4e48f2f.tar.bz2 fengari-992285ba12d217a3def72e49a29fba70e4e48f2f.zip |
Remove lua.thread_status
Diffstat (limited to 'src/lcorolib.js')
-rw-r--r-- | src/lcorolib.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lcorolib.js b/src/lcorolib.js index a46df98..98eebac 100644 --- a/src/lcorolib.js +++ b/src/lcorolib.js @@ -9,7 +9,6 @@ const lstate = require('./lstate.js'); const ldo = require('./ldo.js'); const ldebug = require('./ldebug.js'); const lobject = require('./lobject.js'); -const TS = lua.thread_status; const getco = function(L) { let co = lapi.lua_tothread(L, 1); @@ -23,14 +22,14 @@ const auxresume = function(L, co, narg) { return -1; /* error flag */ } - if (lapi.lua_status(co) === TS.LUA_OK && lapi.lua_gettop(co) === 0) { + if (lapi.lua_status(co) === lua.LUA_OK && lapi.lua_gettop(co) === 0) { lapi.lua_pushliteral(L, "cannot resume dead coroutine"); return -1; /* error flag */ } lapi.lua_xmove(L, co, narg); let status = ldo.lua_resume(co, L, narg); - if (status === TS.LUA_OK || status === TS.LUA_YIELD) { + if (status === lua.LUA_OK || status === lua.LUA_YIELD) { let nres = lapi.lua_gettop(co); if (!lapi.lua_checkstack(L, nres + 1)) { lapi.lua_pop(co, nres); /* remove results anyway */ @@ -99,10 +98,10 @@ const luaB_costatus = function(L) { if (L === co) lapi.lua_pushliteral(L, "running"); else { switch (lapi.lua_status(co)) { - case TS.LUA_YIELD: + case lua.LUA_YIELD: lapi.lua_pushliteral(L, "suspended"); break; - case TS.LUA_OK: { + case lua.LUA_OK: { let ar = new lua.lua_Debug(); if (ldebug.lua_getstack(co, 0, ar) > 0) /* does it have frames? */ lapi.lua_pushliteral(L, "normal"); /* it is running */ |