-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add scope inheritance #1343
Conversation
packages/core/src/scope.ts
Outdated
@@ -89,10 +98,18 @@ export class Scope implements BaseScope { | |||
* @param fingerprint | |||
*/ | |||
public setFingerprint(fingerprint: string[]): void { | |||
this.fingerprint = fingerprint; | |||
this.fingerprint = [...fingerprint]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: That is not necessary.
packages/shim/src/shim.ts
Outdated
@@ -39,9 +39,12 @@ export class Shim { | |||
*/ | |||
public pushScope(client?: any): void { | |||
const usedClient = client || this.getCurrentClient(); | |||
// We want to clone the last scope and not create a new one | |||
const stack = this.getStack(); | |||
const parentScope = stack[stack.length - 1].scope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an assertion here or even a fallback so we don't blow up in case stack is empty?
packages/core/src/scope.ts
Outdated
this.user = user; | ||
this.user = { | ||
...this.user, | ||
...user, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should replace instead of merge.
No description provided.