@@ -12,8 +12,8 @@ var obj = {
1212 nullValue : null
1313}
1414
15- assert . equal ( jsonpointer . get ( obj , '/nullValue' ) , null )
16- assert . equal ( jsonpointer . get ( obj , '/nullValue/e' ) , null )
15+ assert . strictEqual ( jsonpointer . get ( obj , '/nullValue' ) , null )
16+ assert . strictEqual ( jsonpointer . get ( obj , '/nullValue/e' ) , undefined )
1717
1818// set returns old value
1919assert . strictEqual ( jsonpointer . set ( obj , '/a' , 2 ) , 1 )
@@ -119,18 +119,16 @@ assert.strictEqual(jsonpointer.get(example, '/ '), 7)
119119assert . strictEqual ( jsonpointer . get ( example , '/m~0n' ) , 8 )
120120
121121// jsonpointer.compile(path)
122- var a = { foo : 'bar' }
122+ var a = { foo : 'bar' , foo2 : null }
123123var pointer = jsonpointer . compile ( '/foo' )
124124assert . strictEqual ( pointer . get ( a ) , 'bar' )
125125assert . strictEqual ( pointer . set ( a , 'test' ) , 'bar' )
126126assert . strictEqual ( pointer . get ( a ) , 'test' )
127- assert . deepEqual ( a , { foo : 'test' } )
127+ assert . deepEqual ( a , { foo : 'test' , foo2 : null } )
128128
129-
130- // compile read null value
131- var compileWithNullValue = { foo : 'bar' }
129+ // Read subproperty of null value
132130var pointerNullValue = jsonpointer . compile ( '/foo2/baz' )
133- assert . equal ( pointer . get ( pointerNullValue ) , null )
131+ assert . strictEqual ( pointerNullValue . get ( a ) , undefined )
134132
135133var b = { }
136134jsonpointer . set ( { } , '/constructor/prototype/boo' , 'polluted' )
0 commit comments