Skip to content

Commit

Permalink
add more missing hasOwnProperty checks
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Oct 4, 2023
1 parent dc4a1f7 commit ed5fc95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/centrifuge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,9 @@ export class Centrifuge extends (EventEmitter as new () => TypedEventEmitter<Cli

private _resolvePromises() {
for (const id in this._promises) {
if (!this._promises.hasOwnProperty(id)) {
continue;
}
if (this._promises[id].timeout) {
clearTimeout(this._promises[id].timeout);
}
Expand All @@ -1833,6 +1836,9 @@ export class Centrifuge extends (EventEmitter as new () => TypedEventEmitter<Cli

private _rejectPromises(err: any) {
for (const id in this._promises) {
if (!this._promises.hasOwnProperty(id)) {
continue;
}
if (this._promises[id].timeout) {
clearTimeout(this._promises[id].timeout);
}
Expand Down
6 changes: 6 additions & 0 deletions src/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ export class Subscription extends (EventEmitter as new () => TypedEventEmitter<S

private _resolvePromises() {
for (const id in this._promises) {
if (!this._promises.hasOwnProperty(id)) {
continue;
}
if (this._promises[id].timeout) {
clearTimeout(this._promises[id].timeout);
}
Expand All @@ -473,6 +476,9 @@ export class Subscription extends (EventEmitter as new () => TypedEventEmitter<S

private _rejectPromises(err: any) {
for (const id in this._promises) {
if (!this._promises.hasOwnProperty(id)) {
continue;
}
if (this._promises[id].timeout) {
clearTimeout(this._promises[id].timeout);
}
Expand Down

0 comments on commit ed5fc95

Please sign in to comment.