summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-04-14 00:54:15 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-04-14 00:54:15 +0200
commit6ae9341d482c8658e6451fe9fa133dae269ac204 (patch)
tree5866bd4677b5686e0a02d298225e8e4538bb5a0e
parent50d4224d412ba9e84355a237379f6cf55bd1db0e (diff)
downloadNim-6ae9341d482c8658e6451fe9fa133dae269ac204.tar.gz
make JS tests green again
-rw-r--r--lib/system/reprjs.nim8
-rw-r--r--tests/js/trepr.nim2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/system/reprjs.nim b/lib/system/reprjs.nim
index 304ce4310..d04d6e12b 100644
--- a/lib/system/reprjs.nim
+++ b/lib/system/reprjs.nim
@@ -55,11 +55,11 @@ proc reprStrAux(result: var string, s: cstring, len: int) =
     case c
     of '"': add(result, "\\\"")
     of '\\': add(result, "\\\\")
-    of '\10': add(result, "\\10\"\n\"")
-    of '\127'..'\255', '\0'..'\9', '\11'..'\31':
-      add( result, "\\" & reprInt(ord(c)) )
+    #of '\10': add(result, "\\10\"\n\"")
+    of '\127'..'\255', '\0'..'\31':
+      add(result, "\\" & reprInt(ord(c)))
     else:
-      add( result, reprInt(ord(c)) ) # Not sure about this.
+      add(result, c)
   add(result, "\"")
 
 proc reprStr(s: string): string {.compilerRtl.} =
diff --git a/tests/js/trepr.nim b/tests/js/trepr.nim
index 3f07e6793..366d247c5 100644
--- a/tests/js/trepr.nim
+++ b/tests/js/trepr.nim
@@ -103,7 +103,7 @@ block strings:
   when defined js: # C prepends the pointer, JS does not.
     doAssert(repr(a) == "\"12345\"")
     doAssert(repr(b) == "\"hello,repr\"")
-    doAssert(repr(c) == "\"hi\nthere\"")
+    doAssert(repr(c) == "\"hi\\10there\"")
 
 block sets:
   let