Explorar o código

refactor(compiler-core): avoid has call (#314)

Carlos Rodrigues %!s(int64=6) %!d(string=hai) anos
pai
achega
6607edab2d
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      packages/compiler-core/src/transforms/hoistStatic.ts

+ 3 - 2
packages/compiler-core/src/transforms/hoistStatic.ts

@@ -116,8 +116,9 @@ function isStaticNode(
       if (node.tagType !== ElementTypes.ELEMENT) {
         return false
       }
-      if (resultCache.has(node)) {
-        return resultCache.get(node)!
+      const cached = resultCache.get(node)
+      if (cached !== undefined) {
+        return cached
       }
       const flag = getPatchFlag(node)
       if (!flag || flag === PatchFlags.TEXT) {