diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-12-25 18:32:27 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-12-25 18:32:27 -0500 |
commit | 0562a6b4d4c94d571abfcd407c98ed259a99bd7e (patch) | |
tree | a068344107f7d2283ce7c3aabe8469baacc2f930 /lib | |
parent | 80e5288d76eaf9fa4ac264e34fd1299d8e4c0642 (diff) |
Client-side conversion of string to bool
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 2 |
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); } |