From: Evan You Date: Mon, 15 Oct 2018 16:43:21 +0000 (-0400) Subject: refactor: use more explicit names for warning context X-Git-Tag: v3.0.0-alpha.0~1112 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4e138197c1cc29cfa7f5b98165ec91b94776787;p=thirdparty%2Fvuejs%2Fcore.git refactor: use more explicit names for warning context --- diff --git a/packages/core/src/createRenderer.ts b/packages/core/src/createRenderer.ts index 357c9b87dc..0817cf68a0 100644 --- a/packages/core/src/createRenderer.ts +++ b/packages/core/src/createRenderer.ts @@ -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() } } diff --git a/packages/core/src/warning.ts b/packages/core/src/warning.ts index 22ab6bed91..6bda13d4cd 100644 --- a/packages/core/src/warning.ts +++ b/packages/core/src/warning.ts @@ -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() }