Skip to content
Myr

"context" option is no more, use "scope"

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 a2e6e2a · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:lib/express/view.js+4 added-4 removed
148 unmodified lines
149 options.locals[name] = options.object;150 } else if (name === global) {151 utils.merge(options.locals, options.object);152 } else {153 options.context = options.object;153 options.scope = options.object;154 }155 }156 return this.render(view, options);157 }
8 unmodified lines
166 * 167 * Most engines accept one or more of the following options,168 * both _haml_ and _jade_ accept all:169 *170 * - `context|scope` Template evaluation context (`this`)170 * - `scope` Template evaluation context (the value of `this`)171 * - `locals` Object containing local variables172 * - `debug` Output debugging information173 * - `status` Response status code, defaults to 200174 * - `headers` Response headers object
38 unmodified lines
213 if (typeof layout === 'string' && layout.indexOf('.') < 0) {214 layout += ext;215 }216217 // Normalize "context" to "scope", defaulting to this response218 options.scope = options.scope || options.context || this;217 // Default execution scope to the response218 options.scope = options.scope || this;219220 // Auto-cache in production221 if (this.app.set('env') === 'production') {222 options.cache = true;
80 unmodified lines