@@ -1102,7 +1102,6 @@ ExecutionVisualizer.prototype.precomputeCurTraceLayouts = function() {
11021102}
11031103
11041104
1105-
11061105// The "3.0" version of renderDataStructures renders variables in
11071106// a stack, values in a separate heap, and draws line connectors
11081107// to represent both stack->heap object references and, more importantly,
@@ -1575,18 +1574,27 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
15751574 var stackDiv = myViz . domRootD3 . select ( '#stack' ) ;
15761575
15771576 var stackFrameDiv = stackDiv . selectAll ( 'div' )
1578- . data ( curEntry . stack_to_render , function ( frame , i ) {
1579- // use a frankenstein combination of frame identifiers and also the INDEX (stack position)
1580- // as the join key, to properly handle closures and recursive calls of the same function
1581- return frame . func_name + '_' + String ( frame . frame_id ) + '_' + String ( frame . parent_frame_id_list ) + '_' + String ( frame . is_zombie ) + '_' + i ;
1577+ . data ( curEntry . stack_to_render , function ( frame ) {
1578+ return frame . unique_hash ; // VERY IMPORTANT for properly handling closures and nested functions
15821579 } ) ;
15831580
15841581 stackFrameDiv . enter ( ) . append ( 'div' )
15851582 . attr ( 'class' , function ( d , i ) { return d . is_zombie ? 'zombieStackFrame' : 'stackFrame' ; } )
1586- . attr ( 'id' , function ( d , i ) { return d . is_zombie ? myViz . generateID ( "zombie_stack" + i ) : myViz . generateID ( "stack" + i ) ; } ) ;
1583+ //.attr('id', function(d, i) {return d.is_zombie ? myViz.generateID("zombie_stack_" + htmlspecialchars(d.unique_hash))
1584+ // : myViz.generateID("stack_" + htmlspecialchars(d.unique_hash));
1585+ //})
1586+ . attr ( 'id' , function ( d , i ) { return d . is_zombie ? myViz . generateID ( "zombie_stack" + i )
1587+ : myViz . generateID ( "stack" + i ) ;
1588+ } )
15871589
15881590
1591+
1592+ /*
1593+ // I suspect I need to use .order() somewhere, but I can't seem to get it in the right place :(
15891594 stackFrameDiv
1595+ .each(function(frame, i) {
1596+ console.log('UPDATE stackFrameDiv', frame.unique_hash);
1597+ })
15901598 .append('div')
15911599 .attr('class', 'stackFrameHeader')
15921600 .html(function(frame, i) {
@@ -1605,9 +1613,13 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
16051613 }
16061614
16071615 return headerLabel;
1608- } ) ;
1616+ })
1617+ */
1618+
1619+ stackFrameDiv . exit ( ) . remove ( ) ;
16091620
16101621
1622+ /*
16111623 stackFrameDiv
16121624 .append('div')
16131625 .attr('class', 'derrrr')
@@ -1637,9 +1649,9 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
16371649 });
16381650
16391651 stackVarTable.exit().remove();
1652+ */
16401653
16411654
1642- stackFrameDiv . exit ( ) . remove ( ) ;
16431655
16441656 /*
16451657 stackFrame.enter()
0 commit comments