summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-06-12 00:30:49 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-06-12 00:30:49 +0200
commite36c12ee37896f64d16271f31dde39be3d782fab (patch)
tree08f6d5c58b226b0a111097dd9703ddf60b9c5304 /tests
parentd31fe7666a949afced44e538d9a2dda3e29d4a28 (diff)
parent6436d1920c4b7754caede5d1d4e535666a2debea (diff)
downloadNim-e36c12ee37896f64d16271f31dde39be3d782fab.tar.gz
Merge pull request #2902 from yglukhov/js-copying-fix
Fixed copying of aggregates in JS.
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tcopying.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/js/tcopying.nim b/tests/js/tcopying.nim
new file mode 100644
index 000000000..4f72d6ada
--- /dev/null
+++ b/tests/js/tcopying.nim
@@ -0,0 +1,13 @@
+discard """
+  output: '''123
+'''
+"""
+
+type MyArray = array[1, int]
+
+proc changeArray(a: var MyArray) =
+    a = [123]
+
+var a : MyArray
+changeArray(a)
+echo a[0]