Mercurial > urweb
diff lib/js/urweb.js @ 800:e92cfac1608f
Proper lifting of MonoEnv stored expressions; avoidance of onchange clobbering
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 14 May 2009 13:18:31 -0400 |
parents | 83875a9eb9b8 |
children | c1f8963ebb18 |
line wrap: on
line diff
--- a/lib/js/urweb.js Thu May 14 11:04:56 2009 -0400 +++ b/lib/js/urweb.js Thu May 14 13:18:31 2009 -0400 @@ -301,11 +301,19 @@ return x; } +function addOnChange(x, f) { + var old = x.onchange; + x.onchange = function() { old(); f (); }; +} + // Basic string operations function eh(x) { - return x.split("&").join("&").split("<").join("<").split(">").join(">"); + if (x == null) + return "NULL"; + else + return x.split("&").join("&").split("<").join("<").split(">").join(">"); } function ts(x) { return x.toString() }