Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): fixed dynamicArgAttribute RegExp #9785

Merged
merged 3 commits into from
Sep 21, 2020
Merged

fix(parser): fixed dynamicArgAttribute RegExp #9785

merged 3 commits into from
Sep 21, 2020

Conversation

shasharoman
Copy link
Contributor

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
fixed #9781.

code explain:

const before = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
const after = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;

let s = ' #[foo]>foo</template><template #[bar]>bar</template>';

let beforeMatch = s.match(before);
let afterMatch = s.match(after);

console.log(beforeMatch[0]);     // '#[foo]>foo</template><template #[bar]'
console.log(afterMatch[0]);        // '#[foo]'

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this?
You can add to the commit message body (not the first line) fixes #9785. That way, mergin this pr will automatically close the issue

@shasharoman
Copy link
Contributor Author

Could you add a test for this?
You can add to the commit message body (not the first line) fixes #9785. That way, mergin this pr will automatically close the issue

A new test case for this has been included, and I will try use it(fixes #xxx) next time, thank you.

@vuejs vuejs deleted a comment Mar 29, 2019
@tanasebutcaru
Copy link

I can confirm that this fixes #9781.
Thank you, @shasharoman!

@SimplyThomas
Copy link

@posva @yyx990803

Has there been any progress on this? I had to pin Vue to 2.6.9 until this gets released.

Thanks. :)

@davis90
Copy link

davis90 commented Jan 22, 2020

Hi everyone!

What new about this ? I still have the problem in 2.6.11 reproduce here

@posva posva merged commit 67825c2 into vuejs:dev Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error using multiple dynamic slot names (Invalid dynamic argument expression)
5 participants