diff src/jscomp.sml @ 603:b1064de2b1f9

dlist example working
author Adam Chlipala <adamc@hcoop.net>
date Fri, 16 Jan 2009 15:49:10 -0500
parents 7c3c21eb5b4c
children 330a7de47914
line wrap: on
line diff
--- a/src/jscomp.sml	Tue Jan 13 15:23:48 2009 -0500
+++ b/src/jscomp.sml	Fri Jan 16 15:49:10 2009 -0500
@@ -486,7 +486,6 @@
                                                           maxName = #maxName st}
 
                                                 val (e, st) = jsExp mode skip [] 0 (e, st)
-                                                val () = Print.prefaces "Pre-e" [("e", MonoPrint.p_exp MonoEnv.empty e)]
                                                 val e = deStrcat 0 e
                                                 
                                                 val sc = "_n" ^ Int.toString n ^ "=" ^ e ^ ";\n"
@@ -759,7 +758,11 @@
                             end
 
                           | EJavaScript (Source _, _, SOME _) => (e, st)
-                          | EJavaScript (_, _, SOME e) => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st)
+                          | EJavaScript (_, _, SOME e) =>
+                            (strcat [str "\"cr(\"+ca(function(){return ",
+                                     e,
+                                     str "})+\")\""],
+                             st)
 
                           | EClosure _ => unsupported "EClosure"
                           | EQuery _ => unsupported "Query"
@@ -770,7 +773,10 @@
                             let
                                 val (e, st) = jsE inner (e, st)
                             in
-                                ((EFfiApp ("Basis", "jsifyString", [e]), loc), st)
+                                (strcat [str "\"cr(\"+ca(function(){return ",
+                                         e,
+                                         str "})+\")\""],
+                                 st)
                             end
 
                           | ESignalReturn e =>