Skip to content
Myr

Aliased app.helpers() as app.locals(). Closes #481

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

  • tests:+4 added−1 removed
  • other:+2 added−1 removed

2 files+6 added−2 removed

modified:lib/express/server.js+2 added-1 removed
196 unmodified lines
197 * @return {Server} for chaining198 * @api public199 */200201Server.prototype.helpers = function(obj){201Server.prototype.helpers = 202Server.prototype.locals = function(obj){203 utils.merge(this.viewHelpers, obj);204 return this;205};206
214 unmodified lines
modified:test/view.test.js+4 added-1 removed
361 unmodified lines
362 'test #render() view helpers': function(beforeExit){363 var app = create()364 , calls = 0;365366 app.locals({367 lastName: 'holowaychuk'368 });369370 app.helpers({ 367 lastName: 'holowaychuk',371 greetings: function(sess, lastName){372 return 'Hello ' + sess.name + ' ' + lastName; 373 }374 });
399 unmodified lines