Repository navigation
fix(compiler-vapor): do not cache member expressions with unsupported keys - #15540
edison1105 merged 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
@copilot resolve the merge conflicts in this pull request |
… keys A computed key that cannot be extracted produced a truncated member name, so repeating the expression emitted invalid or incorrect code.
679c2a2 to
86d42b4
Compare
Compiling this throws
SyntaxError: Unexpected token.Other shapes fail silently instead:
obj[[foo][0]]compiles to_ctx.obj[[0]]andobj[foo(bar ? 1 : 2)]to_ctx.obj[_ctx.foo()], dropping part of the key.extractMemberExpressionreturned''for any node it does not handle, so a conditional, template literal or logical key collapsed the member name toobj[]— or, nested deeper, quietly vanished from the generated source. It now returnsundefined, and that "unsupported" result propagates through the recursion up toanalyzeExpressions.Such keys are simply no longer cached as a member name; the whole expression is still cached when it repeats.