fixes #21209; exclude threads options for JS (#21233)

This commit is contained in:
ringabout
2023-01-08 22:39:25 +08:00
committed by GitHub
parent 24d297b437
commit 76e4f8afb1
3 changed files with 9 additions and 0 deletions

View File

@@ -649,6 +649,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
of "backend", "b":
let backend = parseEnum(arg.normalize, TBackend.default)
if backend == TBackend.default: localError(conf, info, "invalid backend: '$1'" % arg)
if backend == backendJs: # bug #21209
conf.globalOptions.excl {optThreadAnalysis, optThreads}
conf.backend = backend
of "doccmd": conf.docCmd = arg
of "define", "d":

6
tests/js/t21209.nim Normal file
View File

@@ -0,0 +1,6 @@
discard """
action: "compile"
cmd: "nim check --warning[UnusedImport]:off $file"
"""
import std/times

1
tests/js/t21209.nims Normal file
View File

@@ -0,0 +1 @@
--b:js