summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-17 01:43:22 +0100
committerAraq <rumpf_a@web.de>2014-12-17 01:43:22 +0100
commit02cc9633ebe23d2b9c99254fad8b6c6abcb05e1e (patch)
treea52026a9485e621ae0d85baf3cd9cc0c2f670d95 /lib
parente9619d727894637ba4ef2d84473c5a06a17a8fee (diff)
downloadNim-02cc9633ebe23d2b9c99254fad8b6c6abcb05e1e.tar.gz
fixes #1730
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/subexes.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/subexes.nim b/lib/pure/subexes.nim
index c87823926..adcfdd288 100644
--- a/lib/pure/subexes.nim
+++ b/lib/pure/subexes.nim
@@ -38,7 +38,11 @@ proc raiseInvalidFormat(msg: string) {.noinline.} =
 
 type
   TFormatParser = object {.pure, final.}
-    f: cstring
+    when defined(js):
+      f: string # we rely on the '\0' terminator
+                # which JS's native string doesn't have
+    else:
+      f: cstring
     num, i, lineLen: int
 
 template call(x: stmt) {.immediate.} =