dominictarr/config-chain — pull request #8 by mfncooper (2013-02-09 19:38:59+00:00)
Title: Bug fix for retrieving named config values

There's a bug in the get() function when retrieving a value from a named config, when that named config is either the only or the last config in the chain. For example, the following code throws an exception:

```javascript
var cc = new CC()
cc.add({foo:'flooby'}, 'named_config')
.on('load', function (cc) {
cc.get('foo', 'named_config')
})
```

What's happening is that proto-list sets the \_\_proto\_\_ value of the config data to its root, but for the first guy in, root is null, at which point the data object is no longer a proper Object, and no longer has a hasOwnProperty() function. So when get() tries to call hasOwnProperty(), it throws because the function doesn't exist.

I've fixed this by always using Object.hasOwnProperty, instead of trying to call it as a function on the data object. I've also added a bunch of unit tests for named configs.