From: Carlos Rodrigues Date: Wed, 16 Oct 2019 14:46:41 +0000 (+0100) Subject: refactor(compiler-core): avoid has call (#314) X-Git-Tag: v3.0.0-alpha.0~401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6607edab2da8c03ffd525ef5caaf2dfb3c581de2;p=thirdparty%2Fvuejs%2Fcore.git refactor(compiler-core): avoid has call (#314) --- diff --git a/packages/compiler-core/src/transforms/hoistStatic.ts b/packages/compiler-core/src/transforms/hoistStatic.ts index 733c903fbc..ecadeddff4 100644 --- a/packages/compiler-core/src/transforms/hoistStatic.ts +++ b/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) {