comparison lib/js/urweb.js @ 1553:4105f779de7b

Even gentler handling of back-button returns to pages with stale message-passing credentials
author Adam Chlipala <adam@chlipala.net>
date Sun, 28 Aug 2011 19:32:20 -0400
parents c3b5cf5c2f98
children d5c961c709f9
comparison
equal deleted inserted replaced
1552:c3b5cf5c2f98 1553:4105f779de7b
127 127
128 function pf(loc) { 128 function pf(loc) {
129 throw ("Pattern match failure (" + loc + ")"); 129 throw ("Pattern match failure (" + loc + ")");
130 } 130 }
131 131
132 var lameDuck = false;
133
132 function runHandlers(kind, ls, arg) { 134 function runHandlers(kind, ls, arg) {
133 if (ls == null) 135 if (!lameDuck) {
134 alert(kind + ": " + arg); 136 if (ls == null)
135 for (; ls; ls = ls.next) 137 alert(kind + ": " + arg);
136 try { 138 for (; ls; ls = ls.next)
137 exec({c:"a", f:{c:"a", f:ls.data, x:{c:"c", v:arg}}, x:{c:"c", v:null}}); 139 try {
138 } catch (v) { } 140 exec({c:"a", f:{c:"a", f:ls.data, x:{c:"c", v:arg}}, x:{c:"c", v:null}});
141 } catch (v) { }
142 }
139 } 143 }
140 144
141 var errorHandlers = null; 145 var errorHandlers = null;
142 146
143 function onError(f) { 147 function onError(f) {
909 if (text == "") 913 if (text == "")
910 return; 914 return;
911 var lines = text.split("\n"); 915 var lines = text.split("\n");
912 916
913 if (lines.length == 1 && lines[0] == "R") { 917 if (lines.length == 1 && lines[0] == "R") {
918 lameDuck = true;
919
914 if (isPost) 920 if (isPost)
915 history.back(); 921 history.back();
916 else 922 else
917 location.reload(); 923 location.reload();
918 924