1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 07:03:02 +00:00

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

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)