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(compiler-core): dedupe renderSlot's default props #4557

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

HerringtonDarkholme
Copy link
Member

This patch fix the duplicated default props inrenderSlot code generation and simplifies the logic by splicing a default argument array.

Minimal reproduction

renderSlot takes at most 5 arguments but the compiler generates 6.
image

Note the last argument true should follow immediately after the fallback function.

image

It looks like an accidental bug that default slotProps is pushed twice when children are defined and SFC has no slotted selector.

image

Instead we can provide a default arg array, set arguments in their position if defined, and finally splice the array to remove unused args.

@yyx990803 yyx990803 merged commit 0448125 into vuejs:master Sep 21, 2021
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