diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-10-28 10:06:16 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-10-28 10:06:16 +0100 |
commit | 5ed99f8d3fc67d6f02172ab9cbcc67c17eeee5c9 (patch) | |
tree | b08965de5c7eff8da9df97e8a2e009cff3fae5de /lib/system.nim | |
parent | a2ad7d4883a450d66d1657c3550dc91f66b8b187 (diff) | |
download | Nim-5ed99f8d3fc67d6f02172ab9cbcc67c17eeee5c9.tar.gz |
Extent json.to testing to VM, add workrounds for VM bugs. (#12493)
fixes #12479
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 93e4534fb..663ac1f66 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -3872,6 +3872,12 @@ elif defined(JS): proc deallocShared(p: pointer) = discard proc reallocShared(p: pointer, newsize: Natural): pointer = discard + proc addInt*(result: var string; x: int64) = + result.add $x + + proc addFloat*(result: var string; x: float) = + result.add $x + when defined(JS) and not defined(nimscript): include "system/jssys" include "system/reprjs" @@ -4326,9 +4332,9 @@ proc addQuoted*[T](s: var string, x: T) = s.addEscapedChar(x) s.add("'") # prevent temporary string allocation - elif T is SomeSignedInt and not defined(JS): + elif T is SomeSignedInt: s.addInt(x) - elif T is SomeFloat and not defined(JS): + elif T is SomeFloat: s.addFloat(x) elif compiles(s.add(x)): s.add(x) |