Skip to content

Commit

Permalink
buffer: unconditionally use internalBinding
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cjihrig committed Oct 9, 2018
1 parent 2498c7b commit 2ec57a7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2ec57a7

Please sign in to comment.