diff src/jscomp.sml @ 1422:07ef5771568d

Notice that Basis.now is effectful; smarter JavaScript encoding of initial source values built using server-side expressions that can't be turned into JavaScript
author Adam Chlipala <adam@chlipala.net>
date Tue, 08 Feb 2011 16:54:01 -0500
parents 82b204f20026
children 66092ce45a76
line wrap: on
line diff
--- a/src/jscomp.sml	Thu Feb 03 21:04:12 2011 -0500
+++ b/src/jscomp.sml	Tue Feb 08 16:54:01 2011 -0500
@@ -1186,6 +1186,18 @@
                      ((EUnurlify (e, t, b), loc), st)
                  end
 
+               | EJavaScript (m as Source t, e') =>
+                 (foundJavaScript := true;
+                  let
+                      val (x', st) = jsExp m (t :: outer) ((ERel 0, loc), st)
+                  in
+                      ((ELet ("x", t, e', x'), loc), st)
+                  end
+                  handle CantEmbed t => ((*ErrorMsg.errorAt loc "Unable to embed type in JavaScript";
+                                         Print.preface ("Type",
+                                                        MonoPrint.p_typ MonoEnv.empty t);*)
+                                         (e, st)))
+
                | EJavaScript (m, e') =>
                  (foundJavaScript := true;
                   jsExp m outer (e', st)