Skip to content

Commit 34ad609

Browse files
committed
refactor(runtime-core): use Symbol.for for runtime Symbols
1 parent a0e7dc3 commit 34ad609

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/runtime-core/src/helpers/resolveAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function resolveComponent(
2626
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name
2727
}
2828

29-
export const NULL_DYNAMIC_COMPONENT = Symbol()
29+
export const NULL_DYNAMIC_COMPONENT = Symbol.for('v-ndc')
3030

3131
/**
3232
* @private

packages/runtime-core/src/helpers/useSsrContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { inject } from '../apiInject'
22
import { warn } from '../warning'
33

4-
export const ssrContextKey = Symbol(__DEV__ ? `ssrContext` : ``)
4+
export const ssrContextKey = Symbol.for('v-scx')
55

66
export const useSSRContext = <T = Record<string, any>>() => {
77
if (!__GLOBAL__) {

packages/runtime-core/src/vnode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ import { defineLegacyVNodeProperties } from './compat/renderFn'
4646
import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
4747
import { ComponentPublicInstance } from './componentPublicInstance'
4848

49-
export const Fragment = Symbol(__DEV__ ? 'Fragment' : undefined) as any as {
49+
export const Fragment = Symbol.for('v-fgt') as any as {
5050
__isFragment: true
5151
new (): {
5252
$props: VNodeProps
5353
}
5454
}
55-
export const Text = Symbol(__DEV__ ? 'Text' : undefined)
56-
export const Comment = Symbol(__DEV__ ? 'Comment' : undefined)
57-
export const Static = Symbol(__DEV__ ? 'Static' : undefined)
55+
export const Text = Symbol.for('v-txt')
56+
export const Comment = Symbol.for('v-cmt')
57+
export const Static = Symbol.for('v-stc')
5858

5959
export type VNodeTypes =
6060
| string

0 commit comments

Comments
 (0)