summary refs log tree commit diff stats
path: root/tests/js/testobjs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/testobjs.nim')
-rw-r--r--tests/js/testobjs.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/js/testobjs.nim b/tests/js/testobjs.nim
index 78f0b4766..b61d06471 100644
--- a/tests/js/testobjs.nim
+++ b/tests/js/testobjs.nim
@@ -54,3 +54,20 @@ let test2 = test1
 
 echo toJSON(test1)
 echo toJSON(test2)
+
+block issue10005:
+  type
+    Player = ref object of RootObj
+      id*: string
+      nickname*: string
+      color*: string
+
+  proc newPlayer(nickname: string, color: string): Player =
+    let pl = Player(color: "#123", nickname: nickname)
+    return Player(
+        id: "foo",
+        nickname: nickname,
+        color: color,
+    )
+
+  doAssert newPlayer("foo", "#1232").nickname == "foo"