[Reactivity Transform] $$
breaks the original semantics
#6312
Labels
feat: reactivityTransform
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
Vue version
v3.2.37
Link to minimal reproduction
https://sfc.vuejs.org/#eNo9TjsOwjAMvUpkdQAJErFWoRIbh8hSKpe2aj6yXRiq3p2kICb7ffz8VrilpF8LQg2WOxqTKEZZUuOCC10MLIrUVVWE/eFydKGqDpSHNV/zbrOCPs2tYEZK2eHS3HGeozV5K9a/DCcYfYokZ98mPXEM+e1ajtxPYAe12pnC5V4FOxhEEtfGcN+VshPrSE+TN01LkNGjRvbnB8U3I+VgByVic2GD7QP4UU0C
Steps to reproduce
Open the reproduction link, there's an error on SFC playground.
Cannot access 'r' before initialization
The code
is transformed to
We can see that
$$
is removed, and only brackets remain. It will break the original semantics.It's actually only one line code:
const r = _ref(1)(r)
.What is expected?
What is actually happening?
System Info
Any additional comments?
IMHO, the brackets should be removed to avoid changing the semantics when using
$$
function.The text was updated successfully, but these errors were encountered: