diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 292832b6..59e0a016 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -3127,9 +3127,6 @@ (put nextenv :debug-level level) (put nextenv :signal x) (merge-into nextenv debugger-env) - (eprint (fiber/status f) ": " x) - (debug/stacktrace f x) - (eflush) (defn debugger-chunks [buf p] (def status (:state p :delimiters)) (def c ((:where p) 0)) @@ -3149,9 +3146,12 @@ (put e '_ @{:value x}) (printf (get e :pretty-format "%q") x) (flush)) - (if (e :debug) - (enter-debugger f x) - (do (eprint fs ": " x) (debug/stacktrace f x) (eflush)))))) + (do + (def ec (dyn :err-color)) + (eprint (if ec "\e[31m" "") fs ": " x) + (debug/stacktrace f) + (eflush) + (if (e :debug) (enter-debugger f x)))))) (run-context {:env env :chunks chunks diff --git a/src/core/vm.c b/src/core/vm.c index 4a613a37..ba4a0bfc 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -275,14 +275,9 @@ static Janet call_nonfn(JanetFiber *fiber, Janet callee) { return janet_method_invoke(callee, argc, fiber->data + fiber->stacktop); } +/* Method lookup could potentially handle tables specially... */ static Janet method_to_fun(Janet method, Janet obj) { - if (janet_checktype(obj, JANET_TABLE)) { - JanetTable *proto = janet_unwrap_table(obj)->proto; - if (NULL == proto) return janet_wrap_nil(); - return janet_table_get(proto, method); - } else { - return janet_get(obj, method); - } + return janet_get(obj, method); } /* Get a callable from a keyword method name and ensure that it is valid. */