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
|
/^\s*$/, // empty
|
||||||
/[<>]/, // html tag
|
/[<>]/, // html tag
|
||||||
/^[{}]$/, // i18n expansion
|
/^[{}]$/, // i18n expansion
|
||||||
|
@ -34,8 +34,8 @@ export function assertInterpolationSymbols(identifier: string, value: any): void
|
||||||
} else if (value != null) {
|
} else if (value != null) {
|
||||||
const start = value[0] as string;
|
const start = value[0] as string;
|
||||||
const end = value[1] as string;
|
const end = value[1] as string;
|
||||||
// black list checking
|
// Check for unusable interpolation symbols
|
||||||
INTERPOLATION_BLACKLIST_REGEXPS.forEach(regexp => {
|
UNUSABLE_INTERPOLATION_REGEXPS.forEach(regexp => {
|
||||||
if (regexp.test(start) || regexp.test(end)) {
|
if (regexp.test(start) || regexp.test(end)) {
|
||||||
throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
|
throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue