Skip to content

Commit b3dda26

Browse files
committed
fix(instrumentation-user-insteraction)!: make getZoneWithPrototype private
1 parent 99e83f9 commit b3dda26

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
575575
* implements enable function
576576
*/
577577
override enable() {
578-
const ZoneWithPrototype = this.getZoneWithPrototype();
578+
const ZoneWithPrototype = this._getZoneWithPrototype();
579579
this._diag.debug(
580580
'applying patch to',
581581
this.moduleName,
@@ -645,7 +645,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
645645
* implements unpatch function
646646
*/
647647
override disable() {
648-
const ZoneWithPrototype = this.getZoneWithPrototype();
648+
const ZoneWithPrototype = this._getZoneWithPrototype();
649649
this._diag.debug(
650650
'removing patch from',
651651
this.moduleName,
@@ -680,7 +680,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase<UserInte
680680
/**
681681
* returns Zone
682682
*/
683-
getZoneWithPrototype(): ZoneTypeWithPrototype | undefined {
683+
private _getZoneWithPrototype(): ZoneTypeWithPrototype | undefined {
684684
const _window: WindowWithZone = window as unknown as WindowWithZone;
685685
return _window.Zone;
686686
}

plugins/web/opentelemetry-instrumentation-user-interaction/test/userInteraction.nozone.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ describe('UserInteractionInstrumentation', () => {
5858
});
5959

6060
sandbox
61-
.stub(userInteractionInstrumentation, 'getZoneWithPrototype')
61+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
62+
// @ts-ignore this is private, but it exists
63+
.stub(userInteractionInstrumentation, '_getZoneWithPrototype')
6264
.callsFake(() => {
6365
return false as any;
6466
});

0 commit comments

Comments
 (0)