# HG changeset patch # User Adam Chlipala # Date 1323029921 18000 # Node ID 747f94ac5fc24c822ee3675da9d73f30df744f9d # Parent 4798ad652c9454f7fa3eb24e8224035bd0917051 Make last change nicer diff -r 4798ad652c94 -r 747f94ac5fc2 lib/js/urweb.js --- a/lib/js/urweb.js Sun Dec 04 15:13:53 2011 -0500 +++ b/lib/js/urweb.js Sun Dec 04 15:18:41 2011 -0500 @@ -969,16 +969,16 @@ 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 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;