summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-08 22:39:25 +0800
committerGitHub <noreply@github.com>2023-01-08 15:39:25 +0100
commit76e4f8afb1423eb04f26059f1ed01ca0375bee63 (patch)
tree8c0802b478e7fa801fe6f53642b27113366b1335
parent24d297b437d6ba84c965367edfc0a51c59d7de90 (diff)
downloadNim-76e4f8afb1423eb04f26059f1ed01ca0375bee63.tar.gz
fixes #21209; exclude threads options for JS (#21233)
-rw-r--r--compiler/commands.nim2
-rw-r--r--tests/js/t21209.nim6
-rw-r--r--tests/js/t21209.nims1
3 files changed, 9 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 73140036a..59b221647 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -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":
diff --git a/tests/js/t21209.nim b/tests/js/t21209.nim
new file mode 100644
index 000000000..4de34f035
--- /dev/null
+++ b/tests/js/t21209.nim
@@ -0,0 +1,6 @@
+discard """
+  action: "compile"
+  cmd: "nim check --warning[UnusedImport]:off $file"
+"""
+
+import std/times
diff --git a/tests/js/t21209.nims b/tests/js/t21209.nims
new file mode 100644
index 000000000..318e28f97
--- /dev/null
+++ b/tests/js/t21209.nims
@@ -0,0 +1 @@
+--b:js
\ No newline at end of file