mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
* fix #17286 nim check -b:js works * fix
This commit is contained in:
@@ -65,6 +65,8 @@ proc commandCheck(graph: ModuleGraph) =
|
||||
if optWasNimscript in conf.globalOptions:
|
||||
defineSymbol(conf.symbols, "nimscript")
|
||||
defineSymbol(conf.symbols, "nimconfig")
|
||||
elif conf.backend == backendJs:
|
||||
setTarget(conf.target, osJS, cpuJS)
|
||||
semanticPasses(graph) # use an empty backend for semantic checking only
|
||||
compileProject(graph)
|
||||
|
||||
|
||||
16
tests/misc/t17286.nim
Normal file
16
tests/misc/t17286.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
cmd: "nim check -b:js $file"
|
||||
action: "compile"
|
||||
"""
|
||||
|
||||
# bug #17286
|
||||
|
||||
import std/compilesettings
|
||||
|
||||
static:
|
||||
doAssert querySetting(backend) == "js"
|
||||
doAssert defined(js)
|
||||
doAssert not defined(c)
|
||||
|
||||
import random
|
||||
randomize()
|
||||
Reference in New Issue
Block a user