mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 17:27:18 +00:00
Address #804 - save and restore module cache when flychecking.
Calling flychecking cannot change the module cache.
This commit is contained in:
parent
de542a81c0
commit
4e31d85349
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ local
|
|||||||
|
|
||||||
# Common test files I use.
|
# Common test files I use.
|
||||||
temp.janet
|
temp.janet
|
||||||
|
temp*.janet
|
||||||
scratch.janet
|
scratch.janet
|
||||||
|
|
||||||
# Emscripten
|
# Emscripten
|
||||||
|
@ -3588,10 +3588,14 @@
|
|||||||
arbitrary execution is possible. Other arguments are the same as dofile. `path` can also be
|
arbitrary execution is possible. Other arguments are the same as dofile. `path` can also be
|
||||||
a file value such as stdin. Returns nil.``
|
a file value such as stdin. Returns nil.``
|
||||||
[path &keys kwargs]
|
[path &keys kwargs]
|
||||||
|
(def old-modcache (table/clone module/cache))
|
||||||
|
(table/clear module/cache)
|
||||||
(try
|
(try
|
||||||
(dofile path :evaluator flycheck-evaluator ;(kvs kwargs))
|
(dofile path :evaluator flycheck-evaluator ;(kvs kwargs))
|
||||||
([e f]
|
([e f]
|
||||||
(debug/stacktrace f e "")))
|
(debug/stacktrace f e "")))
|
||||||
|
(table/clear module/cache)
|
||||||
|
(merge-into module/cache old-modcache)
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user