Skip to content
Myr

misc refactoring

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 ae11d83 · Browse files · 1 file+5 added−9 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+5 added−9 removed

  • other:+5 added−9 removed

1 file+5 added−9 removed

modified:lib/application.js+5 added-9 removed
543 unmodified lines
544545app.del = app.delete;546547/**548 * Render the given `view` name with `opts`548 * Render the given `view` name with `options`549 * and a callback accepting an error and the550 * rendered template string.551 *552 * @param {String} view553 * @param {String|Function} opts or fn553 * @param {String|Function} options or fn554 * @param {Function} fn555 * @api public556 */557558app.render = function(view, opts, fn){558app.render = function(view, options, fn){559 var self = this560 , options = {}560 , engines = this.engines561 , root = this.set('views') || process.cwd() + '/views';562563 // support callback function as second arg565 if ('function' == typeof opts) {566 fn = opts, opts = null;564 if ('function' == typeof options) {565 fn = options, options = {};566 }567568 // merge app.locals569 union(options, this.locals);570572 // merge render() options573 if (opts) utils.merge(options, opts);574571 // join "view engine" if necessary572 var ext = extname(view);573 if (!ext) view += '.' + (ext = this.set('view engine'));574
16 unmodified lines