From 5defc3b91454e03b000b4127210eebabbbe6e640 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Fri, 25 Jun 2021 18:58:19 -0500 Subject: [PATCH] Fix bug with ev/go when passing supervisor and value. value was incorrectly set to nil in these cases. Also fix some typos in core docstrings. --- src/core/debug.c | 4 ++-- src/core/ev.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/debug.c b/src/core/debug.c index 4a641d95..5d4b1fc9 100644 --- a/src/core/debug.c +++ b/src/core/debug.c @@ -333,7 +333,7 @@ static const JanetReg debug_cfuns[] = { "Will throw an error if the breakpoint location " "cannot be found. For example\n\n" "\t(debug/break \"core.janet\" 10 4)\n\n" - "wil set a breakpoint at line 10, 4th column of the file core.janet.") + "will set a breakpoint at line 10, 4th column of the file core.janet.") }, { "debug/unbreak", cfun_debug_unbreak, @@ -383,7 +383,7 @@ static const JanetReg debug_cfuns[] = { JDOC("(debug/stacktrace fiber &opt err)\n\n" "Prints a nice looking stacktrace for a fiber. Can optionally provide " "an error value to print the stack trace with. If `err` is nil or not " - "provided, will skipp the error line. Returns the fiber.") + "provided, will skip the error line. Returns the fiber.") }, { "debug/lineage", cfun_debug_lineage, diff --git a/src/core/ev.c b/src/core/ev.c index ccd65010..b13c4037 100644 --- a/src/core/ev.c +++ b/src/core/ev.c @@ -2038,7 +2038,7 @@ error: static Janet cfun_ev_go(int32_t argc, Janet *argv) { janet_arity(argc, 1, 3); JanetFiber *fiber = janet_getfiber(argv, 0); - Janet value = argc == 2 ? argv[1] : janet_wrap_nil(); + Janet value = argc >= 2 ? argv[1] : janet_wrap_nil(); JanetChannel *supervisor_channel = janet_optabstract(argv, argc, 2, &ChannelAT, janet_vm_root_fiber->supervisor_channel); fiber->supervisor_channel = supervisor_channel;