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

feat(parser): throw error when using interpolation instead of expresssion (#9038) #9050

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

kamilchlebek
Copy link

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

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)

Yes it's already an open issue with good first issue label. Resolves: #9038

// Fixes: #9038
if(process.env.NODE_ENV !== 'production'){
const slotName = el.attrsMap['name']
if(!dirRE.test(slotName) && parseText(slotName, delimiters)){
Copy link
Member

Choose a reason for hiding this comment

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

Why dirRE.test here? Seems unnecessary.

Copy link
Author

Choose a reason for hiding this comment

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

I've added this to keep the same behavior as in place where previous warning exists (line 596). As you can see that previous warning is shown only when dirRE.test is false.

processSlot is executed outside of processAttrs thus I've added this additional check, to prevent double warnings

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.

Throw error when using interpolation instead of JS expression for slot names
2 participants