diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-04 15:56:47 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-04 15:56:47 -0400 |
commit | cd768be8105e43b8c8d0cf1578528a02f5341a95 (patch) | |
tree | 3464b0dbe1197e509f51d5f6181dda2804344e26 /src/jscomp.sml | |
parent | ca7196c5dd362ccc6f19aaafef5b4252522e96a2 (diff) |
sleep and better Scriptcheck
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r-- | src/jscomp.sml | 15 |
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 |