-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
fix(compiler-sfc): fix scope handling for props destructure in function parameters and catch clauses #12792
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 8000 related emails.
Already on GitHub? Sign in to your account
Conversation
Size ReportBundles
Usages
|
❌ Deploy Preview for vue-sfc-playground failed. Why did it fail? →
|
❌ Deploy Preview for vue-next-template-explorer failed. Why did it fail? →
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
WalkthroughThe changes add a new test to verify proper handling of variable shadowing between destructured props and function parameters in Vue's Changes
Sequence Diagram(s)sequenceDiagram
participant UserScript as User's <script setup>
participant Compiler as SFC Compiler
participant AST as AST Walker
UserScript->>Compiler: Contains destructured prop and function with same param name
Compiler->>AST: Traverse AST nodes
AST->>AST: Enter function, block, and catch clause scopes
AST->>AST: Pop scope on leaving function, block, or catch clause
AST->>Compiler: Correctly resolve prop vs. parameter references
Compiler->>UserScript: Outputs compiled code with correct variable references
Assessment against linked issues
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (2)packages/compiler-sfc/src/script/definePropsDestructure.ts (1)
packages/compiler-sfc/__tests__/compileScript/definePropsDestructure.spec.ts (1)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
close #12790
Summary by CodeRabbit
Bug Fixes
Tests