Skip to content

Commit

Permalink
chore: rename method to make it more explicit it is dev only
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 27, 2021
1 parent 3a75d5d commit 8681c12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import {
ComponentPublicInstance,
PublicInstanceProxyHandlers,
createRenderContext,
createDevRenderContext,
exposePropsOnRenderContext,
exposeSetupStateOnRenderContext,
ComponentPublicInstanceConstructor,
Expand Down Expand Up @@ -521,7 +521,7 @@ export function createComponentInstance(
sp: null
}
if (__DEV__) {
instance.ctx = createRenderContext(instance)
instance.ctx = createDevRenderContext(instance)
} else {
instance.ctx = { _: instance }
}
Expand Down
3 changes: 2 additions & 1 deletion packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,11 @@ export const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend(
}
)

// dev only
// In dev mode, the proxy target exposes the same properties as seen on `this`
// for easier console inspection. In prod mode it will be an empty object so
// these properties definitions can be skipped.
export function createRenderContext(instance: ComponentInternalInstance) {
export function createDevRenderContext(instance: ComponentInternalInstance) {
const target: Record<string, any> = {}

// expose internal instance for proxy handlers
Expand Down

0 comments on commit 8681c12

Please sign in to comment.