From 26801a0afdd73258ee3c3685e30d5d4040c1558d Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Mon, 21 Feb 2022 12:17:50 -0600 Subject: [PATCH] Use object with null prototype for settings closes #4835 --- lib/application.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/application.js b/lib/application.js index 2a370aa3..f07cc12a 100644 --- a/lib/application.js +++ b/lib/application.js @@ -32,7 +32,6 @@ var setPrototypeOf = require('setprototypeof') * @private */ -var hasOwnProperty = Object.prototype.hasOwnProperty var slice = Array.prototype.slice; /** @@ -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);