mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
buffer: unconditionally use internalBinding
With the removal of test-buffer-bindingobj-no-zerofill.js, internalBinding can be used unconditionally to assign isAnyArrayBuffer(). PR-URL: https://github.com/nodejs/node/pull/23234 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
1 file changed
+1
-8
+1
-8
@@ -37,14 +37,7 @@ const {
|
||||
kMaxLength,
|
||||
kStringMaxLength
|
||||
} = process.binding('buffer');
|
||||
// We cannot use internalBinding unconditionally here because of the way
|
||||
// that test/parallel/test-buffer-bindingobj-no-zerofill.js is written.
|
||||
let isAnyArrayBuffer;
|
||||
try {
|
||||
isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer;
|
||||
} catch (e) {
|
||||
isAnyArrayBuffer = require('util').types.isAnyArrayBuffer;
|
||||
}
|
||||
const { isAnyArrayBuffer } = internalBinding('types');
|
||||
const {
|
||||
customInspectSymbol,
|
||||
isInsideNodeModules,
|
||||
|
||||
Reference in new issue
Block a user