From 579201945e193e21e6ae2c0657b95a43c5260efb Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Mon, 4 Aug 2025 04:05:17 -0400 Subject: [PATCH] [fix] Replace ES2023 toReversed() with ES2022-compatible implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced array.toReversed() method calls with backwards iteration loops to maintain compatibility with ES2022 target in TypeScript configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/litegraph/src/LGraph.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/lib/litegraph/src/LGraph.ts b/src/lib/litegraph/src/LGraph.ts index ce6d8ff84..55c75107b 100644 --- a/src/lib/litegraph/src/LGraph.ts +++ b/src/lib/litegraph/src/LGraph.ts @@ -1054,7 +1054,14 @@ export class LGraph implements LinkNetwork, BaseLGraph, Serialisable g.isPointInside(x, y)) + // Iterate backwards through groups to find top-most + for (let i = this._groups.length - 1; i >= 0; i--) { + const group = this._groups[i] + if (group.isPointInside(x, y)) { + return group + } + } + return undefined } /** @@ -1064,7 +1071,14 @@ export class LGraph implements LinkNetwork, BaseLGraph, Serialisable g.isPointInTitlebar(x, y)) + // Iterate backwards through groups to find top-most + for (let i = this._groups.length - 1; i >= 0; i--) { + const group = this._groups[i] + if (group.isPointInTitlebar(x, y)) { + return group + } + } + return undefined } /**