summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index c7577d0c..9cefc60f 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -110,6 +110,7 @@ fun varDepth (e, _) =
| ESignalSource e => varDepth e
| EServerCall (e, ek, _) => Int.max (varDepth e, varDepth ek)
| ERecv (e, ek, _) => Int.max (varDepth e, varDepth ek)
+ | ESleep (e, ek) => Int.max (varDepth e, varDepth ek)
fun closedUpto d =
let
@@ -152,6 +153,7 @@ fun closedUpto d =
| ESignalSource e => cu inner e
| EServerCall (e, ek, _) => cu inner e andalso cu inner ek
| ERecv (e, ek, _) => cu inner e andalso cu inner ek
+ | ESleep (e, ek) => cu inner e andalso cu inner ek
in
cu 0
end
@@ -973,6 +975,19 @@ fun process file =
str ")"],
st)
end
+
+ | ESleep (e, ek) =>
+ let
+ val (e, st) = jsE inner (e, st)
+ val (ek, st) = jsE inner (ek, st)
+ in
+ (strcat [str "window.setTimeout(",
+ ek,
+ str ", ",
+ e,
+ str ")"],
+ st)
+ end
end
in
jsE