Merge pull request #545 from braunse/master

Properly guard access to NimCompilerApiVersion.
This commit is contained in:
Dominik Picheta 2018-09-15 23:30:46 +01:00 committed by GitHub
commit 1f79f17de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,12 +42,12 @@ proc isStrLit(n: PNode): bool = n.kind in {nkStrLit..nkTripleStrLit}
when declared(NimCompilerApiVersion):
const finalApi = NimCompilerApiVersion >= 2
when NimCompilerApiVersion >= 3:
import compiler / pathutils
else:
const finalApi = false
when NimCompilerApiVersion >= 3:
import compiler / pathutils
proc getGlobal(g: ModuleGraph; ident: PSym): string =
when finalApi:
let n = vm.getGlobalValue(PCtx g.vm, ident)