Skip to content
Myr

refactor res.render() to prevent clobbering "locals"

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 ff1c6f0 · Browse files · 2 files+3 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

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:lib/application.js+2 added-2 removed
465 unmodified lines
466467 // merge app.locals468 utils.merge(opts, this.locals);469470 // merge options.locals471 if (options.locals) utils.merge(opts, options.locals);470 // merge options._locals471 if (options._locals) utils.merge(opts, options._locals);472473 // merge options474 utils.merge(opts, options);475
59 unmodified lines
modified:lib/response.js+1 added-1 removed
663 unmodified lines
664 fn = options, options = {};665 }666667 // merge res.locals668 options.locals = self.locals;668 options._locals = self.locals;669670 // default callback to respond671 fn = fn || function(err, str){672 if (err) return req.next(err);
6 unmodified lines