Merge pull request #3753 from yglukhov/js-streams
Dont convert string to cstring when writing to stream.
This commit is contained in:
commit
b2854f21d6
1 changed files with 4 additions and 1 deletions
|
|
@ -148,7 +148,10 @@ proc write*[T](s: Stream, x: T) =
|
||||||
proc write*(s: Stream, x: string) =
|
proc write*(s: Stream, x: string) =
|
||||||
## writes the string `x` to the the stream `s`. No length field or
|
## writes the string `x` to the the stream `s`. No length field or
|
||||||
## terminating zero is written.
|
## terminating zero is written.
|
||||||
writeData(s, cstring(x), x.len)
|
when nimvm:
|
||||||
|
writeData(s, cstring(x), x.len)
|
||||||
|
else:
|
||||||
|
if x.len > 0: writeData(s, unsafeAddr x[0], x.len)
|
||||||
|
|
||||||
proc writeLn*(s: Stream, args: varargs[string, `$`]) {.deprecated.} =
|
proc writeLn*(s: Stream, args: varargs[string, `$`]) {.deprecated.} =
|
||||||
## **Deprecated since version 0.11.4:** Use **writeLine** instead.
|
## **Deprecated since version 0.11.4:** Use **writeLine** instead.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue