Skip to content

Commit 8fb6bce

Browse files
cjihrigjasnell
authored andcommitted
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 <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent 8f3cfc8 commit 8fb6bce

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)