comparison src/jscomp.sml @ 736:796e42c93c48

Cookie signatures for RPCs
author Adam Chlipala <adamc@hcoop.net>
date Thu, 23 Apr 2009 16:13:02 -0400
parents 7c6b6c3c7b79
children f7e2026dd5ae
comparison
equal deleted inserted replaced
735:5ccb67665d05 736:796e42c93c48
111 | EUnurlify _ => 0 111 | EUnurlify _ => 0
112 | EJavaScript _ => 0 112 | EJavaScript _ => 0
113 | ESignalReturn e => varDepth e 113 | ESignalReturn e => varDepth e
114 | ESignalBind (e1, e2) => Int.max (varDepth e1, varDepth e2) 114 | ESignalBind (e1, e2) => Int.max (varDepth e1, varDepth e2)
115 | ESignalSource e => varDepth e 115 | ESignalSource e => varDepth e
116 | EServerCall (e, ek, _) => Int.max (varDepth e, varDepth ek) 116 | EServerCall (e, ek, _, _) => Int.max (varDepth e, varDepth ek)
117 | ERecv (e, ek, _) => Int.max (varDepth e, varDepth ek) 117 | ERecv (e, ek, _) => Int.max (varDepth e, varDepth ek)
118 | ESleep (e, ek) => Int.max (varDepth e, varDepth ek) 118 | ESleep (e, ek) => Int.max (varDepth e, varDepth ek)
119 119
120 fun closedUpto d = 120 fun closedUpto d =
121 let 121 let
154 | EUnurlify (e, _) => cu inner e 154 | EUnurlify (e, _) => cu inner e
155 | EJavaScript (_, e, _) => cu inner e 155 | EJavaScript (_, e, _) => cu inner e
156 | ESignalReturn e => cu inner e 156 | ESignalReturn e => cu inner e
157 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2 157 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2
158 | ESignalSource e => cu inner e 158 | ESignalSource e => cu inner e
159 | EServerCall (e, ek, _) => cu inner e andalso cu inner ek 159 | EServerCall (e, ek, _, _) => cu inner e andalso cu inner ek
160 | ERecv (e, ek, _) => cu inner e andalso cu inner ek 160 | ERecv (e, ek, _) => cu inner e andalso cu inner ek
161 | ESleep (e, ek) => cu inner e andalso cu inner ek 161 | ESleep (e, ek) => cu inner e andalso cu inner ek
162 in 162 in
163 cu 0 163 cu 0
164 end 164 end
954 e, 954 e,
955 str ")"], 955 str ")"],
956 st) 956 st)
957 end 957 end
958 958
959 | EServerCall (e, ek, t) => 959 | EServerCall (e, ek, t, eff) =>
960 let 960 let
961 val (e, st) = jsE inner (e, st) 961 val (e, st) = jsE inner (e, st)
962 val (ek, st) = jsE inner (ek, st) 962 val (ek, st) = jsE inner (ek, st)
963 val (unurl, st) = unurlifyExp loc (t, st) 963 val (unurl, st) = unurlifyExp loc (t, st)
964 in 964 in
965 (strcat [str ("rc(cat(\"" ^ !Monoize.urlPrefix ^ "\","), 965 (strcat [str ("rc(cat(\"" ^ !Monoize.urlPrefix ^ "\","),
966 e, 966 e,
967 str ("), function(s){var t=s.split(\"/\");var i=0;return " 967 str ("), function(s){var t=s.split(\"/\");var i=0;return "
968 ^ unurl ^ "},"), 968 ^ unurl ^ "},"),
969 ek, 969 ek,
970 str ")"], 970 str (","
971 ^ (case eff of
972 ReadCookieWrite => "true"
973 | _ => "false")
974 ^ ")")],
971 st) 975 st)
972 end 976 end
973 977
974 | ERecv (e, ek, t) => 978 | ERecv (e, ek, t) =>
975 let 979 let