@@ -189,6 +189,7 @@ function toArray (type, elements, maxLength, timeBudgetReached) {
189189function toMap ( type , pairs , maxLength , timeBudgetReached ) {
190190 if ( timeBudgetReached === true ) return notCapturedTimeBudget ( type )
191191 if ( pairs === undefined ) return notCapturedDepth ( type )
192+ if ( pairs . every ( ( { value } ) => Object . hasOwn ( value , timeBudgetSym ) ) ) return notCapturedTimeBudget ( type )
192193
193194 const result = {
194195 type,
@@ -201,9 +202,6 @@ function toMap (type, pairs, maxLength, timeBudgetReached) {
201202 // This can be skipped and we can go directly to its children, of which
202203 // there will always be exactly two, the first containing the key, and the
203204 // second containing the value of this entry of the Map.
204- if ( Object . hasOwn ( value , timeBudgetSym ) ) {
205- return [ { notCapturedReason : 'timeout' } , { notCapturedReason : 'timeout' } ]
206- }
207205 const shouldRedact = shouldRedactMapValue ( value . properties [ 0 ] )
208206 const key = getPropertyValue ( value . properties [ 0 ] , maxLength )
209207 const val = shouldRedact
@@ -221,6 +219,7 @@ function toMap (type, pairs, maxLength, timeBudgetReached) {
221219function toSet ( type , values , maxLength , timeBudgetReached ) {
222220 if ( timeBudgetReached === true ) return notCapturedTimeBudget ( type )
223221 if ( values === undefined ) return notCapturedDepth ( type )
222+ if ( values . every ( ( { value } ) => Object . hasOwn ( value , timeBudgetSym ) ) ) return notCapturedTimeBudget ( type )
224223
225224 const result = {
226225 type,
@@ -233,9 +232,6 @@ function toSet (type, values, maxLength, timeBudgetReached) {
233232 // `internal#entry`. This can be skipped and we can go directly to its
234233 // children, of which there will always be exactly one, which contain the
235234 // actual value in this entry of the Set.
236- if ( Object . hasOwn ( value , timeBudgetSym ) ) {
237- return { notCapturedReason : 'timeout' }
238- }
239235 return getPropertyValue ( value . properties [ 0 ] , maxLength )
240236 } )
241237 }
0 commit comments