Skip to content
Myr

Merge pull request #1503 from shesek/settings-inheritance

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Inherit settings from parent application using [[Prototype]]

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents 476fba3, 420225f · Browse files · 1 file+2 added−5 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+2 added−5 removed

  • other:+2 added−5 removed

1 file+2 added−5 removed

modified:lib/application.js+2 added-5 removed
57 unmodified lines
58 this.on('mount', function(parent){59 this.request.__proto__ = parent.request;60 this.response.__proto__ = parent.response;61 this.engines.__proto__ = parent.engines;62 this.settings.__proto__ = parent.settings;63 });6465 // router66 this._router = new Router(this);
182 unmodified lines
249 */250251app.set = function(setting, val){252 if (1 == arguments.length) {252 if (this.settings.hasOwnProperty(setting)) {253 return this.settings[setting];253 return this.settings[setting];254 } else if (this.parent) {255 return this.parent.set(setting);256 }254 } else {255 this.settings[setting] = val;256 return this;257 }
273 unmodified lines