summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-12 00:50:25 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-12 00:50:25 +0200
commit7a018007a442c74602fc6819ff5eb30697cbbf49 (patch)
tree3bdab30c5503f21f208dea741ba9abdaae7e68cc /tests
parentbcb2365decb4fce8bd0be9e8e7a855a86fbcc202 (diff)
downloadNim-7a018007a442c74602fc6819ff5eb30697cbbf49.tar.gz
fixes #4471
Diffstat (limited to 'tests')
-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