Skip to content
Merged
Prev Previous commit
Next Next commit
[DevTools] Removed unnecessary try-catch blocks around Popover API me…
…thod calls in the TraceUpdates canvas implementation.
  • Loading branch information
yongsk0066 committed Mar 20, 2025
commit 9c21b1e9cd563bb45f730db6d10b751ff97a1b36
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ function drawWeb(nodeToData: Map<HostInstance, Data>) {
if (canvas === null) {
initialize();
} else {
try {
if (!canvas.matches(':popover-open')) {
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
}
} catch (e) {}
if (!canvas.matches(':popover-open')) {
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
}
}

const dpr = window.devicePixelRatio || 1;
Expand Down Expand Up @@ -211,11 +209,9 @@ function destroyNative(agent: Agent) {

function destroyWeb() {
if (canvas !== null) {
try {
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.hidePopover();
} catch (e) {}
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.hidePopover();

// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API and loses canvas nullability tracking
if (canvas.parentNode != null) {
Expand Down Expand Up @@ -253,9 +249,7 @@ function initialize(): void {
const root = window.document.documentElement;
root.insertBefore(canvas, root.firstChild);

try {
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
} catch (e) {}
// $FlowFixMe[prop-missing]: Flow doesn't recognize Popover API
// $FlowFixMe[incompatible-use]: Flow doesn't recognize Popover API
canvas.showPopover();
}
Loading