fix(compiler-core): bail static stringfication even threshold is met (#1298)
fix #1128
This commit is contained in:
@@ -225,4 +225,28 @@ describe('stringify static html', () => {
|
||||
type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
|
||||
})
|
||||
})
|
||||
|
||||
test('should bail on non attribute bindings', () => {
|
||||
const { ast } = compileWithStringify(
|
||||
`<div><div>${repeat(
|
||||
`<span class="foo">foo</span>`,
|
||||
StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
|
||||
)}<input indeterminate></div></div>`
|
||||
)
|
||||
expect(ast.hoists.length).toBe(1)
|
||||
expect(ast.hoists[0]).toMatchObject({
|
||||
type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
|
||||
})
|
||||
|
||||
const { ast: ast2 } = compileWithStringify(
|
||||
`<div><div>${repeat(
|
||||
`<span class="foo">foo</span>`,
|
||||
StringifyThresholds.ELEMENT_WITH_BINDING_COUNT
|
||||
)}<input :indeterminate="true"></div></div>`
|
||||
)
|
||||
expect(ast2.hoists.length).toBe(1)
|
||||
expect(ast2.hoists[0]).toMatchObject({
|
||||
type: NodeTypes.VNODE_CALL // not CALL_EXPRESSION
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user