]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: use more explicit names for warning context
authorEvan You <yyx990803@gmail.com>
Mon, 15 Oct 2018 16:43:21 +0000 (12:43 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 15 Oct 2018 16:43:21 +0000 (12:43 -0400)
packages/core/src/createRenderer.ts
packages/core/src/warning.ts

index 357c9b87dc5dc3f0e07ba3e1512265c066958f00..0817cf68a0b021dd49d0c57b23d27667686effb1 100644 (file)
@@ -25,7 +25,7 @@ import {
   shouldUpdateFunctionalComponent
 } from './componentUtils'
 import { KeepAliveSymbol } from './optional/keepAlive'
-import { pushContext, popContext } from './warning'
+import { pushWarningContext, popWarningContext } from './warning'
 
 interface NodeOps {
   createElement: (tag: string, isSVG?: boolean) => any
@@ -206,7 +206,7 @@ export function createRenderer(options: RendererOptions) {
   ) {
     vnode.contextVNode = contextVNode
     if (__DEV__) {
-      pushContext(vnode)
+      pushWarningContext(vnode)
     }
     const { flags } = vnode
     if (flags & VNodeFlags.COMPONENT_STATEFUL) {
@@ -215,7 +215,7 @@ export function createRenderer(options: RendererOptions) {
       mountFunctionalComponent(vnode, container, isSVG, endNode)
     }
     if (__DEV__) {
-      popContext()
+      popWarningContext()
     }
   }
 
@@ -454,7 +454,7 @@ export function createRenderer(options: RendererOptions) {
     isSVG: boolean
   ) {
     if (__DEV__) {
-      pushContext(nextVNode)
+      pushWarningContext(nextVNode)
     }
     nextVNode.contextVNode = contextVNode
     const { tag, flags } = nextVNode
@@ -472,7 +472,7 @@ export function createRenderer(options: RendererOptions) {
       )
     }
     if (__DEV__) {
-      popContext()
+      popWarningContext()
     }
   }
 
@@ -1232,7 +1232,7 @@ export function createRenderer(options: RendererOptions) {
     isSVG: boolean
   ) {
     if (__DEV__ && instance.$parentVNode) {
-      pushContext(instance.$parentVNode as VNode)
+      pushWarningContext(instance.$parentVNode as VNode)
     }
     const prevVNode = instance.$vnode
 
@@ -1291,7 +1291,7 @@ export function createRenderer(options: RendererOptions) {
     }
 
     if (__DEV__ && instance.$parentVNode) {
-      popContext()
+      popWarningContext()
     }
   }
 
index 22ab6bed917c626279c419ebac5dc38deed9b3fc..6bda13d4cda40bd44cfb8c274d93ff67b7808b7a 100644 (file)
@@ -4,11 +4,11 @@ import { VNode } from './vdom'
 
 let stack: VNode[] = []
 
-export function pushContext(vnode: VNode) {
+export function pushWarningContext(vnode: VNode) {
   stack.push(vnode)
 }
 
-export function popContext() {
+export function popWarningContext() {
   stack.pop()
 }