Skip to content

Commit

Permalink
log any dialogs open during the assertion, phetsims/natural-selection…
Browse files Browse the repository at this point in the history
…#363

Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed May 17, 2024
1 parent f2dec35 commit 0c7e31c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/Sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<string, IntentionalAny> = {
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;
}
}

Expand Down

0 comments on commit 0c7e31c

Please sign in to comment.