File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ export function stringify(value, reducers) {
128128 `.get(${ is_primitive ( key ) ? stringify_primitive ( key ) : '...' } )`
129129 ) ;
130130 str += `,${ flatten ( key ) } ,${ flatten ( value ) } ` ;
131+ keys . pop ( ) ;
131132 }
132133
133134 str += ']' ;
Original file line number Diff line number Diff line change @@ -571,6 +571,21 @@ for (const fn of [uneval, stringify]) {
571571 assert . equal ( e . path , '.foo.map.get("key")' ) ;
572572 }
573573 } ) ;
574+
575+ uvu . test ( `${ fn . name } populates error.path after maps (#64)` , ( ) => {
576+ try {
577+ fn ( {
578+ map : new Map ( [ [ 'key' , 'value' ] ] ) ,
579+ object : {
580+ invalid ( ) { }
581+ }
582+ } ) ;
583+ } catch ( e ) {
584+ assert . equal ( e . name , 'DevalueError' ) ;
585+ assert . equal ( e . message , 'Cannot stringify a function' ) ;
586+ assert . equal ( e . path , '.object.invalid' ) ;
587+ }
588+ } ) ;
574589}
575590
576591uvu . test ( 'does not create duplicate parameter names' , ( ) => {
You can’t perform that action at this time.
0 commit comments