`)
})
+ test('empty attribute should not produce syntax error', () => {
+ // previously this would produce syntax error `default: _withCtx((, _push, ...)`
+ expect(compile(`<foo v-slot="">foo</foo>`).code).not.toMatch(`(,`)
+ })
+
test('named slots', () => {
expect(
compile(`<foo>
CallExpression,
JSChildNode,
RESOLVE_DYNAMIC_COMPONENT,
- TRANSITION
+ TRANSITION,
+ stringifyExpression
} from '@vue/compiler-dom'
import { SSR_RENDER_COMPONENT, SSR_RENDER_VNODE } from '../runtimeHelpers'
import {
wipMap.set(node, wipEntries)
const buildSSRSlotFn: SlotFnBuilder = (props, children, loc) => {
+ const param0 = (props && stringifyExpression(props)) || `_`
const fn = createFunctionExpression(
- [props || `_`, `_push`, `_parent`, `_scopeId`],
+ [param0, `_push`, `_parent`, `_scopeId`],
undefined, // no return, assign body later
true, // newline
true, // isSlot