# HG changeset patch # User Adam Chlipala # Date 1294341942 18000 # Node ID 449a12b82db71f00a15b7c6f874347d35618782b # Parent 86d23010ea748b6cf1c94887c34502de226891ae Client-side redirects diff -r 86d23010ea74 -r 449a12b82db7 lib/js/urweb.js --- a/lib/js/urweb.js Thu Jan 06 12:49:14 2011 -0500 +++ b/lib/js/urweb.js Thu Jan 06 14:25:42 2011 -0500 @@ -715,6 +715,10 @@ return parse(s); } +function redirect(s) { + window.location = s; +} + function rc(prefix, uri, parse, k, needsSig) { uri = cat(prefix, uri); uri = flattenLocal(uri); diff -r 86d23010ea74 -r 449a12b82db7 src/jscomp.sml --- a/src/jscomp.sml Thu Jan 06 12:49:14 2011 -0500 +++ b/src/jscomp.sml Thu Jan 06 14:25:42 2011 -0500 @@ -875,7 +875,17 @@ | ENextval _ => unsupported "Nextval" | ESetval _ => unsupported "Nextval" | EReturnBlob _ => unsupported "EReturnBlob" - | ERedirect _ => unsupported "ERedirect" + + | ERedirect (e, _) => + let + val (e, st) = jsE inner (e, st) + in + (strcat [str "{c:\"f\",f:\"redirect\",a:cons(", + e, + str ",null)}"], + st) + end + | EUnurlify (_, _, true) => unsupported "EUnurlify" | EUnurlify (e, t, false) =>