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 | 9dff0264c018117f3356f409bc42fea3bb6b57d5 (patch) | |
tree | 760611b99895723420f6d5bafd7afbd8dfde536e /lib | |
parent | df47cd4555a0f537486120e4b3c73c0a3620fa4e (diff) |
Fix more of client-side error handlers
Diffstat (limited to 'lib')
-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) { |