From 55cbf3e5f7ea9ff7503400c535540eb2d4a61df5 Mon Sep 17 00:00:00 2001 From: Loris Sigrist Date: Thu, 12 Oct 2023 10:36:23 +0200 Subject: [PATCH] Remove CatchAll Bug --- src/core/compiler/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/compiler/index.js b/src/core/compiler/index.js index c0236aa..02ed9b3 100644 --- a/src/core/compiler/index.js +++ b/src/core/compiler/index.js @@ -20,7 +20,7 @@ export function compileToDictionary(keyVal, locale) { const invalidKeys = new Set(); for (const [translationKey, messageSource] of keyVal.entries()) { - const markKeyInvalid = () => void invalidKeys.add(translationKey); + const markKeyAsInvalid = () => void invalidKeys.add(translationKey); /** @param {ReturnType} parsed */ const addToDictionary = (parsed) => { @@ -34,7 +34,7 @@ export function compileToDictionary(keyVal, locale) { new ResultMatcher(parse) .ok(addToDictionary) - .catchAll(markKeyInvalid) + .catch(SyntaxError, markKeyAsInvalid) .run(messageSource, { shouldParseSkeletons: true, requiresOtherClause: false,