From 0809778b414822c2cf2254f6199b27f54b8ed3e3 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 5 Oct 2026 09:03:40 -0500 Subject: [PATCH] Don't use eval for doing hooks. Instead, require -> module/value -> normal function call --- src/boot/boot.janet | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index b12dfe02..2494a578 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -5139,9 +5139,11 @@ 2) "z" (fn :z-switch [i &] (set no-file false) - (import* "./bundle" :prefix "" :exit exit-on-error) - (for i (inc i) (length args) - (eval [(symbol (get args i))])) + (def m (require "./bundle" :exit exit-on-error)) + (for j (inc i) (length args) + (def hook (module/value m (symbol (get args j)))) + (unless hook (errorf "no hook found for %V" (get args j))) + (hook)) math/inf) "t" (fn :t-switch [i &] (set should-repl false)