Skip to content

Commit

Permalink
Fixed app.set() with undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 15, 2011
1 parent b4ce57c commit 7d24c2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/application.js
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions test/config.js
Expand Up @@ -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(){
Expand Down

0 comments on commit 7d24c2b

Please sign in to comment.