diff src/jscomp.sml @ 1360:02fc16faecf3

[De]serialization of times in JavaScript; proper integer division in JavaScript; Basis.crypt; Top.mkRead'; more aggressive Mono-level inlining, for values of function-y types
author Adam Chlipala <adam@chlipala.net>
date Thu, 23 Dec 2010 17:46:40 -0500
parents 0d8bd8ae8417
children 449a12b82db7
line wrap: on
line diff
--- a/src/jscomp.sml	Thu Dec 23 11:23:31 2010 -0500
+++ b/src/jscomp.sml	Thu Dec 23 17:46:40 2010 -0500
@@ -126,6 +126,7 @@
               | TFfi ("Basis", "int") => ((EFfiApp ("Basis", "htmlifyInt", [e]), loc), st)
               | TFfi ("Basis", "float") => ((EFfiApp ("Basis", "htmlifyFloat", [e]), loc), st)
               | TFfi ("Basis", "channel") => ((EFfiApp ("Basis", "jsifyChannel", [e]), loc), st)
+              | TFfi ("Basis", "time") => ((EFfiApp ("Basis", "jsifyTime", [e]), loc), st)
 
               | TFfi ("Basis", "bool") => ((ECase (e,
                                                    [((PCon (Enum, PConFfi {mod = "Basis",
@@ -701,7 +702,7 @@
                                          str ",null)}"],
                                  st)
                             end
-                          | EBinop (s, e1, e2) =>
+                          | EBinop (bi, s, e1, e2) =>
                             let
                                 val name = case s of
                                                "==" => "eq"
@@ -709,8 +710,8 @@
                                              | "+" => "plus"
                                              | "-" => "minus"
                                              | "*" => "times"
-                                             | "/" => "div"
-                                             | "%" => "mod"
+                                             | "/" => (case bi of Int => "divInt" | NotInt => "div")
+                                             | "%" => (case bi of Int => "modInt" | NotInt => "mod")
                                              | "<" => "lt"
                                              | "<=" => "le"
                                              | "strcmp" => "strcmp"
@@ -1039,12 +1040,12 @@
                  in
                      ((EUnop (s, e), loc), st)
                  end
-               | EBinop (s, e1, e2) =>
+               | EBinop (bi, s, e1, e2) =>
                  let
                      val (e1, st) = exp outer (e1, st)
                      val (e2, st) = exp outer (e2, st)
                  in
-                     ((EBinop (s, e1, e2), loc), st)
+                     ((EBinop (bi, s, e1, e2), loc), st)
                  end
                  
                | ERecord xets =>