summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorYuriy Glukhov <yglukhov@users.noreply.github.com>2016-01-21 22:26:50 +0200
committerYuriy Glukhov <yglukhov@users.noreply.github.com>2016-01-21 22:26:50 +0200
commit5f092520d1f7df15910664d0555bf4c7db8b90d3 (patch)
tree44f4f6129cd9c8c79f9bcc7524cdb7123c070b3f /compiler
parent1dac302975911752000e04fddb85b5302d7001b8 (diff)
downloadNim-5f092520d1f7df15910664d0555bf4c7db8b90d3.tar.gz
Revert "Fixed unicode handling in JS. Fixes #3714."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/jsgen.nim20
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index efd6e874b..c36f5a5a3 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -163,26 +163,8 @@ proc mangleName(s: PSym): Rope =
     add(result, rope(s.id))
     s.loc.r = result
 
-proc escapeJSString(s: string): string =
-  result = newStringOfCap(s.len + s.len shr 2)
-  result.add("\"")
-  for c in items(s):
-    case c
-    of '\l': result.add("\\n")
-    of '\r': result.add("\\r")
-    of '\t': result.add("\\t")
-    of '\b': result.add("\\b")
-    of '\a': result.add("\\a")
-    of '\e': result.add("\\e")
-    of '\v': result.add("\\v")
-    of '\\': result.add("\\\\")
-    of '\'': result.add("\\'")
-    of '\"': result.add("\\\"")
-    else: add(result, c)
-  result.add("\"")
-
 proc makeJSString(s: string): Rope =
-  (if s.isNil: "null".rope else: escapeJSString(s).rope)
+  (if s.isNil: "null".rope else: strutils.escape(s).rope)
 
 include jstypes