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 authored and jasnell committed Oct 17, 2018
1 parent 8f3cfc8 commit 8fb6bce
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 8fb6bce

Please sign in to comment.