babel-parser: Deep freeze for makeErrorTemplates (#13142)

This commit is contained in:
Sosuke Suzuki 2021-04-13 09:08:26 +09:00 committed by Nicolò Ribaudo
parent 7484b51e56
commit c949660b34

View File

@ -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);
}