diff options
author | Patrick Hurst <phurst@mit.edu> | 2014-01-18 18:26:24 -0500 |
---|---|---|
committer | Patrick Hurst <phurst@mit.edu> | 2014-01-18 18:26:24 -0500 |
commit | 4caa5f98146d40715a96aeab6c4ff65e7a0f38b6 (patch) | |
tree | 96e059e285d059c3c9373fdb081041a72121d767 /lib | |
parent | 1ce3acd70b3527add32015267cc916e920661dbb (diff) | |
parent | 6787b686afe5fd3e65b3d377d4c363b4cd086dad (diff) |
Merge in upstream changes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 5 | ||||
-rw-r--r-- | lib/ur/basis.urs | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 59708150..6830945a 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -35,10 +35,11 @@ function isAlnum(c) { return isAlpha(c) || isDigit(c); } 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 @@ function rv(chn, parse, k) { 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"); diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 36d2effa..c94f2ba6 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -785,6 +785,7 @@ val redirect : t ::: Type -> url -> transaction t type id val fresh : transaction id val giveFocus : id -> transaction unit +val show_id : show id val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] => unit -> tag [Signal = signal (xml ([Dyn] ++ ctx) use bind)] ([Dyn] ++ ctx) [] use bind @@ -792,6 +793,9 @@ val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> [ctx ~ [Dyn]] = val active : unit -> tag [Code = transaction xbody] body [] [] [] +val script : unit + -> tag [Code = transaction unit] head [] [] [] + val head : unit -> tag [] html head [] [] val title : unit -> tag [] head [] [] [] val link : unit -> tag [Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] |