mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-21 15:00:06 +00:00
removed printStack() from cosmoB_pcall()
This commit is contained in:
parent
eb2f50e456
commit
860f30f201
@ -54,7 +54,6 @@ int cosmoB_pcall(CState *state, int nargs, CValue *args) {
|
||||
|
||||
// insert false before the result
|
||||
cosmo_insert(state, 0, cosmoV_newBoolean(res == COSMOVM_OK));
|
||||
cosmoV_printStack(state);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
10
src/cvm.c
10
src/cvm.c
@ -339,9 +339,15 @@ COSMOVMRESULT cosmoV_pcall(CState *state, int args, int nresults) {
|
||||
if (!callCValue(state, *base, args, nresults, 0)) {
|
||||
// restore panic state
|
||||
state->panic = false;
|
||||
state->error = NULL;
|
||||
|
||||
cosmoV_pushValue(state, cosmoV_newObj(state->error));
|
||||
if (nresults > 0) {
|
||||
cosmoV_pushValue(state, cosmoV_newObj(state->error));
|
||||
|
||||
// push other expected results onto the stack
|
||||
for (int i = 0; i < nresults-1; i++)
|
||||
cosmoV_pushValue(state, cosmoV_newNil());
|
||||
}
|
||||
|
||||
return COSMOVM_RUNTIME_ERR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user