Skip to content

Commit 7603545

Browse files
authored
Merge branch 'main' into readonly-template-ref-no-set
2 parents db8a3c1 + 0562548 commit 7603545

File tree

86 files changed

+1882
-957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1882
-957
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
- name: Run prettier
3232
run: pnpm run format
3333

34-
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
34+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ jobs:
3636
- name: Install deps
3737
run: pnpm install
3838

39+
- name: Update npm
40+
run: npm i -g npm@latest
41+
3942
- name: Build and publish
4043
id: publish
4144
run: |
4245
pnpm release --publishOnly
43-
env:
44-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4546
4647
- name: Create GitHub release
4748
id: release_tag

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## [3.5.18](https://github.com/vuejs/core/compare/v3.5.17...v3.5.18) (2025-07-23)
2+
3+
4+
### Bug Fixes
5+
6+
* **compiler-core:** avoid cached text vnodes retaining detached DOM nodes ([#13662](https://github.com/vuejs/core/issues/13662)) ([00695a5](https://github.com/vuejs/core/commit/00695a5b41b2d032deaeada83831ff83aa6bfd4e)), closes [#13661](https://github.com/vuejs/core/issues/13661)
7+
* **compiler-core:** avoid self updates of `v-pre` ([#12556](https://github.com/vuejs/core/issues/12556)) ([21b685a](https://github.com/vuejs/core/commit/21b685ad9d9d0e6060fc7d07b719bf35f2d9ae1f))
8+
* **compiler-core:** identifiers in function parameters should not be inferred as references ([#13548](https://github.com/vuejs/core/issues/13548)) ([9b02923](https://github.com/vuejs/core/commit/9b029239edf88558465b941e1e4c085f92b1ebff))
9+
* **compiler-core:** recognize empty string as non-identifier ([#12553](https://github.com/vuejs/core/issues/12553)) ([ce93339](https://github.com/vuejs/core/commit/ce933390ad1c72bed258f7ad959a78f0e8acdf57))
10+
* **compiler-core:** transform empty `v-bind` dynamic argument content correctly ([#12554](https://github.com/vuejs/core/issues/12554)) ([d3af67e](https://github.com/vuejs/core/commit/d3af67e878790892f9d34cfea15d13625aabe733))
11+
* **compiler-sfc:** transform empty srcset w/ includeAbsolute: true ([#13639](https://github.com/vuejs/core/issues/13639)) ([d8e40ef](https://github.com/vuejs/core/commit/d8e40ef7e1c20ee86b294e7cf78e2de60d12830e)), closes [vitejs/vite-plugin-vue#631](https://github.com/vitejs/vite-plugin-vue/issues/631)
12+
* **css-vars:** nullish v-bind in style should not lead to unexpected inheritance ([#12461](https://github.com/vuejs/core/issues/12461)) ([c85f1b5](https://github.com/vuejs/core/commit/c85f1b5a132eb8ec25f71b250e25e65a5c20964f)), closes [#12434](https://github.com/vuejs/core/issues/12434) [#12439](https://github.com/vuejs/core/issues/12439) [#7474](https://github.com/vuejs/core/issues/7474) [#7475](https://github.com/vuejs/core/issues/7475)
13+
* **custom-element:** ensure exposed methods are accessible from custom elements by making them enumerable ([#13634](https://github.com/vuejs/core/issues/13634)) ([90573b0](https://github.com/vuejs/core/commit/90573b06bf6fb6c14c6bbff6c4e34e0ab108953a)), closes [#13632](https://github.com/vuejs/core/issues/13632)
14+
* **hydration:** prevent lazy hydration for updated components ([#13511](https://github.com/vuejs/core/issues/13511)) ([a9269c6](https://github.com/vuejs/core/commit/a9269c642bf944560bc29adb5dae471c11cd9ee8)), closes [#13510](https://github.com/vuejs/core/issues/13510)
15+
* **runtime-core:** ensure correct anchor el for unresolved async components ([#13560](https://github.com/vuejs/core/issues/13560)) ([7f29943](https://github.com/vuejs/core/commit/7f2994393dcdb82cacbf62e02b5ba5565f32588b)), closes [#13559](https://github.com/vuejs/core/issues/13559)
16+
* **slots:** refine internal key checking to support slot names starting with an underscore ([#13612](https://github.com/vuejs/core/issues/13612)) ([c5f7db1](https://github.com/vuejs/core/commit/c5f7db11542bb2246363aef78c88a8e6cef0ee93)), closes [#13611](https://github.com/vuejs/core/issues/13611)
17+
* **ssr:** ensure empty slots render as a comment node in Transition ([#13396](https://github.com/vuejs/core/issues/13396)) ([8cfc10a](https://github.com/vuejs/core/commit/8cfc10a80b9cbf5d801ab149e49b8506d192e7e1)), closes [#13394](https://github.com/vuejs/core/issues/13394)
18+
19+
20+
21+
## [3.5.17](https://github.com/vuejs/core/compare/v3.5.16...v3.5.17) (2025-06-18)
22+
23+
24+
### Bug Fixes
25+
26+
* **compat:** allow v-model built in modifiers on component ([#12654](https://github.com/vuejs/core/issues/12654)) ([cb14b86](https://github.com/vuejs/core/commit/cb14b860f150c4a83bcd52cd26096b7a5aa3a2bf)), closes [#12652](https://github.com/vuejs/core/issues/12652)
27+
* **compile-sfc:** handle mapped types work with omit and pick ([#12648](https://github.com/vuejs/core/issues/12648)) ([4eb46e4](https://github.com/vuejs/core/commit/4eb46e443f1878199755cb73d481d318a9714392)), closes [#12647](https://github.com/vuejs/core/issues/12647)
28+
* **compiler-core:** do not increase newlines in `InEntity` state ([#13362](https://github.com/vuejs/core/issues/13362)) ([f05a8d6](https://github.com/vuejs/core/commit/f05a8d613bd873b811cfdb9979ccac8382dba322))
29+
* **compiler-core:** ignore whitespace when matching adjacent v-if ([#12321](https://github.com/vuejs/core/issues/12321)) ([10ebcef](https://github.com/vuejs/core/commit/10ebcef8c870dbc042b0ea49b1424b2e8f692145)), closes [#9173](https://github.com/vuejs/core/issues/9173)
30+
* **compiler-core:** prevent comments from blocking static node hoisting ([#13345](https://github.com/vuejs/core/issues/13345)) ([55dad62](https://github.com/vuejs/core/commit/55dad625acd9e9ddd5a933d5e323ecfdec1a612f)), closes [#13344](https://github.com/vuejs/core/issues/13344)
31+
* **compiler-sfc:** improved type resolution for function type aliases ([#13452](https://github.com/vuejs/core/issues/13452)) ([f3479aa](https://github.com/vuejs/core/commit/f3479aac9625f4459e650d1c0a70e73863147903)), closes [#13444](https://github.com/vuejs/core/issues/13444)
32+
* **custom-element:** ensure configureApp is applied to async component ([#12607](https://github.com/vuejs/core/issues/12607)) ([5ba1afb](https://github.com/vuejs/core/commit/5ba1afba09c3ea56c1c17484f5d8aeae210ce52a)), closes [#12448](https://github.com/vuejs/core/issues/12448)
33+
* **custom-element:** prevent injecting child styles if shadowRoot is false ([#12769](https://github.com/vuejs/core/issues/12769)) ([73055d8](https://github.com/vuejs/core/commit/73055d8d9578d485e3fe846726b50666e1aa56f5)), closes [#12630](https://github.com/vuejs/core/issues/12630)
34+
* **reactivity:** add `__v_skip` flag to `Dep` to prevent reactive conversion ([#12804](https://github.com/vuejs/core/issues/12804)) ([e8d8f5f](https://github.com/vuejs/core/commit/e8d8f5f604e821acc46b4200d5b06979c05af1c2)), closes [#12803](https://github.com/vuejs/core/issues/12803)
35+
* **runtime-core:** unset old ref during patching when new ref is absent ([#12900](https://github.com/vuejs/core/issues/12900)) ([47ddf98](https://github.com/vuejs/core/commit/47ddf986021dff8de68b0da72787e53a6c19de4c)), closes [#12898](https://github.com/vuejs/core/issues/12898)
36+
* **slots:** make cache indexes marker non-enumerable ([#13469](https://github.com/vuejs/core/issues/13469)) ([919c447](https://github.com/vuejs/core/commit/919c44744bba1f0c661c87d2059c3b429611aa7e)), closes [#13468](https://github.com/vuejs/core/issues/13468)
37+
* **ssr:** handle initial selected state for select with v-model + v-for/v-if option ([#13487](https://github.com/vuejs/core/issues/13487)) ([1552095](https://github.com/vuejs/core/commit/15520954f9f1c7f834175938a50dba5d4be0e6c4)), closes [#13486](https://github.com/vuejs/core/issues/13486)
38+
* **types:** typo of `vOnce` and `vSlot` ([#13343](https://github.com/vuejs/core/issues/13343)) ([762fae4](https://github.com/vuejs/core/commit/762fae4b57ad60602e5c84465a3bff562785b314))
39+
40+
41+
142
## [3.5.16](https://github.com/vuejs/core/compare/v3.5.15...v3.5.16) (2025-05-29)
243

344

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.5.16",
4-
"packageManager": "pnpm@10.11.1",
3+
"version": "3.5.18",
4+
"packageManager": "pnpm@10.13.1",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -65,21 +65,21 @@
6565
"@babel/parser": "catalog:",
6666
"@babel/types": "catalog:",
6767
"@rollup/plugin-alias": "^5.1.1",
68-
"@rollup/plugin-commonjs": "^28.0.3",
68+
"@rollup/plugin-commonjs": "^28.0.6",
6969
"@rollup/plugin-json": "^6.1.0",
7070
"@rollup/plugin-node-resolve": "^16.0.1",
7171
"@rollup/plugin-replace": "5.0.4",
72-
"@swc/core": "^1.11.29",
72+
"@swc/core": "^1.13.1",
7373
"@types/hash-sum": "^1.0.2",
74-
"@types/node": "^22.15.29",
74+
"@types/node": "^22.16.5",
7575
"@types/semver": "^7.7.0",
7676
"@types/serve-handler": "^6.1.4",
7777
"@vitest/coverage-v8": "^3.1.4",
7878
"@vitest/eslint-plugin": "^1.2.1",
7979
"@vue/consolidate": "1.0.0",
8080
"conventional-changelog-cli": "^5.0.0",
8181
"enquirer": "^2.4.1",
82-
"esbuild": "^0.25.5",
82+
"esbuild": "^0.25.8",
8383
"esbuild-plugin-polyfill-node": "^0.3.0",
8484
"eslint": "^9.27.0",
8585
"eslint-plugin-import-x": "^4.13.1",
@@ -97,7 +97,7 @@
9797
"pug": "^3.0.3",
9898
"puppeteer": "~24.9.0",
9999
"rimraf": "^6.0.1",
100-
"rollup": "^4.41.1",
100+
"rollup": "^4.45.1",
101101
"rollup-plugin-dts": "^6.2.1",
102102
"rollup-plugin-esbuild": "^6.2.1",
103103
"rollup-plugin-polyfill-node": "^0.13.0",

packages-private/sfc-playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"vite": "catalog:"
1414
},
1515
"dependencies": {
16-
"@vue/repl": "^4.5.1",
16+
"@vue/repl": "^4.6.2",
1717
"file-saver": "^2.0.5",
1818
"jszip": "^3.10.1",
1919
"vue": "workspace:*"

packages-private/sfc-playground/src/App.vue

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Header from './Header.vue'
33
import { Repl, useStore, SFCOptions, useVueImportMap } from '@vue/repl'
44
import Monaco from '@vue/repl/monaco-editor'
5-
import { ref, watchEffect, onMounted, computed } from 'vue'
5+
import { ref, watchEffect, onMounted, computed, watch } from 'vue'
66
77
const replRef = ref<InstanceType<typeof Repl>>()
88
@@ -115,6 +115,34 @@ onMounted(() => {
115115
// @ts-expect-error process shim for old versions of @vue/compiler-sfc dependency
116116
window.process = { env: {} }
117117
})
118+
119+
const isVaporSupported = ref(false)
120+
watch(
121+
() => store.vueVersion,
122+
(version, oldVersion) => {
123+
const [major, minor] = (version || store.compiler.version)
124+
.split('.')
125+
.map((v: string) => parseInt(v, 10))
126+
isVaporSupported.value = major > 3 || (major === 3 && minor >= 6)
127+
if (oldVersion) reloadPage()
128+
},
129+
{ immediate: true, flush: 'pre' },
130+
)
131+
132+
const previewOptions = computed(() => ({
133+
customCode: {
134+
importCode: `import { initCustomFormatter${isVaporSupported.value ? ', vaporInteropPlugin' : ''} } from 'vue'`,
135+
useCode: `
136+
${isVaporSupported.value ? 'app.use(vaporInteropPlugin)' : ''}
137+
if (window.devtoolsFormatters) {
138+
const index = window.devtoolsFormatters.findIndex((v) => v.__vue_custom_formatter)
139+
window.devtoolsFormatters.splice(index, 1)
140+
initCustomFormatter()
141+
} else {
142+
initCustomFormatter()
143+
}`,
144+
},
145+
}))
118146
</script>
119147

120148
<template>
@@ -141,20 +169,11 @@ onMounted(() => {
141169
:editorOptions="{ autoSaveText: false }"
142170
:store="store"
143171
:showCompileOutput="true"
172+
:showSsrOutput="useSSRMode"
173+
:showOpenSourceMap="true"
144174
:autoResize="true"
145175
:clearConsole="false"
146-
:preview-options="{
147-
customCode: {
148-
importCode: `import { initCustomFormatter } from 'vue'`,
149-
useCode: `if (window.devtoolsFormatters) {
150-
const index = window.devtoolsFormatters.findIndex((v) => v.__vue_custom_formatter)
151-
window.devtoolsFormatters.splice(index, 1)
152-
initCustomFormatter()
153-
} else {
154-
initCustomFormatter()
155-
}`,
156-
},
157-
}"
176+
:preview-options="previewOptions"
158177
/>
159178
</template>
160179

packages/compiler-core/__tests__/transforms/__snapshots__/cacheStatic.spec.ts.snap

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ return function render(_ctx, _cache) {
77
with (_ctx) {
88
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
99
10-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
10+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
1111
_createElementVNode("div", { key: "foo" }, null, -1 /* CACHED */)
12-
])))
12+
]))]))
1313
}
1414
}"
1515
`;
@@ -21,7 +21,7 @@ return function render(_ctx, _cache) {
2121
with (_ctx) {
2222
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
2323
24-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
24+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
2525
_createElementVNode("p", null, [
2626
_createElementVNode("span"),
2727
_createElementVNode("span")
@@ -30,7 +30,7 @@ return function render(_ctx, _cache) {
3030
_createElementVNode("span"),
3131
_createElementVNode("span")
3232
], -1 /* CACHED */)
33-
])))
33+
]))]))
3434
}
3535
}"
3636
`;
@@ -42,11 +42,11 @@ return function render(_ctx, _cache) {
4242
with (_ctx) {
4343
const { createCommentVNode: _createCommentVNode, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
4444
45-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
45+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
4646
_createElementVNode("div", null, [
4747
_createCommentVNode("comment")
4848
], -1 /* CACHED */)
49-
])))
49+
]))]))
5050
}
5151
}"
5252
`;
@@ -58,11 +58,11 @@ return function render(_ctx, _cache) {
5858
with (_ctx) {
5959
const { createElementVNode: _createElementVNode, createTextVNode: _createTextVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
6060
61-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
61+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
6262
_createElementVNode("span", null, null, -1 /* CACHED */),
63-
_createTextVNode("foo"),
63+
_createTextVNode("foo", -1 /* CACHED */),
6464
_createElementVNode("div", null, null, -1 /* CACHED */)
65-
])))
65+
]))]))
6666
}
6767
}"
6868
`;
@@ -74,9 +74,9 @@ return function render(_ctx, _cache) {
7474
with (_ctx) {
7575
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
7676
77-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
77+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
7878
_createElementVNode("span", { class: "inline" }, "hello", -1 /* CACHED */)
79-
])))
79+
]))]))
8080
}
8181
}"
8282
`;
@@ -147,9 +147,9 @@ return function render(_ctx, _cache) {
147147
with (_ctx) {
148148
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
149149
150-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
150+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
151151
_createElementVNode("span", null, "foo " + _toDisplayString(1) + " " + _toDisplayString(true), -1 /* CACHED */)
152-
])))
152+
]))]))
153153
}
154154
}"
155155
`;
@@ -161,9 +161,9 @@ return function render(_ctx, _cache) {
161161
with (_ctx) {
162162
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
163163
164-
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
164+
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
165165
_createElementVNode("span", { foo: 0 }, _toDisplayString(1), -1 /* CACHED */)
166-
])))
166+
]))]))
167167
}
168168
}"
169169
`;
@@ -215,9 +215,9 @@ return function render(_ctx, _cache) {
215215
const _directive_foo = _resolveDirective("foo")
216216
217217
return (_openBlock(), _createElementBlock("div", null, [
218-
_withDirectives((_openBlock(), _createElementBlock("svg", null, _cache[0] || (_cache[0] = [
218+
_withDirectives((_openBlock(), _createElementBlock("svg", null, [...(_cache[0] || (_cache[0] = [
219219
_createElementVNode("path", { d: "M2,3H5.5L12" }, null, -1 /* CACHED */)
220-
]))), [
220+
]))])), [
221221
[_directive_foo]
222222
])
223223
]))
@@ -401,9 +401,9 @@ return function render(_ctx, _cache) {
401401
402402
return (_openBlock(), _createElementBlock("div", null, [
403403
ok
404-
? (_openBlock(), _createElementBlock("div", _hoisted_1, _cache[0] || (_cache[0] = [
404+
? (_openBlock(), _createElementBlock("div", _hoisted_1, [...(_cache[0] || (_cache[0] = [
405405
_createElementVNode("span", null, null, -1 /* CACHED */)
406-
])))
406+
]))]))
407407
: _createCommentVNode("v-if", true)
408408
]))
409409
}
@@ -422,15 +422,15 @@ return function render(_ctx, _cache) {
422422
423423
return (_openBlock(), _createElementBlock(_Fragment, null, [
424424
_createCommentVNode("comment"),
425-
_createElementVNode("div", _hoisted_1, _cache[0] || (_cache[0] = [
425+
_createElementVNode("div", _hoisted_1, [...(_cache[0] || (_cache[0] = [
426426
_createElementVNode("div", { id: "b" }, [
427427
_createElementVNode("div", { id: "c" }, [
428428
_createElementVNode("div", { id: "d" }, [
429429
_createElementVNode("div", { id: "e" }, "hello")
430430
])
431431
])
432432
], -1 /* CACHED */)
433-
]))
433+
]))])
434434
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
435435
}
436436
}"
@@ -448,9 +448,9 @@ return function render(_ctx, _cache) {
448448
449449
return (_openBlock(), _createElementBlock("div", null, [
450450
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
451-
return (_openBlock(), _createElementBlock("div", _hoisted_1, _cache[0] || (_cache[0] = [
451+
return (_openBlock(), _createElementBlock("div", _hoisted_1, [...(_cache[0] || (_cache[0] = [
452452
_createElementVNode("span", null, null, -1 /* CACHED */)
453-
])))
453+
]))]))
454454
}), 256 /* UNKEYED_FRAGMENT */))
455455
]))
456456
}

packages/compiler-core/__tests__/transforms/cacheStatic.spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { PatchFlags } from '@vue/shared'
2727

2828
const cachedChildrenArrayMatcher = (
2929
tags: string[],
30-
needArraySpread = false,
30+
needArraySpread = true,
3131
) => ({
3232
type: NodeTypes.JS_CACHE_EXPRESSION,
3333
needArraySpread,
@@ -170,11 +170,6 @@ describe('compiler: cacheStatic transform', () => {
170170
{
171171
/* _ slot flag */
172172
},
173-
{
174-
type: NodeTypes.JS_PROPERTY,
175-
key: { content: '__' },
176-
value: { content: '[0]' },
177-
},
178173
],
179174
})
180175
})
@@ -202,11 +197,6 @@ describe('compiler: cacheStatic transform', () => {
202197
{
203198
/* _ slot flag */
204199
},
205-
{
206-
type: NodeTypes.JS_PROPERTY,
207-
key: { content: '__' },
208-
value: { content: '[0]' },
209-
},
210200
],
211201
})
212202
})

packages/compiler-core/__tests__/transforms/vIf.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,25 @@ describe('compiler: v-if', () => {
301301
])
302302
})
303303

304+
test('error on adjacent v-else', () => {
305+
const onError = vi.fn()
306+
307+
const {
308+
node: { branches },
309+
} = parseWithIfTransform(
310+
`<div v-if="false"/><div v-else/><div v-else/>`,
311+
{ onError },
312+
0,
313+
)
314+
315+
expect(onError.mock.calls[0]).toMatchObject([
316+
{
317+
code: ErrorCodes.X_V_ELSE_NO_ADJACENT_IF,
318+
loc: branches[branches.length - 1].loc,
319+
},
320+
])
321+
})
322+
304323
test('error on user key', () => {
305324
const onError = vi.fn()
306325
// dynamic

0 commit comments

Comments
 (0)