33 */
44
55import { describe , expect , test , vi } from 'vitest' ;
6- import { addNonEnumerableProperty , normalize } from '../../../src' ;
6+ import { normalize , setNormalizationDepthOverrideHint , setSkipNormalizationHint } from '../../../src' ;
77import * as isModule from '../../../src/utils/is' ;
88import * as stacktraceModule from '../../../src/utils/stacktrace' ;
99
@@ -655,15 +655,15 @@ describe('normalize()', () => {
655655 } ) ;
656656 } ) ;
657657
658- describe ( 'skips normalizing objects marked with a non-enumerable property __sentry_skip_normalization__ ' , ( ) => {
658+ describe ( 'skips normalizing objects marked with setSkipNormalizationHint (internal symbol) ' , ( ) => {
659659 test ( 'by leaving non-serializable values intact' , ( ) => {
660660 const someFun = ( ) => undefined ;
661661 const alreadyNormalizedObj = {
662662 nan : NaN ,
663663 fun : someFun ,
664664 } ;
665665
666- addNonEnumerableProperty ( alreadyNormalizedObj , '__sentry_skip_normalization__' , true ) ;
666+ setSkipNormalizationHint ( alreadyNormalizedObj ) ;
667667
668668 const result = normalize ( alreadyNormalizedObj ) ;
669669 expect ( result ) . toEqual ( {
@@ -681,7 +681,7 @@ describe('normalize()', () => {
681681 } ,
682682 } ;
683683
684- addNonEnumerableProperty ( alreadyNormalizedObj , '__sentry_skip_normalization__' , true ) ;
684+ setSkipNormalizationHint ( alreadyNormalizedObj ) ;
685685
686686 const obj = {
687687 foo : {
@@ -703,7 +703,7 @@ describe('normalize()', () => {
703703 } ) ;
704704 } ) ;
705705
706- describe ( 'overrides normalization depth with a non-enumerable property __sentry_override_normalization_depth__ ' , ( ) => {
706+ describe ( 'overrides normalization depth with setNormalizationDepthOverrideHint ' , ( ) => {
707707 test ( 'by increasing depth if it is higher' , ( ) => {
708708 const normalizationTarget = {
709709 foo : 'bar' ,
@@ -717,7 +717,7 @@ describe('normalize()', () => {
717717 } ,
718718 } ;
719719
720- addNonEnumerableProperty ( normalizationTarget , '__sentry_override_normalization_depth__' , 3 ) ;
720+ setNormalizationDepthOverrideHint ( normalizationTarget , 3 ) ;
721721
722722 const result = normalize ( normalizationTarget , 1 ) ;
723723
@@ -745,7 +745,7 @@ describe('normalize()', () => {
745745 } ,
746746 } ;
747747
748- addNonEnumerableProperty ( normalizationTarget , '__sentry_override_normalization_depth__' , 1 ) ;
748+ setNormalizationDepthOverrideHint ( normalizationTarget , 1 ) ;
749749
750750 const result = normalize ( normalizationTarget , 3 ) ;
751751
0 commit comments