diff lib/js/urweb.js @ 1631:747f94ac5fc2

Make last change nicer
author Adam Chlipala <adam@chlipala.net>
date Sun, 04 Dec 2011 15:18:41 -0500
parents 4798ad652c94
children 4682b312e9d5
line wrap: on
line diff
--- 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;