vm now free of global variables

This commit is contained in:
Andreas Rumpf 2018-05-28 14:41:49 +02:00
commit 382bc34f93
4 changed files with 12 additions and 17 deletions

View file

@ -166,14 +166,13 @@ proc runNimScript*(cache: IdentCache; scriptName: string;
var m = graph.makeModule(scriptName)
incl(m.flags, sfMainModule)
vm.globalCtx = setupVM(m, cache, scriptName, graph)
graph.vm = setupVM(m, cache, scriptName, graph)
graph.compileSystemModule(cache)
discard graph.processModule(m, llStreamOpen(scriptName, fmRead), nil, cache)
# ensure we load 'system.nim' again for the real non-config stuff!
resetSystemArtifacts(graph)
vm.globalCtx = nil
# do not remove the defined symbols
#initDefines()
undefSymbol(conf.symbols, "nimscript")