summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jscomp.sml7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 7610b6d2..4b04194c 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -564,9 +564,12 @@ fun process file =
val old = e
val (e, st) = jsExp mode [] (e, st)
val e = deStrcat 0 e
+ val e = String.translate (fn #"'" => "\\'"
+ | #"\\" => "\\\\"
+ | ch => String.str ch) e
- val sc = "urfuncs[" ^ Int.toString n ^ "] = {c:\"t\",f:function(){return "
- ^ e ^ "}};\n"
+ val sc = "urfuncs[" ^ Int.toString n ^ "] = {c:\"t\",f:'"
+ ^ e ^ "'};\n"
in
(*Print.prefaces "jsify'" [("old", MonoPrint.p_exp MonoEnv.empty old),
("new", MonoPrint.p_exp MonoEnv.empty new)];*)