From cd869bb7a35e6a3eb09b8fb48873e583f9e2eaf6 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:29:41 +0900 Subject: [PATCH] fix prompt-bracket-checker miscounting of literal tokens (#16669) --- .../prompt-bracket-checker/javascript/prompt-bracket-checker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js b/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js index 114cf94ccbf..f1f42fe7f0a 100644 --- a/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js +++ b/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js @@ -5,7 +5,7 @@ function checkBrackets(textArea, counterElt) { var counts = {}; - (textArea.value.match(/[(){}[\]]/g) || []).forEach(bracket => { + (textArea.value.match(/(? { counts[bracket] = (counts[bracket] || 0) + 1; }); var errors = [];