Skip to content

Commit

Permalink
fix(NODE-6259): replace dynamically assigned length property with a s…
Browse files Browse the repository at this point in the history
…tatic getter (#4173)
  • Loading branch information
sis0k0 authored Jul 11, 2024
1 parent de253a7 commit 320dde0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/bulk/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,10 @@ export abstract class BulkOperationBase {
);
}

get length(): number {
return this.s.currentIndex;
}

get bsonOptions(): BSONSerializeOptions {
return this.s.bsonOptions;
}
Expand Down Expand Up @@ -1274,13 +1278,6 @@ export abstract class BulkOperationBase {
}
}

Object.defineProperty(BulkOperationBase.prototype, 'length', {
enumerable: true,
get() {
return this.s.currentIndex;
}
});

function isInsertBatch(batch: Batch): boolean {
return batch.batchType === BatchType.INSERT;
}
Expand Down

0 comments on commit 320dde0

Please sign in to comment.