@@ -560,15 +560,6 @@ function formatValue(ctx, value, recurseTimes, typedArray) {
560
560
return formatRaw ( ctx , value , recurseTimes , typedArray ) ;
561
561
}
562
562
563
- function setIteratorBraces ( type , tag ) {
564
- if ( tag !== `${ type } Iterator` ) {
565
- if ( tag !== '' )
566
- tag += '] [' ;
567
- tag += `${ type } Iterator` ;
568
- }
569
- return [ `[${ tag } ] {` , '}' ] ;
570
- }
571
-
572
563
function formatRaw ( ctx , value , recurseTimes , typedArray ) {
573
564
let keys ;
574
565
@@ -630,11 +621,11 @@ function formatRaw(ctx, value, recurseTimes, typedArray) {
630
621
extrasType = kArrayExtrasType ;
631
622
} else if ( isMapIterator ( value ) ) {
632
623
keys = getKeys ( value , ctx . showHidden ) ;
633
- braces = setIteratorBraces ( 'Map' , tag ) ;
624
+ braces = getIteratorBraces ( 'Map' , tag ) ;
634
625
formatter = formatIterator ;
635
626
} else if ( isSetIterator ( value ) ) {
636
627
keys = getKeys ( value , ctx . showHidden ) ;
637
- braces = setIteratorBraces ( 'Set' , tag ) ;
628
+ braces = getIteratorBraces ( 'Set' , tag ) ;
638
629
formatter = formatIterator ;
639
630
} else {
640
631
noIterator = true ;
@@ -754,10 +745,10 @@ function formatRaw(ctx, value, recurseTimes, typedArray) {
754
745
}
755
746
}
756
747
if ( isMapIterator ( value ) ) {
757
- braces = setIteratorBraces ( 'Map' , tag ) ;
748
+ braces = getIteratorBraces ( 'Map' , tag ) ;
758
749
formatter = formatIterator ;
759
750
} else if ( isSetIterator ( value ) ) {
760
- braces = setIteratorBraces ( 'Set' , tag ) ;
751
+ braces = getIteratorBraces ( 'Set' , tag ) ;
761
752
formatter = formatIterator ;
762
753
// Handle other regular objects again.
763
754
} else if ( keys . length === 0 ) {
@@ -818,6 +809,15 @@ function formatRaw(ctx, value, recurseTimes, typedArray) {
818
809
return res ;
819
810
}
820
811
812
+ function getIteratorBraces ( type , tag ) {
813
+ if ( tag !== `${ type } Iterator` ) {
814
+ if ( tag !== '' )
815
+ tag += '] [' ;
816
+ tag += `${ type } Iterator` ;
817
+ }
818
+ return [ `[${ tag } ] {` , '}' ] ;
819
+ }
820
+
821
821
function formatError ( err , constructor , tag , ctx ) {
822
822
// TODO(BridgeAR): Always show the error code if present.
823
823
let stack = err . stack || ErrorPrototype . toString ( err ) ;
0 commit comments