Skip to content
Myr

fixed app.locals precedence

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 d58beed · Browse files · 2 files+4 added−6 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+4 added−6 removed

  • other:+4 added−6 removed

2 files+4 added−6 removed

modified:examples/layout-control/app.js+1 added-1 removed
modified:lib/view.js+3 added-5 removed
333 unmodified lines
334res._render = function(view, opts, fn, parent, sub){335 var options = {}336 , self = this337 , app = this.app338 , locals = app.locals339 , dynamic = app._dynamicLocals338 , root = app.set('views') || process.cwd() + '/views';339340 // cache id341 var cid = app.enabled('view cache')342 ? view + (parent ? ':' + parent.path : '')343 : false;344345 // merge app.locals346 union(options, app.locals);347348 // merge res.locals349 merge(options, this.locals);350351 // merge render() options
30 unmodified lines
382383 // charset option384 if (options.charset) this.charset = options.charset;385385 // Merge view locals386 union(options, locals);387386 // Always expose partial() as a local387 options.partial = function(path, opts){388 return renderPartial(self, path, opts, options, view);389 };
47 unmodified lines