Skip to content

Commit

Permalink
log before debugger, phetsims/aqua#212
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed May 17, 2024
1 parent fca6867 commit 9224a87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
// Add "Assertion Failed" to the front of the message list
const assertPrefix = messages.length > 0 ? 'Assertion failed: ' : 'Assertion failed';
console && console.error && console.error( assertPrefix, ...messages );

// 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 ) );

if ( window.QueryStringMachine && QueryStringMachine.containsKey( 'debugger' ) ) {
debugger; // eslint-disable-line no-debugger
}
Expand All @@ -36,9 +40,6 @@
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 9224a87

Please sign in to comment.