]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-core): use Symbol.for for runtime Symbols
authorEvan You <yyx990803@gmail.com>
Tue, 21 Feb 2023 09:42:06 +0000 (17:42 +0800)
committerEvan You <yyx990803@gmail.com>
Tue, 21 Feb 2023 09:42:06 +0000 (17:42 +0800)
packages/runtime-core/src/helpers/resolveAssets.ts
packages/runtime-core/src/helpers/useSsrContext.ts
packages/runtime-core/src/vnode.ts

index 214c4f446b381b5d51fe36721f2b1e9345ced30a..3aedcee47eeb42b7c2ebfcdf62a50ba7468a4edd 100644 (file)
@@ -26,7 +26,7 @@ export function resolveComponent(
   return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name
 }
 
-export const NULL_DYNAMIC_COMPONENT = Symbol()
+export const NULL_DYNAMIC_COMPONENT = Symbol.for('v-ndc')
 
 /**
  * @private
index e48a69a40da5534d3f2c4fb2b83343b77bdd249e..501a18e3bb5a3c16f979e325b78519745b4c4da2 100644 (file)
@@ -1,7 +1,7 @@
 import { inject } from '../apiInject'
 import { warn } from '../warning'
 
-export const ssrContextKey = Symbol(__DEV__ ? `ssrContext` : ``)
+export const ssrContextKey = Symbol.for('v-scx')
 
 export const useSSRContext = <T = Record<string, any>>() => {
   if (!__GLOBAL__) {
index 83eedc4ccef54ea5c3bf103de287122b01e7b754..bed2b4f1eeeb421cbad85735d61eee4994219e26 100644 (file)
@@ -46,15 +46,15 @@ import { defineLegacyVNodeProperties } from './compat/renderFn'
 import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
 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
   new (): {
     $props: VNodeProps
   }
 }
-export const Text = Symbol(__DEV__ ? 'Text' : undefined)
-export const Comment = Symbol(__DEV__ ? 'Comment' : undefined)
-export const Static = Symbol(__DEV__ ? 'Static' : undefined)
+export const Text = Symbol.for('v-txt')
+export const Comment = Symbol.for('v-cmt')
+export const Static = Symbol.for('v-stc')
 
 export type VNodeTypes =
   | string