Skip to content

Commit fb35dcd

Browse files
committed
make the java stack grow downward just like the Python and JS stacks
1 parent ddb09f0 commit fb35dcd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4133,6 +4133,15 @@ function closeModal(divId) {
41334133
// All of the Java frontend code in this function was written by David
41344134
// Pritchard and Will Gwozdz, and integrated by Philip Guo
41354135
ExecutionVisualizer.prototype.activateJavaFrontend = function() {
4136+
// super hack by Philip that reverses the direction of the stack so
4137+
// that it grows DOWN and renders the same way as the Python and JS
4138+
// visualizer stacks
4139+
this.curTrace.forEach(function(e, i) {
4140+
if (e.stack_to_render !== undefined) {
4141+
e.stack_to_render.reverse();
4142+
}
4143+
});
4144+
41364145
this.add_pytutor_hook(
41374146
"renderPrimitiveObject",
41384147
function(args) {

0 commit comments

Comments
 (0)