Skip to content

Commit 26801a0

Browse files
EvanHahnwesleytodd
authored andcommitted
Use object with null prototype for settings closes #4835
1 parent 1443973 commit 26801a0

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/application.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var setPrototypeOf = require('setprototypeof')
3232
* @private
3333
*/
3434

35-
var hasOwnProperty = Object.prototype.hasOwnProperty
3635
var slice = Array.prototype.slice;
3736

3837
/**
@@ -353,17 +352,7 @@ app.param = function param(name, fn) {
353352
app.set = function set(setting, val) {
354353
if (arguments.length === 1) {
355354
// app.get(setting)
356-
var settings = this.settings
357-
358-
while (settings && settings !== Object.prototype) {
359-
if (hasOwnProperty.call(settings, setting)) {
360-
return settings[setting]
361-
}
362-
363-
settings = Object.getPrototypeOf(settings)
364-
}
365-
366-
return undefined
355+
return this.settings[setting];
367356
}
368357

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

0 commit comments

Comments
 (0)