summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-11-28 14:01:17 -0800
committerAndreas Rumpf <rumpf_a@web.de>2019-11-28 23:01:17 +0100
commit9ea55eccbbc61c6e7429c094b6ced41ce5535aeb (patch)
tree6501d1808e349caa475d6432df1ea081d0fc61b2 /lib
parent0996eb174fdafc2980d21149dae5b5a7c5889dff (diff)
downloadNim-9ea55eccbbc61c6e7429c094b6ced41ce5535aeb.tar.gz
make addQuoted work on nimscript (#12717) [backport]
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 30277f629..b2325c599 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3827,11 +3827,6 @@ 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"
@@ -3842,6 +3837,12 @@ elif defined(JS):
       if x < y: return -1
       return 1
 
+when defined(JS) or defined(nimscript):
+  proc addInt*(result: var string; x: int64) =
+    result.add $x
+
+  proc addFloat*(result: var string; x: float) =
+    result.add $x
 
 proc quit*(errormsg: string, errorcode = QuitFailure) {.noreturn.} =
   ## A shorthand for ``echo(errormsg); quit(errorcode)``.