Skip to content
Myr

refactored with nextRoute()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 4068e7f · Browse files · 1 file+8 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−3 removed

  • other:+8 added−3 removed

1 file+8 added−3 removed

modified:lib/router/index.js+8 added-3 removed
160 unmodified lines
161 var route162 , keys163 , ret;164165 // match next route166 function nextRoute() {167 pass(req._route_index + 1);168 }169170 // match route171 route = self._match(req, i);172173 // implied OPTIONS
15 unmodified lines
189 , ret;190191 try {192 if ('route' == err) {188 pass(req._route_index + 1);193 nextRoute();194 } else if (err) {195 next(err);196 } else if (fn && fn.length < 3) {197 ret = req.params[key] = fn(val);198 if (invalidParamReturnValue(ret)) {194 pass(req._route_index + 1);199 nextRoute();200 } else {201 param();202 }203 } else if (fn) {
12 unmodified lines
216 // invoke route middleware217 function middleware(err) {218 var fn = route.middleware[i++];219 if ('route' == err) {215 pass(req._route_index + 1);220 nextRoute();221 } else if (err) {222 next(err);223 } else if (fn) {224 fn(req, res, middleware);
159 unmodified lines