summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_brotli.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_brotli.js')
-rw-r--r--ext/node/polyfills/_brotli.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/node/polyfills/_brotli.js b/ext/node/polyfills/_brotli.js
index 1524bf85c..ce5db3230 100644
--- a/ext/node/polyfills/_brotli.js
+++ b/ext/node/polyfills/_brotli.js
@@ -9,7 +9,10 @@ const {
TypedArrayPrototypeSlice,
TypedArrayPrototypeSubarray,
TypedArrayPrototypeGetByteLength,
+ TypedArrayPrototypeGetByteOffset,
DataViewPrototypeGetBuffer,
+ DataViewPrototypeGetByteLength,
+ DataViewPrototypeGetByteOffset,
TypedArrayPrototypeGetBuffer,
} = primordials;
const { isTypedArray, isDataView, close } = core;
@@ -38,9 +41,17 @@ const toU8 = (input) => {
}
if (isTypedArray(input)) {
- return new Uint8Array(TypedArrayPrototypeGetBuffer(input));
+ return new Uint8Array(
+ TypedArrayPrototypeGetBuffer(input),
+ TypedArrayPrototypeGetByteOffset(input),
+ TypedArrayPrototypeGetByteLength(input),
+ );
} else if (isDataView(input)) {
- return new Uint8Array(DataViewPrototypeGetBuffer(input));
+ return new Uint8Array(
+ DataViewPrototypeGetBuffer(input),
+ DataViewPrototypeGetByteOffset(input),
+ DataViewPrototypeGetByteLength(input),
+ );
}
return input;