MCPcopy Create free account
hub / github.com/Vectorized/Aris / execRoute

Function execRoute

aris.js:896–925  ·  view source on GitHub ↗
(h, s)

Source from the content-addressed store, hash-verified

894
895 //HTML.hashResolve = hashResolve;
896 var execRoute = function (h, s) {
897 var p = '', j, c, m, a = hashResolve(h), t = h.length;
898 while (m = hashCompsRe.exec(a)) {
899 p += m[1];
900 c = m[3];
901 if (m[2] && (j = savedRoutes[p]))
902 c = j;
903 if (!s) savedRoutes[p] = c;
904 p += c;
905 }
906 for (j = p; j && t > 0; j = j.replace(hashPopRe, '$1')) {
907 if (routes[j]) {
908 p = j;
909 j = '';
910 }
911 --t;
912 }
913 if (!s && isFunction(c = routes[p])) {
914 if (visited.indexOf(p) < 0) {
915 setVisited(p);
916 c();
917 } else {
918 var v = h.replace('/:', '/');
919 if (v != h && visited.indexOf(v) < 0) {
920 execRoute(v);
921 }
922 }
923 }
924 return p;
925 };
926
927 var wlh = function () { return window.location.hash; };
928

Callers 4

clickCallbackFunction · 0.85
setupHashChangeFunction · 0.85
rxFunction · 0.85
aris.jsFile · 0.85

Calls 3

hashResolveFunction · 0.85
setVisitedFunction · 0.85
cFunction · 0.85

Tested by

no test coverage detected