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 authored and JLHwung committed Apr 16, 2021
1 parent 06776e1 commit 89590d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/error.js
Original file line number Diff line number Diff line change
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 89590d1

Please sign in to comment.