From 4e31d85349e615d8ddad9dff297fc9c24b84416f Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 12 Feb 2022 10:36:45 -0600 Subject: [PATCH] Address #804 - save and restore module cache when flychecking. Calling flychecking cannot change the module cache. --- .gitignore | 1 + src/boot/boot.janet | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 23e0a889..73449d15 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ local # Common test files I use. temp.janet +temp*.janet scratch.janet # Emscripten diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 4182686c..ff08d833 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -3588,10 +3588,14 @@ arbitrary execution is possible. Other arguments are the same as dofile. `path` can also be a file value such as stdin. Returns nil.`` [path &keys kwargs] + (def old-modcache (table/clone module/cache)) + (table/clear module/cache) (try (dofile path :evaluator flycheck-evaluator ;(kvs kwargs)) ([e f] (debug/stacktrace f e ""))) + (table/clear module/cache) + (merge-into module/cache old-modcache) nil)