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]) {