From 6ae9341d482c8658e6451fe9fa133dae269ac204 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 14 Apr 2018 00:54:15 +0200 Subject: [PATCH] make JS tests green again --- lib/system/reprjs.nim | 8 ++++---- tests/js/trepr.nim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/system/reprjs.nim b/lib/system/reprjs.nim index 304ce43107..d04d6e12b1 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 3f07e67932..366d247c52 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