From 023454b49e6bf2a98804b91a12f84af2f653d128 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:33:59 +0900 Subject: [PATCH] fix passing of literal backslash (#16671) --- .../javascript/prompt-bracket-checker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f1f42fe7f0a..a59e584c26d 100644 --- a/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js +++ b/extensions-builtin/prompt-bracket-checker/javascript/prompt-bracket-checker.js @@ -4,11 +4,11 @@ // If there's a mismatch, the keyword counter turns red and if you hover on it, a tooltip tells you what's wrong. function checkBrackets(textArea, counterElt) { - var counts = {}; - (textArea.value.match(/(? { - counts[bracket] = (counts[bracket] || 0) + 1; + const counts = {}; + textArea.value.matchAll(/(? { + counts[bracket[1]] = (counts[bracket[1]] || 0) + 1; }); - var errors = []; + const errors = []; function checkPair(open, close, kind) { if (counts[open] !== counts[close]) {