diff src/mono_opt.sml @ 566:a152905c3c3b

Displayed an alert dialog
author Adam Chlipala <adamc@hcoop.net>
date Fri, 19 Dec 2008 12:38:11 -0500
parents 65d8541c130b
children 1901db85acb4
line wrap: on
line diff
--- a/src/mono_opt.sml	Fri Dec 19 11:47:18 2008 -0500
+++ b/src/mono_opt.sml	Fri Dec 19 12:38:11 2008 -0500
@@ -360,6 +360,11 @@
       | EWrite (EPrim (Prim.String ""), loc) =>
         ERecord []
 
+      | EJavaScript (EAbs (_, (TRecord [], _), _, (EFfiApp ("Basis", "alert", [s]), _)), loc) =>
+        EStrcat ((EPrim (Prim.String "alert("), loc),
+                 (EStrcat ((EFfiApp ("Basis", "jsifyString", [s]), loc),
+                           (EPrim (Prim.String ")"), loc)), loc))
+
       | _ => e
 
 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)