mirror of https://github.com/vuejs/core.git
refactor(runtime-core): use Symbol.for for runtime Symbols
This commit is contained in:
parent
a0e7dc3343
commit
34ad609bd7
|
@ -26,7 +26,7 @@ export function resolveComponent(
|
||||||
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NULL_DYNAMIC_COMPONENT = Symbol()
|
export const NULL_DYNAMIC_COMPONENT = Symbol.for('v-ndc')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { inject } from '../apiInject'
|
import { inject } from '../apiInject'
|
||||||
import { warn } from '../warning'
|
import { warn } from '../warning'
|
||||||
|
|
||||||
export const ssrContextKey = Symbol(__DEV__ ? `ssrContext` : ``)
|
export const ssrContextKey = Symbol.for('v-scx')
|
||||||
|
|
||||||
export const useSSRContext = <T = Record<string, any>>() => {
|
export const useSSRContext = <T = Record<string, any>>() => {
|
||||||
if (!__GLOBAL__) {
|
if (!__GLOBAL__) {
|
||||||
|
|
|
@ -46,15 +46,15 @@ import { defineLegacyVNodeProperties } from './compat/renderFn'
|
||||||
import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
|
import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
|
||||||
import { ComponentPublicInstance } from './componentPublicInstance'
|
import { ComponentPublicInstance } from './componentPublicInstance'
|
||||||
|
|
||||||
export const Fragment = Symbol(__DEV__ ? 'Fragment' : undefined) as any as {
|
export const Fragment = Symbol.for('v-fgt') as any as {
|
||||||
__isFragment: true
|
__isFragment: true
|
||||||
new (): {
|
new (): {
|
||||||
$props: VNodeProps
|
$props: VNodeProps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const Text = Symbol(__DEV__ ? 'Text' : undefined)
|
export const Text = Symbol.for('v-txt')
|
||||||
export const Comment = Symbol(__DEV__ ? 'Comment' : undefined)
|
export const Comment = Symbol.for('v-cmt')
|
||||||
export const Static = Symbol(__DEV__ ? 'Static' : undefined)
|
export const Static = Symbol.for('v-stc')
|
||||||
|
|
||||||
export type VNodeTypes =
|
export type VNodeTypes =
|
||||||
| string
|
| string
|
||||||
|
|
Loading…
Reference in New Issue