Mercurial > urweb
comparison lib/js/urweb.js @ 2097:9272476e2a1c
Client-side conversion of string to bool
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 25 Dec 2014 18:32:27 -0500 |
parents | f05fcb206571 |
children | 9e9c915f554c |
comparison
equal
deleted
inserted
replaced
2096:6b7749da1ddc | 2097:9272476e2a1c |
---|---|
1259 return x.split("&").join("&").split("<").join("<").split(">").join(">"); | 1259 return x.split("&").join("&").split("<").join("<").split(">").join(">"); |
1260 } | 1260 } |
1261 | 1261 |
1262 function ts(x) { return x.toString() } | 1262 function ts(x) { return x.toString() } |
1263 function bs(b) { return (b ? "True" : "False") } | 1263 function bs(b) { return (b ? "True" : "False") } |
1264 function s2b(s) { return s == "True" ? true : s == "False" ? false : null; } | |
1265 function s2be(s) { return s == "True" ? true : s == "False" ? false : er("Illegal Boolean " ^ s); } | |
1264 | 1266 |
1265 function id(x) { return x; } | 1267 function id(x) { return x; } |
1266 function sub(s, i) { return s.charAt(i); } | 1268 function sub(s, i) { return s.charAt(i); } |
1267 function suf(s, i) { return s.substring(i); } | 1269 function suf(s, i) { return s.substring(i); } |
1268 function slen(s) { return s.length; } | 1270 function slen(s) { return s.length; } |