Skip to content
Browse files

Fixed app.set() with undefined

  • Loading branch information...
1 parent b4ce57c commit 7d24c2ba4023d8eb1a6881350fca34947879bae7 @tj tj committed
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/application.js
  2. +5 −0 test/config.js
View
2 lib/application.js
@@ -332,7 +332,7 @@ app.is = function(type, fn){
*/
app.set = function(setting, val){
- if (val === undefined) {
+ if (1 == arguments.length) {
if (this.settings.hasOwnProperty(setting)) {
return this.settings[setting];
} else if (this.parent) {
View
5 test/config.js
@@ -8,6 +8,11 @@ describe('config', function(){
var app = express();
app.set('foo', 'bar').should.equal(app);
})
+
+ it('should return the app when undefined', function(){
+ var app = express();
+ app.set('foo', undefined).should.equal(app);
+ })
})
describe('.get()', function(){

0 comments on commit 7d24c2b

Please sign in to comment.
Something went wrong with that request. Please try again.