feat: replace WrenMethod with WrenValue for method handles and update wrenCall signature to return WrenInterpretResult

This commit is contained in:
Bob Nystrom
2015-08-31 14:57:48 +00:00
parent c0d90460f0
commit 2a8847fa57
4 changed files with 49 additions and 92 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ static const char* timerLibSource =
"\n";
// The Wren method to call when a timer has completed.
static WrenMethod* resumeTimer;
static WrenValue* resumeTimer;
// Called by libuv when the timer finished closing.
static void timerCloseCallback(uv_handle_t* handle)
@@ -63,7 +63,7 @@ static void timerCallback(uv_timer_t* handle)
uv_close((uv_handle_t*)handle, timerCloseCallback);
// Run the fiber that was sleeping.
wrenCall(getVM(), resumeTimer, "v", fiber);
wrenCall(getVM(), resumeTimer, NULL, "v", fiber);
wrenReleaseValue(getVM(), fiber);
}
@@ -107,5 +107,5 @@ WrenForeignMethodFn timerBindForeign(
void timerReleaseMethods()
{
if (resumeTimer != NULL) wrenReleaseMethod(getVM(), resumeTimer);
if (resumeTimer != NULL) wrenReleaseValue(getVM(), resumeTimer);
}