summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 12:40:09 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 12:40:09 -0400
commitbe0640bc316566b33dc4a0784aa7c1877c867e55 (patch)
tree881b970859757ebd3e49447af14a5ea7348461c7
parent0f7b6944108ad94e899c41033eef15917ed1065c (diff)
Less whining about match failures; fix singleton record Jscomp bug
-rw-r--r--lib/js/urweb.js5
-rw-r--r--src/jscomp.sml2
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 0cc66bc7..581ee4d7 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -31,7 +31,7 @@ function whine(msg) {
}
function pf(loc) {
- whine("Pattern match failure (" + loc + ")");
+ throw ("Pattern match failure (" + loc + ")");
}
function runHandlers(kind, ls, arg) {
@@ -318,8 +318,11 @@ function sel(s, content) {
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;
}
diff --git a/src/jscomp.sml b/src/jscomp.sml
index f197ce13..91ac0acb 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -852,7 +852,7 @@ fun process file =
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