summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-10-28 10:06:16 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-10-28 10:06:16 +0100
commit5ed99f8d3fc67d6f02172ab9cbcc67c17eeee5c9 (patch)
treeb08965de5c7eff8da9df97e8a2e009cff3fae5de /lib/system.nim
parenta2ad7d4883a450d66d1657c3550dc91f66b8b187 (diff)
downloadNim-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.nim10
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)