Skip to content

Commit

Permalink
Use object with null prototype for settings closes #4835
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn authored and wesleytodd committed Apr 29, 2024
1 parent 1443973 commit 26801a0
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/application.js
Expand Up @@ -32,7 +32,6 @@ var setPrototypeOf = require('setprototypeof')
* @private
*/

var hasOwnProperty = Object.prototype.hasOwnProperty
var slice = Array.prototype.slice;

/**
Expand Down Expand Up @@ -353,17 +352,7 @@ app.param = function param(name, fn) {
app.set = function set(setting, val) {
if (arguments.length === 1) {
// app.get(setting)
var settings = this.settings

while (settings && settings !== Object.prototype) {
if (hasOwnProperty.call(settings, setting)) {
return settings[setting]
}

settings = Object.getPrototypeOf(settings)
}

return undefined
return this.settings[setting];
}

debug('set "%s" to %o', setting, val);
Expand Down

0 comments on commit 26801a0

Please sign in to comment.