File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ export class Scope implements ScopeInterface {
75
75
/** Request Mode Session Status */
76
76
protected _requestSession ?: RequestSession ;
77
77
78
+ /** If the scope is a clone, the original scope from which the clone derived */
79
+ protected _parent ?: Scope ;
80
+
78
81
/**
79
82
* Inherit values from the parent scope.
80
83
* @param scope to clone.
@@ -94,6 +97,7 @@ export class Scope implements ScopeInterface {
94
97
newScope . _fingerprint = scope . _fingerprint ;
95
98
newScope . _eventProcessors = [ ...scope . _eventProcessors ] ;
96
99
newScope . _requestSession = scope . _requestSession ;
100
+ ( newScope as any ) . _parent = scope ;
97
101
}
98
102
return newScope ;
99
103
}
@@ -297,6 +301,13 @@ export class Scope implements ScopeInterface {
297
301
return this . _session ;
298
302
}
299
303
304
+ /**
305
+ * @inheritDoc
306
+ */
307
+ public getParent ( ) : Scope | undefined {
308
+ return this . _parent ;
309
+ }
310
+
300
311
/**
301
312
* @inheritDoc
302
313
*/
Original file line number Diff line number Diff line change @@ -132,6 +132,11 @@ export interface Scope {
132
132
*/
133
133
setRequestSession ( requestSession ?: RequestSession ) : this;
134
134
135
+ /**
136
+ * The scope from which this scope was cloned, if any
137
+ */
138
+ getParent ( ) : Scope | undefined ;
139
+
135
140
/**
136
141
* Updates the scope with provided data. Can work in three variations:
137
142
* - plain object containing updatable attributes
You can’t perform that action at this time.
0 commit comments