# HG changeset patch # User Adam Chlipala # Date 1343218815 14400 # Node ID 4671afac15af535baf1cacf4ee26f7bba6ddb977 # Parent 446e73902b09a34bf2f2c14cbf6420890f4df4b8 Change 'spawn' implementation to allow blocking within diff -r 446e73902b09 -r 4671afac15af lib/js/urweb.js --- 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 "); + er("May not 'rpc' in main thread of 'code' for "); 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 "); + er("May not 'recv' in main thread of 'code' for "); if (chn == null) return; @@ -1508,13 +1508,13 @@ function sl(ms, k) { if (!maySuspend) - er("May not 'sleep' in 'code' for "); + er("May not 'sleep' in main thread of 'code' for "); window.setTimeout(function() { k(null); }, ms); } function sp(e) { - execF(e, null); + window.setTimeout(function() { execF(e); }, 0); } diff -r 446e73902b09 -r 4671afac15af tests/activeBlock.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/activeBlock.ur Wed Jul 25 08:20:15 2012 -0400 @@ -0,0 +1,10 @@ +fun main () : transaction page = return + + +