From 64df7037850caa85db8af731696014cd3bb2edad Mon Sep 17 00:00:00 2001 From: Alex Eyers-Taylor Date: Mon, 19 May 2025 10:59:01 +0100 Subject: [PATCH] JS: Fix perfomance issues in overlay mode. --- javascript/ql/lib/semmle/javascript/Tokens.qll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/Tokens.qll b/javascript/ql/lib/semmle/javascript/Tokens.qll index c6a9b05a3d1..5eef2e86b8d 100644 --- a/javascript/ql/lib/semmle/javascript/Tokens.qll +++ b/javascript/ql/lib/semmle/javascript/Tokens.qll @@ -28,8 +28,10 @@ class Token extends Locatable, @token { /** Gets the token following this token inside the same toplevel structure, if any. */ Token getNextToken() { - this.getTopLevel() = result.getTopLevel() and - this.getIndex() + 1 = result.getIndex() + exists (TopLevel topLevel, int index | + tokeninfo(this, _, topLevel, index, _) and + tokeninfo(result, _, topLevel, index + 1, _) + ) } /** Gets the token preceding this token inside the same toplevel structure, if any. */