MCPcopy Index your code
hub / github.com/nodejs/node / fillSelects

Method fillSelects

deps/v8/tools/profview/profview.js:686–749  ·  view source on GitHub ↗
(mode, calltree)

Source from the content-addressed store, hash-verified

684 }
685
686 fillSelects(mode, calltree) {
687 function addOptions(e, values, current) {
688 while (e.options.length > 0) {
689 e.remove(0);
690 }
691 for (let i = 0; i < values.length; i++) {
692 let option = document.createElement("option");
693 option.value = values[i].value;
694 option.textContent = values[i].text;
695 e.appendChild(option);
696 }
697 e.value = current;
698 }
699
700 let attributions = [
701 { value : "js-exclude-bc",
702 text : "Attribute bytecode handlers to caller" },
703 { value : "full-tree",
704 text : "Count each code object separately" },
705 { value : "js-funs",
706 text : "Attribute non-functions to JS functions" }
707 ];
708
709 switch (mode) {
710 case "bottom-up":
711 addOptions(this.selectAttribution, attributions, calltree.attribution);
712 addOptions(this.selectCategories, [
713 { value : "code-type", text : "Code type" },
714 { value : "none", text : "None" }
715 ], calltree.categories);
716 addOptions(this.selectSort, [
717 { value : "time", text : "Time (including children)" },
718 { value : "category-time", text : "Code category, time" },
719 ], calltree.sort);
720 return;
721 case "top-down":
722 addOptions(this.selectAttribution, attributions, calltree.attribution);
723 addOptions(this.selectCategories, [
724 { value : "none", text : "None" },
725 { value : "rt-entry", text : "Runtime entries" }
726 ], calltree.categories);
727 addOptions(this.selectSort, [
728 { value : "time", text : "Time (including children)" },
729 { value : "own-time", text : "Own time" },
730 { value : "category-time", text : "Code category, time" },
731 { value : "category-own-time", text : "Code category, own time"}
732 ], calltree.sort);
733 return;
734 case "function-list":
735 addOptions(this.selectAttribution, attributions, calltree.attribution);
736 addOptions(this.selectCategories, [
737 { value : "code-type", text : "Code type" },
738 { value : "none", text : "None" }
739 ], calltree.categories);
740 addOptions(this.selectSort, [
741 { value : "own-time", text : "Own time" },
742 { value : "time", text : "Time (including children)" },
743 { value : "category-own-time", text : "Code category, own time"},

Callers 1

renderMethod · 0.95

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected