refactor(compiler): rename INTERPOLATION_BLACKLIST_REGEXPS (#29593)
PR Close #29593
This commit is contained in:
parent
1c07061246
commit
3487055d10
|
@ -20,7 +20,7 @@ export function assertArrayOfStrings(identifier: string, value: any) {
|
|||
}
|
||||
}
|
||||
|
||||
const INTERPOLATION_BLACKLIST_REGEXPS = [
|
||||
const UNUSABLE_INTERPOLATION_REGEXPS = [
|
||||
/^\s*$/, // empty
|
||||
/[<>]/, // html tag
|
||||
/^[{}]$/, // i18n expansion
|
||||
|
@ -34,8 +34,8 @@ export function assertInterpolationSymbols(identifier: string, value: any): void
|
|||
} else if (value != null) {
|
||||
const start = value[0] as string;
|
||||
const end = value[1] as string;
|
||||
// black list checking
|
||||
INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {
|
||||
// Check for unusable interpolation symbols
|
||||
UNUSABLE_INTERPOLATION_REGEXPS.forEach(regexp => {
|
||||
if (regexp.test(start) || regexp.test(end)) {
|
||||
throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue