fix(compiler-core): bail static stringfication even threshold is met (#1298)

fix #1128
This commit is contained in:
Zardddddd60
2020-06-10 04:26:03 +08:00
committed by GitHub
parent 215c106297
commit 64ec8bfb54
2 changed files with 24 additions and 6 deletions

View File

@@ -189,16 +189,10 @@ function analyzeNode(node: StringifiableNode): [number, number] | false {
}
for (let i = 0; i < node.children.length; i++) {
nc++
if (nc >= StringifyThresholds.NODE_COUNT) {
return true
}
const child = node.children[i]
if (child.type === NodeTypes.ELEMENT) {
if (child.props.length > 0) {
ec++
if (ec >= StringifyThresholds.ELEMENT_WITH_BINDING_COUNT) {
return true
}
}
walk(child)
if (bailed) {