diff src/monoize.sml @ 571:86d324061ddc

Switch to using dyn() function in JavaScript
author Adam Chlipala <adamc@hcoop.net>
date Sun, 21 Dec 2008 12:01:00 -0500
parents 162d5308e34f
children 57018f21cd5c
line wrap: on
line diff
--- a/src/monoize.sml	Sat Dec 20 18:24:12 2008 -0500
+++ b/src/monoize.sml	Sun Dec 21 12:01:00 2008 -0500
@@ -1850,20 +1850,14 @@
 
                   | "dyn" =>
                     (case #1 attrs of
-                         (*L'.ERecord [("Signal", (L'.ESignalReturn e, _), _)] => (e, fm)
-                       | L'.ERecord [("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _),
+                         (*L'.ERecord [("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _),
                                                           e), _), _)] => (e, fm) *)
 
                          L'.ERecord [("Signal", e, _)] =>
                          ((L'.EStrcat
-                               ((L'.EPrim (Prim.String "<script type=\"text/javascript\">"), loc),
-                                (L'.EStrcat ((L'.EJavaScript (L'.Script,
-                                                              (L'.ELet ("signal", (L'.TSignal
-                                                                                       (L'.TFfi ("Basis", "string"), loc),
-                                                                                   loc),
-                                                                        e,
-                                                                        (L'.EWrite (L'.ERel 0, loc), loc)), loc)), loc),
-                                             (L'.EPrim (Prim.String "</script>"), loc)), loc)), loc),
+                               ((L'.EPrim (Prim.String "<script type=\"text/javascript\">dyn("), loc),
+                                (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
+                                             (L'.EPrim (Prim.String ")</script>"), loc)), loc)), loc),
                           fm)
                        | _ => raise Fail "Monoize: Bad dyn attributes")