mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
make JS tests green again
This commit is contained in:
@@ -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.} =
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user