Skip to content

Commit

Permalink
update assertion message with data, #115
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 24, 2023
1 parent a10f46a commit 3fd2a48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/common/view/BANScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ abstract class BANScreenView<M extends BANModel<ParticleAtom | ParticleNucleus>>
this.interruptSubtreeInput(); // cancel interactions that may be in progress
this.model.reset();
this.reset();
assert && assert( Object.keys( this.particleViewMap ).length === 0, 'all views should be cleaned up on reset' );

assert && assert( Object.keys( this.particleViewMap ).length === 0,
'all views should be cleaned up on reset\n' +
Object.keys( this.particleViewMap ).map( ( x: string ) => {
const particle = this.particleViewMap[ x as unknown as number ].particle;
return particle ? `${particle.id}, ${particle.type}, disposed:${particle.isDisposed}, ${particle.colorProperty.value.toString()}` : '';
} ) );
},
right: this.layoutBounds.maxX - BANConstants.SCREEN_VIEW_X_MARGIN,
bottom: this.layoutBounds.maxY - BANConstants.SCREEN_VIEW_Y_MARGIN
Expand Down

0 comments on commit 3fd2a48

Please sign in to comment.