mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-10 21:58:48 +01:00
There's a lot of changes here and surely some rough edges to iron out. Also, I need to update the docs. But I want to get closer to landing this so I can build on it.
29 lines
789 B
C
29 lines
789 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "wren.h"
|
|
|
|
void resetStackAfterCallAbortRunTests(WrenVM* vm)
|
|
{
|
|
wrenEnsureSlots(vm, 1);
|
|
wrenGetVariable(vm, "./test/api/reset_stack_after_call_abort", "Test", 0);
|
|
WrenHandle* testClass = wrenGetSlotHandle(vm, 0);
|
|
|
|
WrenHandle* abortFiber = wrenMakeCallHandle(vm, "abortFiber()");
|
|
WrenHandle* afterConstruct = wrenMakeCallHandle(vm, "afterAbort(_,_)");
|
|
|
|
wrenEnsureSlots(vm, 1);
|
|
wrenSetSlotHandle(vm, 0, testClass);
|
|
wrenCall(vm, abortFiber);
|
|
|
|
wrenEnsureSlots(vm, 3);
|
|
wrenSetSlotHandle(vm, 0, testClass);
|
|
wrenSetSlotDouble(vm, 1, 1.0);
|
|
wrenSetSlotDouble(vm, 2, 2.0);
|
|
wrenCall(vm, afterConstruct);
|
|
|
|
wrenReleaseHandle(vm, testClass);
|
|
wrenReleaseHandle(vm, abortFiber);
|
|
wrenReleaseHandle(vm, afterConstruct);
|
|
}
|