Skip to content

Commit 6607eda

Browse files
pikaxyyx990803
authored andcommitted
refactor(compiler-core): avoid has call (vuejs#314)
1 parent b20b922 commit 6607eda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/compiler-core/src/transforms/hoistStatic.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ function isStaticNode(
116116
if (node.tagType !== ElementTypes.ELEMENT) {
117117
return false
118118
}
119-
if (resultCache.has(node)) {
120-
return resultCache.get(node)!
119+
const cached = resultCache.get(node)
120+
if (cached !== undefined) {
121+
return cached
121122
}
122123
const flag = getPatchFlag(node)
123124
if (!flag || flag === PatchFlags.TEXT) {

0 commit comments

Comments
 (0)