Skip to content

Commit

Permalink
Add helpful debug information before the assertion Error is thrown, see
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 16, 2024
1 parent a5da36d commit fca6867
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
Error.stackTraceLimit = 20;
}

// eslint-disable-next-line bad-phet-library-text
window.phet?.joist?.sim && console.log( 'Debug info:', JSON.stringify( window.phet.joist.sim.getAssertionDebugInfo(), null, 2 ) );

throw new Error( assertPrefix + messages.join( '\n ' ) );
}
};
Expand Down

0 comments on commit fca6867

Please sign in to comment.