Skip to content
Myr

refactored res.render()

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 04ebd88 · Browse files · 1 file+15 added−9 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+15 added−9 removed

  • other:+15 added−9 removed

1 file+15 added−9 removed

modified:lib/response.js+15 added-9 removed
534 unmodified lines
535 , pending = callbacks.length536 , len = pending537 , done;538539 for (var i = 0; i < len; ++i) {540 callbacks[i](req, self, function(err){541 if (err) {542 req.next(err);543 done = true;544 return;545 }539 if (len) {540 for (var i = 0; i < len; ++i) {541 callbacks[i](req, self, function(err){542 if (done) return;543544 if (err) {545 req.next(err);546 done = true;547 return;548 }549547 --pending || render();548 });550 --pending || render();551 });552 }553 } else {554 render();555 }556};