mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
Use object with null prototype for settings closes #4835
This commit is contained in:
parent
14439731f9
commit
26801a0afd
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user