diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-10-25 15:29:21 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-10-25 15:29:21 -0400 |
commit | 2385b6b946eb1215d75a3dddccb05aaf8f605ba3 (patch) | |
tree | e7763596f996cbc602dfbefff837b20da643bbba /lib/js | |
parent | 5a88b41a6655f601c989ae94ce1fc8bb391ca630 (diff) |
Use call/cc for recv and sleep
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 6ca4becd..62f94f52 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -779,10 +779,10 @@ function rv(chn, parse, k) { var msg = dequeue(ch.msgs); if (msg == null) { - enqueue(ch.listeners, function(msg) { execF(execF(k, parse(msg)), null); }); + enqueue(ch.listeners, function(msg) { k(parse(msg)); }); } else { try { - execF(execF(k, parse(msg)), null); + k(parse(msg)); } catch (v) { doExn(v); } @@ -790,7 +790,11 @@ function rv(chn, parse, k) { } function sl(ms, k) { - window.setTimeout(function() { execF(k, null); }, ms); + window.setTimeout(function() { k(null); }, ms); +} + +function sp(e) { + execF(e, null); } |