nested props: cheaper regexp
This commit is contained in:
parent
f99278c36a
commit
449a0f6198
1 changed files with 11 additions and 1 deletions
|
|
@ -407,7 +407,17 @@ class Widget extends EventEmitter {
|
|||
|
||||
if (typeof propValue == 'string') {
|
||||
|
||||
propValue = propValue.replace(/@\{(?:[^{}]|[^{]*(@\{[^{}]*\})[^}]*)*\}/g, (m, nested)=>{
|
||||
propValue = propValue.replace(/@\{[^{}]*(@\{[^{}]*\})*[^{}]*\}/g, (m, nested)=>{
|
||||
// pretty regexp:
|
||||
// @\{
|
||||
// [^{}]*
|
||||
// (
|
||||
// @\{
|
||||
// [^{}]*
|
||||
// \}
|
||||
// )*
|
||||
// [^{}]*
|
||||
// \}
|
||||
|
||||
if (nested) {
|
||||
m = m.replace(nested, this.resolveProp(propName, nested, storeLinks ? 'nested' : false, this))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue