Permalink
Browse files

remove silly line

  • Loading branch information...
1 parent 23c965d commit af01f29dedb2fd1355815e1386c546b2cde4a2dc @guybrush committed Jan 5, 2013
Showing with 5 additions and 1 deletion.
  1. +0 −1 objpath.js
  2. +5 −0 test.js
View
1 objpath.js
@@ -28,7 +28,6 @@ function objpath(obj, keyString, value) {
if (value === undefined) { // get data
var value = temp
for (var i=0, len=keys.length; i<len; i++) {
- if (value === undefined) return false
value = value[keys[i]]
}
return value
View
5 test.js
@@ -16,8 +16,13 @@ assert.deepEqual(obj,result)
var obj = {a:{aa:undefined}}
var result = op(obj,'a.ab',0)
var result = op(obj,'a.ac',false)
+
assert.deepEqual(result,{a:{aa:undefined,ab:0,ac:false}})
assert.equal(op(obj,'a.aa'),undefined)
assert.equal(op(obj,'a.ac'),false)
assert.deepEqual(obj,result)
+var result = op({},'a',{b:undefined})
+assert.deepEqual(result,{a:{b:undefined}})
+assert.equal(op(result,'a.b'),undefined)
+

0 comments on commit af01f29

Please sign in to comment.