Skip to content
Myr

Use object with null prototype for settings closes #4835

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

authored by Evan Hahn · committed by Wes Todd · parent 1443973 · Browse files · 1 file+1 added−12 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+1 added−12 removed

  • other:+1 added−12 removed

1 file+1 added−12 removed

modified:lib/application.js+1 added-12 removed
30 unmodified lines
31 * Module variables.32 * @private33 */3435var hasOwnProperty = Object.prototype.hasOwnProperty35var slice = Array.prototype.slice;3637/**38 * Application prototype.
312 unmodified lines
351352app.set = function set(setting, val) {353 if (arguments.length === 1) {354 // app.get(setting)356 var settings = this.settings357358 while (settings && settings !== Object.prototype) {359 if (hasOwnProperty.call(settings, setting)) {360 return settings[setting]361 }362363 settings = Object.getPrototypeOf(settings)364 }365366 return undefined355 return this.settings[setting];356 }357358 debug('set "%s" to %o', setting, val);359
277 unmodified lines