Skip to content

Conversation

@phanan
Copy link
Member

@phanan phanan commented Oct 6, 2016

The current forAliasRE has the first rule greedy ((.*)), which will attempt to match whatever it can. This exposes a bug (#3846), where the regex fails if the template happens to have " in " or " of " in its last group. For instance, with the template for key in [{body: 'Hey in body'}], current regex will capture the last group as body'}] instead of [{body: 'Hey in body'}]. This commit aims to fix this issue by making the first rule lazy instead.

I don't think this really needs a test, but let me know if it does.

The current forAliasRE has the first rule greedy (`.*?`), which will
attempt to match whatever it can. This exposes a bug (vuejs#3846), where the
regex fails if the template happens to have " in " or " of " in its last
group. For instance, with the template `for key in [{body: 'Hey in
body'}]`, current regex will capture the last group as `body'}]` instead
of `[{body: 'Hey in body'}]`. This commit aims to fix this issue by
making the first rule lazy instead.
@yyx990803 yyx990803 merged commit adae5ca into vuejs:dev Oct 7, 2016
@phanan phanan deleted the fixForRegex branch October 8, 2016 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants