changeset 835:b0a85cbefed2

Less whining about match failures; fix singleton record Jscomp bug
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 12:40:09 -0400
parents 74e9e7642f08
children 4083d0dff94c
files lib/js/urweb.js src/jscomp.sml
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Jun 02 11:50:53 2009 -0400
+++ b/lib/js/urweb.js	Tue Jun 02 12:40:09 2009 -0400
@@ -31,7 +31,7 @@
 }
 
 function pf(loc) {
-  whine("Pattern match failure (" + loc + ")");
+  throw ("Pattern match failure (" + loc + ")");
 }
 
 function runHandlers(kind, ls, arg) {
@@ -318,8 +318,11 @@
   var x = input("select", s, function(x) { return function(v) { if (x.value != v) x.value = v; }; });
   x.innerHTML = content;
   x.value = s.data;
+  if (x.value != s.data)
+    sv(s, x.value);
   x.onchange = function() { sv(s, x.value) };
 
+
   return x;
 }
 
--- a/src/jscomp.sml	Tue Jun 02 11:50:53 2009 -0400
+++ b/src/jscomp.sml	Tue Jun 02 12:40:09 2009 -0400
@@ -852,7 +852,7 @@
                             let
                                 val (e, st) = jsE inner (e, st)
                             in
-                                (strcat [str "{_x:", e, str "}"], st)
+                                (strcat [str ("{_" ^ x ^ ":"), e, str "}"], st)
                             end
                           | ERecord ((x, e, _) :: xes) =>
                             let