summary refs log tree commit diff stats
path: root/tests/js/tstring_assignment.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/tstring_assignment.nim')
-rw-r--r--tests/js/tstring_assignment.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/js/tstring_assignment.nim b/tests/js/tstring_assignment.nim
new file mode 100644
index 000000000..bdd93e6b5
--- /dev/null
+++ b/tests/js/tstring_assignment.nim
@@ -0,0 +1,11 @@
+discard """
+  output: '''true'''
+"""
+
+# bug #4471
+when true:
+  let s1 = "123"
+  var s2 = s1
+  s2.setLen(0)
+  # fails - s1.len == 0
+  echo s1.len == 3