@@ -44,28 +44,37 @@ const MAX_BREADCRUMBS = 100;
44
44
*/
45
45
export class Scope implements ScopeInterface {
46
46
/** Flag if notifying is happening. */
47
- protected _notifyingListeners : boolean = false ;
47
+ protected _notifyingListeners : boolean ;
48
48
49
49
/** Callback for client to receive scope changes. */
50
- protected _scopeListeners : Array < ( scope : Scope ) => void > = [ ] ;
50
+ protected _scopeListeners : Array < ( scope : Scope ) => void > ;
51
51
52
52
/** Callback list that will be called after {@link applyToEvent}. */
53
- protected _eventProcessors : EventProcessor [ ] = [ ] ;
53
+ protected _eventProcessors : EventProcessor [ ] ;
54
54
55
55
/** Array of breadcrumbs. */
56
- protected _breadcrumbs : Breadcrumb [ ] = [ ] ;
56
+ protected _breadcrumbs : Breadcrumb [ ] ;
57
57
58
58
/** User */
59
- protected _user : User = { } ;
59
+ protected _user : User ;
60
60
61
61
/** Tags */
62
- protected _tags : { [ key : string ] : Primitive } = { } ;
62
+ protected _tags : { [ key : string ] : Primitive } ;
63
63
64
64
/** Extra */
65
- protected _extra : Extras = { } ;
65
+ protected _extra : Extras ;
66
66
67
67
/** Contexts */
68
- protected _contexts : Contexts = { } ;
68
+ protected _contexts : Contexts ;
69
+
70
+ /** Attachments */
71
+ protected _attachments : Attachment [ ] ;
72
+
73
+ /**
74
+ * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
75
+ * sent to Sentry
76
+ */
77
+ protected _sdkProcessingMetadata : { [ key : string ] : unknown } ;
69
78
70
79
/** Fingerprint */
71
80
protected _fingerprint ?: string [ ] ;
@@ -86,14 +95,18 @@ export class Scope implements ScopeInterface {
86
95
/** Request Mode Session Status */
87
96
protected _requestSession ?: RequestSession ;
88
97
89
- /** Attachments */
90
- protected _attachments : Attachment [ ] = [ ] ;
91
-
92
- /**
93
- * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
94
- * sent to Sentry
95
- */
96
- protected _sdkProcessingMetadata ?: { [ key : string ] : unknown } = { } ;
98
+ public constructor ( ) {
99
+ this . _notifyingListeners = false ;
100
+ this . _scopeListeners = [ ] ;
101
+ this . _eventProcessors = [ ] ;
102
+ this . _breadcrumbs = [ ] ;
103
+ this . _attachments = [ ] ;
104
+ this . _user = { } ;
105
+ this . _tags = { } ;
106
+ this . _extra = { } ;
107
+ this . _contexts = { } ;
108
+ this . _sdkProcessingMetadata = { } ;
109
+ }
97
110
98
111
/**
99
112
* Inherit values from the parent scope.
0 commit comments