diff lib/js/urweb.js @ 1794:4671afac15af

Change 'spawn' implementation to allow blocking within <active code>
author Adam Chlipala <adam@chlipala.net>
date Wed, 25 Jul 2012 08:20:15 -0400
parents 446e73902b09
children 10a2cb93d175
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Jul 24 19:49:50 2012 -0400
+++ b/lib/js/urweb.js	Wed Jul 25 08:20:15 2012 -0400
@@ -1297,7 +1297,7 @@
 
 function rc(prefix, uri, parse, k, needsSig) {
     if (!maySuspend)
-        er("May not 'rpc' in 'code' for <active>");
+        er("May not 'rpc' in main thread of 'code' for <active>");
 
     uri = cat(prefix, uri);
     uri = flattenLocal(uri);
@@ -1478,7 +1478,7 @@
 
 function rv(chn, parse, k) {
     if (!maySuspend)
-        er("May not 'recv' in 'code' for <active>");
+        er("May not 'recv' in main thread of 'code' for <active>");
 
     if (chn == null)
         return;
@@ -1508,13 +1508,13 @@
 
 function sl(ms, k) {
     if (!maySuspend)
-        er("May not 'sleep' in 'code' for <active>");
+        er("May not 'sleep' in main thread of 'code' for <active>");
 
     window.setTimeout(function() { k(null); }, ms);
 }
 
 function sp(e) {
-    execF(e, null);
+    window.setTimeout(function() { execF(e); }, 0);
 }