Skip to content

Commit

Permalink
@dandi/common - Disposable - prevent making "disposed" property inacc…
Browse files Browse the repository at this point in the history
…essible
  • Loading branch information
DanielSchaffer committed Sep 29, 2018
1 parent 4ea6468 commit 0264473
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/src/disposable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ export class Disposable {
public static remapDisposed<T>(target: T, reason: string): T {
const thrower = throwAlreadyDisposed.bind(target, target, reason);
for (const prop in target) {
if (prop === 'disposed') {
continue;
}
if (typeof target[prop] === 'function') {
target[prop] = thrower;
} else {
Expand Down

0 comments on commit 0264473

Please sign in to comment.