summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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.} =