@@ -144,41 +144,20 @@ jsonpointer.set({}, '/foo/__proto__/__proto__/boo', 'polluted')
144144assert ( ! d . boo , 'should not boo' )
145145
146146var e = { }
147- jsonpointer . set ( { } , '/constructor/prototype/boo' , 'polluted' )
148- assert ( ! e . boo , 'should not boo' )
149-
150147jsonpointer . set ( { } , '/foo/constructor/prototype/boo' , 'polluted' )
151148assert ( ! e . boo , 'should not boo' )
152149
153150jsonpointer . set ( { } , '/foo/constructor/constructor/prototype/boo' , 'polluted' )
154151assert ( ! e . boo , 'should not boo' )
155152
156- var f = { }
157- jsonpointer . set ( { } , [ [ '__proto__' ] , 'boo' ] , 'polluted' )
158- assert ( ! f . boo , 'should not f.boo' )
159-
160- jsonpointer . set ( { } , [ [ [ '__proto__' ] ] , 'boo' ] , 'polluted' )
161- assert ( ! f . boo , 'should not f.boo' )
162-
163- jsonpointer . set ( { } , [ [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' )
164- assert ( ! f . boo , 'should not f.boo' )
165-
166- jsonpointer . set ( { } , [ [ [ '__proto__' ] ] , [ [ '__proto__' ] ] , 'boo' ] , 'polluted' )
167- assert ( ! f . boo , 'should not f.boo' )
168-
169- jsonpointer . set ( { } , [ [ '__proto__' ] , [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' )
170- assert ( ! f . boo , 'should not f.boo' )
171-
172- jsonpointer . set ( { } , [ [ 'foo' ] , [ '__proto__' ] , 'boo' ] , 'polluted' )
173- assert ( ! f . boo , 'should not boo' )
174-
175- jsonpointer . set ( { } , [ [ 'foo' ] , [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' )
176- assert ( ! f . boo , 'should not boo' )
177-
178- jsonpointer . set ( { } , [ [ 'constructor' ] , [ 'prototype' ] , 'boo' ] , 'polluted' )
179- assert ( ! f . boo , 'should not boo' )
180-
181- jsonpointer . set ( { } , [ [ 'constructor' ] , [ 'constructor' ] , [ 'prototype' ] , 'boo' ] , 'polluted' )
182- assert ( ! f . boo , 'should not boo' )
153+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ '__proto__' ] , 'boo' ] , 'polluted' ) } , validateError )
154+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ [ '__proto__' ] ] , 'boo' ] , 'polluted' ) } , validateError )
155+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' ) } , validateError )
156+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ [ '__proto__' ] ] , [ [ '__proto__' ] ] , 'boo' ] , 'polluted' ) } , validateError )
157+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ '__proto__' ] , [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' ) } , validateError )
158+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ 'foo' ] , [ '__proto__' ] , 'boo' ] , 'polluted' ) } , validateError )
159+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ 'foo' ] , [ '__proto__' ] , [ '__proto__' ] , 'boo' ] , 'polluted' ) } , validateError )
160+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ 'constructor' ] , [ 'prototype' ] , 'boo' ] , 'polluted' ) } , validateError )
161+ assert . throws ( function ( ) { jsonpointer . set ( { } , [ [ 'constructor' ] , [ 'constructor' ] , [ 'prototype' ] , 'boo' ] , 'polluted' ) } , validateError )
183162
184163console . log ( 'All tests pass.' )
0 commit comments