diff src/jscomp.sml @ 911:12c77dc567a2

Fix list jsification bug; grid1 working with foreign key, but booleans not getting into database properly
author Adam Chlipala <adamc@hcoop.net>
date Tue, 25 Aug 2009 14:50:19 -0400
parents 8e540df3294d
children 771449d8b411
line wrap: on
line diff
--- a/src/jscomp.sml	Tue Aug 25 13:57:56 2009 -0400
+++ b/src/jscomp.sml	Tue Aug 25 14:50:19 2009 -0400
@@ -301,12 +301,18 @@
                                             [((PNone rt, loc),
                                               str loc "null"),
                                              ((PSome (rt, (PVar ("x", rt), loc)), loc),
-                                              strcat loc [str loc "{v:{_1:",
+                                              strcat loc [str loc ((if isNullable t' then
+                                                                        "{v:"
+                                                                    else
+                                                                        "") ^ "{_1:"),
                                                           e',
                                                           str loc ",_2:",
                                                           (EApp ((ENamed n', loc),
                                                                  (EField ((ERel 0, loc), "2"), loc)), loc),
-                                                          str loc "}}"])],
+                                                          str loc ((if isNullable t' then
+                                                                        "}"
+                                                                    else
+                                                                        "") ^ "}")])],
                                             {disc = t, result = s}), loc)
                          val body = (EAbs ("x", t, s, body), loc)