]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(compiler-core): avoid has call (#314)
authorCarlos Rodrigues <david-181@hotmail.com>
Wed, 16 Oct 2019 14:46:41 +0000 (15:46 +0100)
committerEvan You <yyx990803@gmail.com>
Wed, 16 Oct 2019 14:46:41 +0000 (10:46 -0400)
packages/compiler-core/src/transforms/hoistStatic.ts

index 733c903fbcc9a72d1c986a9ae4fdf81ee714fa95..ecadeddff43b5f647b6a93113ba4b6abecf99823 100644 (file)
@@ -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) {