aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-12-25 18:32:27 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-12-25 18:32:27 -0500
commit0562a6b4d4c94d571abfcd407c98ed259a99bd7e (patch)
treea068344107f7d2283ce7c3aabe8469baacc2f930 /lib/js
parent80e5288d76eaf9fa4ac264e34fd1299d8e4c0642 (diff)
Client-side conversion of string to bool
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 342dc943..df9097b1 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1261,6 +1261,8 @@ function eh(x) {
function ts(x) { return x.toString() }
function bs(b) { return (b ? "True" : "False") }
+function s2b(s) { return s == "True" ? true : s == "False" ? false : null; }
+function s2be(s) { return s == "True" ? true : s == "False" ? false : er("Illegal Boolean " ^ s); }
function id(x) { return x; }
function sub(s, i) { return s.charAt(i); }