@@ -12,8 +12,8 @@ var obj = {
12
12
nullValue : null
13
13
}
14
14
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 )
17
17
18
18
// set returns old value
19
19
assert . strictEqual ( jsonpointer . set ( obj , '/a' , 2 ) , 1 )
@@ -119,18 +119,16 @@ assert.strictEqual(jsonpointer.get(example, '/ '), 7)
119
119
assert . strictEqual ( jsonpointer . get ( example , '/m~0n' ) , 8 )
120
120
121
121
// jsonpointer.compile(path)
122
- var a = { foo : 'bar' }
122
+ var a = { foo : 'bar' , foo2 : null }
123
123
var pointer = jsonpointer . compile ( '/foo' )
124
124
assert . strictEqual ( pointer . get ( a ) , 'bar' )
125
125
assert . strictEqual ( pointer . set ( a , 'test' ) , 'bar' )
126
126
assert . strictEqual ( pointer . get ( a ) , 'test' )
127
- assert . deepEqual ( a , { foo : 'test' } )
127
+ assert . deepEqual ( a , { foo : 'test' , foo2 : null } )
128
128
129
-
130
- // compile read null value
131
- var compileWithNullValue = { foo : 'bar' }
129
+ // Read subproperty of null value
132
130
var pointerNullValue = jsonpointer . compile ( '/foo2/baz' )
133
- assert . equal ( pointer . get ( pointerNullValue ) , null )
131
+ assert . strictEqual ( pointerNullValue . get ( a ) , undefined )
134
132
135
133
var b = { }
136
134
jsonpointer . set ( { } , '/constructor/prototype/boo' , 'polluted' )
0 commit comments