Skip to content

Commit

Permalink
babel-parser: Deep freeze for makeErrorTemplates (#13142)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Apr 13, 2021
1 parent f2ca928 commit 23693e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/error.js
Expand Up @@ -36,11 +36,11 @@ export function makeErrorTemplates(
): ErrorTemplates {
const templates: ErrorTemplates = {};
Object.keys(messages).forEach(reasonCode => {
templates[reasonCode] = {
templates[reasonCode] = Object.freeze({
code,
reasonCode,
template: messages[reasonCode],
};
});
});
return Object.freeze(templates);
}
Expand Down

0 comments on commit 23693e2

Please sign in to comment.