1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-19 08:45:11 +00:00

Allow 1 argument call of debug/stacktrace

Since fibers now track the last value signaled.
This commit is contained in:
Calvin Rose
2021-01-17 13:55:40 -06:00
parent 96262e7d87
commit bd2e335063
2 changed files with 13 additions and 7 deletions

View File

@@ -1065,7 +1065,11 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
janet_status_names[sub_status]);
}
fiber->child = f;
vm_return((int) sub_status, stack[B]);
if (janet_checktype(stack[B], JANET_NIL)) {
vm_return((int) sub_status, f->last_value);
} else {
vm_return((int) sub_status, stack[B]);
}
}
VM_OP(JOP_CANCEL) {