MCPcopy Create free account
hub / github.com/nodejs/node / populateSelect

Method populateSelect

deps/v8/tools/zone-stats/details-selection.js:286–298  ·  view source on GitHub ↗
(id, iterable, labelFn = null, autoselect = null)

Source from the content-addressed store, hash-verified

284 }
285
286 populateSelect(id, iterable, labelFn = null, autoselect = null) {
287 if (labelFn == null) labelFn = e => e;
288 let index = 0;
289 for (let [key, value] of iterable) {
290 index++;
291 const label = labelFn(key, value, index);
292 const option = this.createOption(key, label);
293 if (autoselect === key) {
294 option.selected = 'selected';
295 }
296 this.$(id).appendChild(option);
297 }
298 }
299
300 clearCategories() {
301 for (const category of CATEGORIES.keys()) {

Callers 2

populateIsolateSelectMethod · 0.95
handleIsolateChangeMethod · 0.95

Calls 2

createOptionMethod · 0.95
$Method · 0.95

Tested by

no test coverage detected