diff lib/js/urweb.js @ 1979:81bc76aa4acd

Merge in upstream changes.
author Patrick Hurst <phurst@mit.edu>
date Sat, 18 Jan 2014 18:26:24 -0500
parents a671e5258a2c
children 334b5cbff198 b2254554542f
line wrap: on
line diff
--- a/lib/js/urweb.js	Mon Dec 09 20:41:24 2013 -0500
+++ b/lib/js/urweb.js	Sat Jan 18 18:26:24 2014 -0500
@@ -35,10 +35,11 @@
 function isBlank(c) { return c == ' ' || c == '\t'; }
 function isSpace(c) { return isBlank(c) || c == '\r' || c == '\n'; }
 function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); }
+function ord(c) { return c.charCodeAt(0); }
+function isPrint(c) { return ord(c) > 31 && ord(c) < 127; }
 function toLower(c) { return c.toLowerCase(); }
 function toUpper(c) { return c.toUpperCase(); }
 
-
 // Lists
 
 function cons(v, ls) {
@@ -1574,7 +1575,7 @@
         er("May not 'recv' in main thread of 'code' for <active>");
 
     if (chn == null)
-        return;
+        er("Client-side code tried to recv() from a channel belonging to a different page view.");
 
     if (chn < 0)
         whine("Out-of-bounds channel receive");