mirror of https://github.com/vuejs/core.git
test: skip optimizing single text root
This commit is contained in:
parent
46490ac1a5
commit
a984d3a531
|
@ -56,12 +56,14 @@ export const transformText: NodeTransform = (node, context) => {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!hasText ||
|
!hasText ||
|
||||||
// if this is a plain element with a single text child, leave it as-is
|
// if this is a plain element with a single text child, leave it
|
||||||
// since the runtime has dedicated fast path for this by directly
|
// as-is since the runtime has dedicated fast path for this by directly
|
||||||
// setting textContent of the element.
|
// setting textContent of the element.
|
||||||
|
// for component root it's always normalized anyway.
|
||||||
|
(children.length === 1 &&
|
||||||
|
(node.type === NodeTypes.ROOT ||
|
||||||
(node.type === NodeTypes.ELEMENT &&
|
(node.type === NodeTypes.ELEMENT &&
|
||||||
node.tagType === ElementTypes.ELEMENT &&
|
node.tagType === ElementTypes.ELEMENT)))
|
||||||
children.length === 1)
|
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue