comparison 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
comparison
equal deleted inserted replaced
799:9330ba3a2799 800:e92cfac1608f
299 x.onkeyup = function() { sv(s, x.value) }; 299 x.onkeyup = function() { sv(s, x.value) };
300 300
301 return x; 301 return x;
302 } 302 }
303 303
304 function addOnChange(x, f) {
305 var old = x.onchange;
306 x.onchange = function() { old(); f (); };
307 }
308
304 309
305 // Basic string operations 310 // Basic string operations
306 311
307 function eh(x) { 312 function eh(x) {
308 return x.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;"); 313 if (x == null)
314 return "NULL";
315 else
316 return x.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
309 } 317 }
310 318
311 function ts(x) { return x.toString() } 319 function ts(x) { return x.toString() }
312 function bs(b) { return (b ? "True" : "False") } 320 function bs(b) { return (b ? "True" : "False") }
313 321