mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +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
|
// insert false before the result
|
||||||
cosmo_insert(state, 0, cosmoV_newBoolean(res == COSMOVM_OK));
|
cosmo_insert(state, 0, cosmoV_newBoolean(res == COSMOVM_OK));
|
||||||
cosmoV_printStack(state);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,9 +339,15 @@ COSMOVMRESULT cosmoV_pcall(CState *state, int args, int nresults) {
|
|||||||
if (!callCValue(state, *base, args, nresults, 0)) {
|
if (!callCValue(state, *base, args, nresults, 0)) {
|
||||||
// restore panic state
|
// restore panic state
|
||||||
state->panic = false;
|
state->panic = false;
|
||||||
state->error = NULL;
|
|
||||||
|
|
||||||
|
if (nresults > 0) {
|
||||||
cosmoV_pushValue(state, cosmoV_newObj(state->error));
|
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;
|
return COSMOVM_RUNTIME_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user