Skip to content

Commit 2ec57a7

Browse files
committed
buffer: unconditionally use internalBinding
With the removal of test-buffer-bindingobj-no-zerofill.js, internalBinding can be used unconditionally to assign isAnyArrayBuffer(). PR-URL: #23234 Refs: #22160 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
1 parent 2498c7b commit 2ec57a7

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/buffer.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,7 @@ const {
3737
kMaxLength,
3838
kStringMaxLength
3939
} = process.binding('buffer');
40-
// We cannot use internalBinding unconditionally here because of the way
41-
// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
42-
let isAnyArrayBuffer;
43-
try {
44-
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
45-
} catch (e) {
46-
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;
47-
}
40+
const { isAnyArrayBuffer } = internalBinding('types');
4841
const {
4942
customInspectSymbol,
5043
isInsideNodeModules,

0 commit comments

Comments
 (0)