* Helper function for calculating a tree profile. * * @param {Profile.CallTree} tree Call tree. * @param {string} opt_label Node label.
(tree, opt_label)
| 774 | * @param {string} opt_label Node label. |
| 775 | */ |
| 776 | getTreeProfile_(tree, opt_label) { |
| 777 | if (!opt_label) { |
| 778 | tree.computeTotalWeights(); |
| 779 | return tree; |
| 780 | } else { |
| 781 | const subTree = tree.cloneSubtree(opt_label); |
| 782 | subTree.computeTotalWeights(); |
| 783 | return subTree; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | /** |
| 788 | * Calculates a flat profile of callees starting from a node with |
no test coverage detected