diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-12-04 15:18:41 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-12-04 15:18:41 -0500 |
commit | d46a56f2281e5f992484df00debe8b8f97097e31 (patch) | |
tree | 218b81154a08e23035017e39e4c8e7c8c8ed8d47 /lib/js | |
parent | 70e17f78838ac1ebdeae9eca750eb52f14c27589 (diff) |
Make last change nicer
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index a10c107f..4fee886a 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -969,16 +969,16 @@ function trimZeroes(s) { return s; } - if (s == "0") + if (s.length == 0) return s; else - return {}; + return "0"; } function pi(s) { - s = trimZeroes(s); - var r = parseInt(s); - if (r.toString() == s) + var st = trimZeroes(s); + var r = parseInt(st); + if (r.toString() == st) return r; else er("Can't parse int: " + s); @@ -993,9 +993,9 @@ function pfl(s) { } function pio(s) { - s = trimZeroes(s); - var r = parseInt(s); - if (r.toString() == s) + var st = trimZeroes(s); + var r = parseInt(st); + if (r.toString() == st) return r; else return null; |