# HG changeset patch # User Adam Chlipala # Date 1384428996 18000 # Node ID abb0e95dcaa1be37273a4854fa71f7fd4362f2ba # Parent c40ed80be943d4b362f047e58453d040d5705f77 Fix more of client-side error handlers diff -r c40ed80be943 -r abb0e95dcaa1 lib/js/urweb.js --- a/lib/js/urweb.js Thu Nov 14 06:16:58 2013 -0500 +++ b/lib/js/urweb.js Thu Nov 14 06:36:36 2013 -0500 @@ -376,15 +376,19 @@ 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 @@ var failHandlers = null; function onFail(f) { - failHandlers = cons(f, failHandlers); + failHandlers = cons(flift0(f), failHandlers); } function doExn(v) { @@ -434,7 +438,7 @@ var serverHandlers = null; function onServerError(f) { - serverHandlers = cons(f, serverHandlers); + serverHandlers = cons(flift0(f), serverHandlers); } function servErr(s) { diff -r c40ed80be943 -r abb0e95dcaa1 tests/updateErr.ur --- a/tests/updateErr.ur Thu Nov 14 06:16:58 2013 -0500 +++ b/tests/updateErr.ur Thu Nov 14 06:36:36 2013 -0500 @@ -8,8 +8,9 @@ {[s]}}/>
Init else error Crapky}/>
"{[s]}"}/>
+