MCPcopy Index your code
hub / github.com/python/cpython / constructor

Method constructor

Doc/_static/profiling-sampling-visualization.js:332–359  ·  view source on GitHub ↗
(functionName, lineno, args = null)

Source from the content-addressed store, hash-verified

330
331 class DOMStackFrame {
332 constructor(functionName, lineno, args = null) {
333 this.functionName = functionName;
334 this.lineno = lineno;
335 this.args = args;
336 this.isActive = false;
337 this.color = getFunctionColor(functionName);
338
339 this.element = document.createElement("div");
340 this.element.className = "stack-frame";
341 this.element.dataset.function = functionName;
342
343 this.bgElement = document.createElement("div");
344 this.bgElement.className = "stack-frame-bg";
345 this.bgElement.style.backgroundColor = this.color;
346 this.element.appendChild(this.bgElement);
347
348 this.textElement = document.createElement("span");
349 this.textElement.className = "stack-frame-text";
350 this.textElement.textContent = functionName;
351 this.element.appendChild(this.textElement);
352
353 this.flashElement = document.createElement("div");
354 this.flashElement.className = "stack-frame-flash";
355 this.element.appendChild(this.flashElement);
356
357 this.element.addEventListener("pointerover", this._onHover.bind(this));
358 this.element.addEventListener("pointerout", this._onHoverOut.bind(this));
359 }
360
361 destroy() {
362 this.element.parentNode?.removeChild(this.element);

Callers

nothing calls this directly

Calls 4

getFunctionColorFunction · 0.85
createElementMethod · 0.80
appendChildMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected