diff options
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 6315567e..59708150 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -376,15 +376,19 @@ function runHandlers(kind, ls, arg) { alert(kind + ": " + arg); for (; ls; ls = ls.next) try { - exec({c:"a", f:{c:"a", f:{c:"c", v:ls.data}, x:{c:"c", v:arg}}, x:{c:"c", v:null}}); + exec({c:"a", f:{c:"a", f:ls.data, x:{c:"c", v:arg}}, x:{c:"c", v:null}}); } catch (v) { } } } var errorHandlers = null; +function flift0(v) { + return {c:"c", v:v}; +} + function onError(f) { - errorHandlers = cons(f, errorHandlers); + errorHandlers = cons(flift0(f), errorHandlers); } function er(s) { @@ -395,7 +399,7 @@ function er(s) { var failHandlers = null; function onFail(f) { - failHandlers = cons(f, failHandlers); + failHandlers = cons(flift0(f), failHandlers); } function doExn(v) { @@ -434,7 +438,7 @@ function conn() { var serverHandlers = null; function onServerError(f) { - serverHandlers = cons(f, serverHandlers); + serverHandlers = cons(flift0(f), serverHandlers); } function servErr(s) { |