Prefer this fix for #65 to 6045618

This commit is contained in:
Michael Hart 2012-12-21 09:35:39 +11:00 committed by indexzero
parent aec2b4eb46
commit bb57c497d3
2 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ Memory.prototype.get = function (key) {
//
while (path.length > 0) {
key = path.shift();
if (target && typeof target !== 'string' && key in target) {
if (target && target.hasOwnProperty(key)) {
target = target[key];
continue;
}

View file

@ -58,7 +58,7 @@ vows.describe('nconf/stores/memory').addBatch({
assert.equal(store.get('falsy:string:empty:not:exist'), undefined);
}, TypeError);
},
"within empty strings": function (store) {
"within non-empty strings": function (store) {
assert.doesNotThrow(function() {
assert.equal(store.get('falsy:string:value:not:exist'), undefined);
}, TypeError);