summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-09-07 01:54:59 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-09-07 01:54:59 +0200
commitaf1e84f54da32b5e8e917edc533c6efa6846acc2 (patch)
tree7f5a361e855356ae0a4900a1e17b78956436c648 /lib
parentc033ff990acceac6d2095242fa17501e98555973 (diff)
downloadNim-af1e84f54da32b5e8e917edc533c6efa6846acc2.tar.gz
Automatic deref for everything but pointers in asm/emit (#8891)
Fixes #7249
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 3a18a715c..a7e215168 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2741,12 +2741,12 @@ type
 when defined(JS):
   proc add*(x: var string, y: cstring) {.asmNoStackFrame.} =
     asm """
-      var len = `x`[0].length-1;
+      var len = `x`.length-1;
       for (var i = 0; i < `y`.length; ++i) {
-        `x`[0][len] = `y`.charCodeAt(i);
+        `x`[len] = `y`.charCodeAt(i);
         ++len;
       }
-      `x`[0][len] = 0
+      `x`[len] = 0
     """
   proc add*(x: var cstring, y: cstring) {.magic: "AppendStrStr".}