Explorar el Código

perf: skip hasScopeRef check if there are no scope vars

Evan You hace 6 años
padre
commit
b980ddb607
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/compiler-core/src/transforms/vSlot.ts

+ 1 - 1
packages/compiler-core/src/transforms/vSlot.ts

@@ -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) {