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:
parent
2498c7b18b
commit
2ec57a7134
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user