summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/fs/utils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/internal/fs/utils.mjs')
-rw-r--r--ext/node/polyfills/internal/fs/utils.mjs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal/fs/utils.mjs b/ext/node/polyfills/internal/fs/utils.mjs
index 53184b9c3..b0ef34873 100644
--- a/ext/node/polyfills/internal/fs/utils.mjs
+++ b/ext/node/polyfills/internal/fs/utils.mjs
@@ -990,7 +990,11 @@ export const validatePosition = hideStackFrames((position) => {
export const arrayBufferViewToUint8Array = hideStackFrames(
(buffer) => {
if (!(buffer instanceof Uint8Array)) {
- return new Uint8Array(buffer.buffer);
+ return new Uint8Array(
+ buffer.buffer,
+ buffer.byteOffset,
+ buffer.byteLength,
+ );
}
return buffer;
},