Address #804 - save and restore module cache when flychecking.

Calling flychecking cannot change the module cache.
This commit is contained in:
Calvin Rose 2022-02-12 10:36:45 -06:00
parent de542a81c0
commit 4e31d85349
2 changed files with 5 additions and 0 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ local
# Common test files I use.
temp.janet
temp*.janet
scratch.janet
# Emscripten

View File

@ -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)