diff options
author | Adam Chlipala <adam@chlipala.net> | 2013-11-14 06:36:36 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2013-11-14 06:36:36 -0500 |
commit | 4259d248050c93180767c076469431f11b8fe984 (patch) | |
tree | 760611b99895723420f6d5bafd7afbd8dfde536e /lib/js | |
parent | aa795d0463d0ef25c5fefbabb2013d2276c01327 (diff) |
Fix more of client-side error handlers
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) { |