Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ app.render = function(name, options, fn){
var cache = this.cache;
var engines = this.engines;
var view;
var cleanLocals = {};

// saving a clean copy of locals
if (this.locals) {
merge(cleanLocals, this.locals);
}

if (options._locals) {
merge(cleanLocals, options._locals);
}

// support callback function as second arg
if ('function' == typeof options) {
Expand All @@ -532,6 +542,9 @@ app.render = function(name, options, fn){
// merge options
merge(opts, options);

// export a clean copy of the locals, separate from express settings
opts.locals = cleanLocals;

// set .cache unless explicitly provided
opts.cache = null == opts.cache
? this.enabled('view cache')
Expand Down