summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-04-13 22:30:57 +0800
committerGitHub <noreply@github.com>2024-04-13 16:30:57 +0200
commit5d2a712b0eb9caefac0a008c7b9551ddeeab9e0f (patch)
treee7bd7b86e7b648748311616b23b7d8988ea01d80 /tests
parent1bd095521856d4d1f9fb1b6ba580df3c815196f6 (diff)
downloadNim-5d2a712b0eb9caefac0a008c7b9551ddeeab9e0f.tar.gz
[JS backend] improve `discard` statement; ridding of the awkward special variable `_` (#23498)
According to
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/Expression_statement,
some expression statements need parentheses to make it unambiguous. `_`
introduced in the https://github.com/nim-lang/Nim/pull/15789 is
unnecessary. We can get rid of it by adding parentheses so that object
literals are not ambiguous with block statements.
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tjsffi.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/js/tjsffi.nim b/tests/js/tjsffi.nim
index 94323c074..265ae52e9 100644
--- a/tests/js/tjsffi.nim
+++ b/tests/js/tjsffi.nim
@@ -269,5 +269,5 @@ block: # test **
 block: # issue #21208
   type MyEnum = enum baz
   var obj: JsObject
-  {.emit: "`obj` = {bar: {baz: 123}}".}
+  {.emit: "`obj` = {bar: {baz: 123}};".}
   discard obj.bar.baz