]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: shorten option name
authorEvan You <yyx990803@gmail.com>
Fri, 4 Oct 2019 13:03:00 +0000 (09:03 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 4 Oct 2019 13:03:00 +0000 (09:03 -0400)
packages/compiler-core/src/transform.ts
packages/compiler-core/src/transforms/hoistStatic.ts
packages/vue/src/index.ts

index 01ee0ff2c66c7e4e21f0ba79f3d9326f14c5eb78..5577f009ab811bd9c114ca5c4001c894c97dabbc 100644 (file)
@@ -16,7 +16,7 @@ import { isString, isArray } from '@vue/shared'
 import { CompilerError, defaultOnError } from './errors'
 import { TO_STRING, COMMENT, CREATE_VNODE, FRAGMENT } from './runtimeConstants'
 import { isVSlot, createBlockExpression, isSlotOutlet } from './utils'
-import { hoistStaticTrees } from './transforms/hoistStatic'
+import { hoistStatic } from './transforms/hoistStatic'
 
 // There are two types of transforms:
 //
@@ -51,7 +51,7 @@ export interface TransformOptions {
   nodeTransforms?: NodeTransform[]
   directiveTransforms?: { [name: string]: DirectiveTransform }
   prefixIdentifiers?: boolean
-  hoistStaticTrees?: boolean
+  hoistStatic?: boolean
   onError?: (error: CompilerError) => void
 }
 
@@ -83,7 +83,7 @@ function createTransformContext(
   root: RootNode,
   {
     prefixIdentifiers = false,
-    hoistStaticTrees = false,
+    hoistStatic = false,
     nodeTransforms = [],
     directiveTransforms = {},
     onError = defaultOnError
@@ -102,7 +102,7 @@ function createTransformContext(
       vOnce: 0
     },
     prefixIdentifiers,
-    hoistStaticTrees,
+    hoistStatic,
     nodeTransforms,
     directiveTransforms,
     onError,
@@ -204,8 +204,8 @@ function createTransformContext(
 export function transform(root: RootNode, options: TransformOptions) {
   const context = createTransformContext(root, options)
   traverseNode(root, context)
-  if (options.hoistStaticTrees) {
-    hoistStaticTrees(root, context)
+  if (options.hoistStatic) {
+    hoistStatic(root, context)
   }
   finalizeRoot(root, context)
 }
index 99594367d48ca345e7aa4db76ad2979efa9565b5..b783f9456352637b22af1d6f21a824f86d3534f1 100644 (file)
@@ -9,7 +9,7 @@ import { TransformContext } from '../transform'
 import { CREATE_VNODE } from '../runtimeConstants'
 import { PropsExpression } from './transformElement'
 
-export function hoistStaticTrees(root: RootNode, context: TransformContext) {
+export function hoistStatic(root: RootNode, context: TransformContext) {
   walk(root.children, context, new Set<TemplateChildNode>())
 }
 
index 98c4b59815f0a5dc44623e7052bc9c9e903cfb1b..d4604ad91df0b15670c59a108636b9a691ac146b 100644 (file)
@@ -8,7 +8,7 @@ function compileToFunction(
   options?: CompilerOptions
 ): RenderFunction {
   const { code } = compile(template, {
-    hoistStaticTrees: true,
+    hoistStatic: true,
     ...options
   })
   return new Function(code)() as RenderFunction