Skip to content

Commit

Permalink
Ensure throws if closed
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Nov 4, 2024
1 parent 56cf7a7 commit bc98058
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/node/polyfills/internal/fs/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class FileHandle extends EventEmitter {
stat(options: { bigint: false }): Promise<Stats>;
stat(options: { bigint: true }): Promise<BigIntStats>;
stat(options?: { bigint: boolean }): Promise<Stats | BigIntStats> {
return promises.fstat(this.fd, options);
return fsCall(promises.fstat, this, options);
}
}

Expand All @@ -161,7 +161,7 @@ function fsCall(fn, handle, ...args) {
});
}

return fn(handle, ...args);
return fn(handle.fd, ...args);
}

export default {
Expand Down

0 comments on commit bc98058

Please sign in to comment.