]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
perf: skip hasScopeRef check if there are no scope vars
authorEvan You <yyx990803@gmail.com>
Wed, 16 Oct 2019 19:32:48 +0000 (15:32 -0400)
committerEvan You <yyx990803@gmail.com>
Wed, 16 Oct 2019 19:35:04 +0000 (15:35 -0400)
packages/compiler-core/src/transforms/vSlot.ts

index d39d15f45604a794ae3ce9de82e755616ffc72d1..94089f297fb911d842543f6b2e154853067937db 100644 (file)
@@ -342,7 +342,7 @@ function hasScopeRef(
   node: TemplateChildNode | IfBranchNode | SimpleExpressionNode | undefined,
   ids: TransformContext['identifiers']
 ): boolean {
-  if (!node) {
+  if (!node || Object.keys(ids).length === 0) {
     return false
   }
   switch (node.type) {