summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-04-16 10:55:48 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2013-04-16 10:55:48 -0400
commita2386e85bac4e7da8fa1f29a676941b592d35a5d (patch)
tree2dba7c473ff3a8063145c3cd8506ac9013faa904 /src/jscomp.sml
parent831f3ff6a5ea8fe1e727be1d9f63a2e823072457 (diff)
Basis.tryRpc
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 887fbc87..e0d87a8e 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -1,4 +1,4 @@
-(* Copyright (c) 2008-2012, Adam Chlipala
+(* Copyright (c) 2008-2013, Adam Chlipala
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -930,10 +930,21 @@ fun process (file : file) =
st)
end
- | EServerCall (e, t, eff) =>
+ | EServerCall (e, t, eff, fm) =>
let
val (e, st) = jsE inner (e, st)
val (unurl, st) = unurlifyExp loc (t, st)
+ val lastArg = case fm of
+ None => "null"
+ | Error =>
+ let
+ val isN = if isNullable t then
+ "true"
+ else
+ "false"
+ in
+ "cons({c:\"c\",v:" ^ isN ^ "},null)"
+ end
in
(strcat [str ("{c:\"f\",f:rc,a:cons({c:\"c\",v:\""
^ Settings.getUrlPrefix ()
@@ -944,7 +955,7 @@ fun process (file : file) =
^ (case eff of
ReadCookieWrite => "true"
| _ => "false")
- ^ "},null)))))}")],
+ ^ "}," ^ lastArg ^ ")))))}")],
st)
end
@@ -1231,11 +1242,11 @@ fun process (file : file) =
((ESignalSource e, loc), st)
end
- | EServerCall (e1, t, ef) =>
+ | EServerCall (e1, t, ef, fm) =>
let
val (e1, st) = exp outer (e1, st)
in
- ((EServerCall (e1, t, ef), loc), st)
+ ((EServerCall (e1, t, ef, fm), loc), st)
end
| ERecv (e1, t) =>
let