Skip to content

Commit

Permalink
Remove CatchAll Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisSigrist committed Oct 12, 2023
1 parent 030e1fd commit 55cbf3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/compiler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof parse>} parsed */
const addToDictionary = (parsed) => {
Expand All @@ -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,
Expand Down

0 comments on commit 55cbf3e

Please sign in to comment.