Skip to content

Commit

Permalink
fix(instrumentation-user-insteraction)!: make getZoneWithPrototype pr…
Browse files Browse the repository at this point in the history
…ivate
  • Loading branch information
pichlermarc committed Dec 5, 2024
1 parent 99e83f9 commit b3dda26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
* implements enable function
*/
override enable() {
const ZoneWithPrototype = this.getZoneWithPrototype();
const ZoneWithPrototype = this._getZoneWithPrototype();
this._diag.debug(
'applying patch to',
this.moduleName,
Expand Down Expand Up @@ -645,7 +645,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
* implements unpatch function
*/
override disable() {
const ZoneWithPrototype = this.getZoneWithPrototype();
const ZoneWithPrototype = this._getZoneWithPrototype();
this._diag.debug(
'removing patch from',
this.moduleName,
Expand Down Expand Up @@ -680,7 +680,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
/**
* returns Zone
*/
getZoneWithPrototype(): ZoneTypeWithPrototype | undefined {
private _getZoneWithPrototype(): ZoneTypeWithPrototype | undefined {
const _window: WindowWithZone = window as unknown as WindowWithZone;
return _window.Zone;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe('UserInteractionInstrumentation', () => {
});

sandbox
.stub(userInteractionInstrumentation, 'getZoneWithPrototype')
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore this is private, but it exists
.stub(userInteractionInstrumentation, '_getZoneWithPrototype')
.callsFake(() => {
return false as any;
});
Expand Down

0 comments on commit b3dda26

Please sign in to comment.