From 69dedfe427b2c7efb2aa9f99fc856a5ac9d33aee Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 8 Aug 2025 18:10:57 -0400 Subject: [PATCH] fix(Reroute): remove unsafe this alias in computeRenderParams; capture id and use it inside helper Replaces thisObj.id with captured id to avoid temporal dead zone, matches calculateAngle pattern, and removes no-this-alias workaround. --- src/lib/litegraph/src/Reroute.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/litegraph/src/Reroute.ts b/src/lib/litegraph/src/Reroute.ts index d462e620f..84c7babd2 100644 --- a/src/lib/litegraph/src/Reroute.ts +++ b/src/lib/litegraph/src/Reroute.ts @@ -546,6 +546,7 @@ export class Reroute linkStart: Point ): { cos: number; sin: number; controlPoint: Point } { const thisPos = this.#pos + const { id } = this const angles: number[] = [] let sum = 0 @@ -584,17 +585,13 @@ export class Reroute ) { for (const linkId of linkIds) { const link = links.get(linkId) - const pos = getNextPos(network, link, thisObj.id) + const pos = getNextPos(network, link, id) if (!pos) continue const angle = getDirection(thisPos, pos) angles.push(angle) sum += angle } } - - // Preserve lexical `this` values inside helper - // eslint-disable-next-line @typescript-eslint/no-this-alias - const thisObj = this } /**