Make slots available to the API outside of foreign methods.

At any point in time, the user can call wrenEnsureSlots() which will
implicitly create a fiber and point to its stack if needed.
This commit is contained in:
Bob Nystrom
2015-12-28 07:43:17 -08:00
parent a09892de32
commit a447b66380
7 changed files with 157 additions and 99 deletions

View File

@ -22,7 +22,7 @@ void metaCompile(WrenVM* vm)
// Return the result. We can't use the public API for this since we have a
// bare ObjFn.
vm->foreignStackStart[0] = fn != NULL ? OBJ_VAL(fn) : NULL_VAL;
vm->apiStack[0] = fn != NULL ? OBJ_VAL(fn) : NULL_VAL;
}
static WrenForeignMethodFn bindMetaForeignMethods(WrenVM* vm,