Skip to content

Commit ff5ee24

Browse files
committed
use symbol.for
1 parent 3bfba01 commit ff5ee24

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/core/src/utils/normalizationHints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { addNonEnumerableProperty } from './object';
33
/**
44
* Internal symbols for normalization behavior. JSON and other structured user payloads cannot
55
* carry these keys, so they cannot spoof SDK-only normalization hints.
6+
* We use Symbol.for to ensure that the symbols are the same across different modules/files.
67
*/
7-
const SENTRY_SKIP_NORMALIZATION = Symbol('sentry.skipNormalization');
8-
const SENTRY_OVERRIDE_NORMALIZATION_DEPTH = Symbol('sentry.overrideNormalizationDepth');
8+
const SENTRY_SKIP_NORMALIZATION = Symbol.for('sentry.skipNormalization');
9+
const SENTRY_OVERRIDE_NORMALIZATION_DEPTH = Symbol.for('sentry.overrideNormalizationDepth');
910

1011
/** Marks an object so `normalize` returns it unchanged (already-normalized SDK data). */
1112
export function setSkipNormalizationHint(obj: object): void {

0 commit comments

Comments
 (0)