Skip to content
Myr

Added res.render() .locals support back to aid in migration process

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 47dc188 · Browse files · 2 files+4 added−1 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−1 removed

  • tests:+1 added−1 removed
  • other:+3 added−0 removed

2 files+4 added−1 removed

modified:lib/view.js+3 added
190 unmodified lines
191192 // merge render() options193 if (opts) merge(options, opts);194195 // merge render() .locals196 if (opts && opts.locals) merge(options, opts.locals);197198 // Defaults199 var self = this200 , root = app.set('views') || process.cwd() + '/views'201 , partial = options.renderPartial
105 unmodified lines
modified:test/view.test.js+1 added-1 removed
587 unmodified lines
588589 app.get('/', function(req, res, next){590 res.render('greetings.jade', {591 name: 'TJ'592 , otherName: 'Overridden'592 , locals: { otherName: 'Overridden' }593 });594 });595596 assert.response(app,
303 unmodified lines