From 0c7e31ce35e312fea0dbf7390d0ae77c9855f712 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Fri, 17 May 2024 13:54:52 -0600 Subject: [PATCH] log any dialogs open during the assertion, https://github.com/phetsims/natural-selection/issues/363 Signed-off-by: Michael Kauzmann --- js/Sim.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/Sim.ts b/js/Sim.ts index a7b53c1b..0af6d16d 100644 --- a/js/Sim.ts +++ b/js/Sim.ts @@ -64,6 +64,7 @@ import TReadOnlyProperty from '../../axon/js/TReadOnlyProperty.js'; import { CreditsData } from './CreditsNode.js'; import { PopupableNode } from '../../sun/js/Popupable.js'; import PickOptional from '../../phet-core/js/types/PickOptional.js'; +import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js'; import Multilink from '../../axon/js/Multilink.js'; import ReadOnlyProperty from '../../axon/js/ReadOnlyProperty.js'; import Combination from '../../dot/js/Combination.js'; @@ -1108,10 +1109,14 @@ export default class Sim extends PhetioObject { * Get helpful information for replicating the bug when an assertion occurs. */ public getAssertionDebugInfo(): object { - return { + const info: Record = { seed: dotRandom.getSeed(), currentScreenName: this.selectedScreenProperty?.value?.constructor.name }; + if ( this.topLayer.children.length > 1 ) { + info.simTopLayer = this.topLayer.children.map( x => `${x.constructor.name}${x.constructor.name.includes( 'Parent' ) ? `: ${x.children.map( x => x.constructor.name )}` : ''}` ); + } + return info; } }