Skip to content
Myr

Merge branch 'bugs/local-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 · parents 0800141, 9e9f55a · Browse files · 1 file+16 added−15 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+16 added−15 removed

  • other:+16 added−15 removed

1 file+16 added−15 removed

modified:lib/view.js+16 added-15 removed
149 unmodified lines
150 * @param {Function} fn151 * @api public152 */153154http.ServerResponse.prototype.render = function(view, options, fn, parent){155 // Support callback function as second arg156 if (typeof options === 'function') {157 fn = options, options = {};154http.ServerResponse.prototype.render = function(view, opts, fn, parent){155 // support callback function as second arg156 if (typeof opts === 'function') {157 fn = opts, opts = null;158 }159 160 var options = {}160 var self = this161 , self = this162 , app = this.app162 , options = options || {}163 , helpers = app.viewHelpers164 , dynamicHelpers = app.dynamicViewHelpers165 , viewOptions = app.settings['view options']166 , cacheTemplates = app.settings['cache views'];165 , viewOptions = app.set('view options')166 , cacheTemplates = app.set('cache views');167168 // Merge "view options"169 if (viewOptions) options = merge(clone(viewOptions), options);168 // merge "view options"169 if (viewOptions) options = merge(options, viewOptions);170171 // merge res.locals172 if (this.locals) options = merge(options, this.locals);173174 // merge render() options175 if (opts) options = merge(options, opts);176177 // Defaults178 var self = this179 , root = app.settings.views || process.cwd() + '/views'180 , partial = options.renderPartial
35 unmodified lines
216 ? new Partial(orig.indexPath, options)217 : new View(orig.indexPath, options);218 }219 214 // Merge res.locals215 if (this.locals) {216 options = merge(this.locals, options);217 }218 220 // Dynamic helper support221 if (false !== options.dynamicHelpers) {222 // cache223 if (!this.__dynamicHelpers) {
55 unmodified lines