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:
cjihrig 2018-10-02 23:36:18 -04:00
parent 2498c7b18b
commit 2ec57a7134
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -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,