Skip to content

Commit

Permalink
lib: replace ArrayBuffer.isView by primordial ArrayBuffer
Browse files Browse the repository at this point in the history
PR-URL: #30692
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: David Carlier <[email protected]>
  • Loading branch information
Kawacrepe authored and targos committed Jan 14, 2020
1 parent 79dd591 commit 67de744
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/string_decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'use strict';

const {
ArrayBufferIsView,
ObjectDefineProperties,
} = primordials;

Expand Down Expand Up @@ -74,7 +75,7 @@ function StringDecoder(encoding) {
StringDecoder.prototype.write = function write(buf) {
if (typeof buf === 'string')
return buf;
if (!ArrayBuffer.isView(buf))
if (!ArrayBufferIsView(buf))
throw new ERR_INVALID_ARG_TYPE('buf',
['Buffer', 'TypedArray', 'DataView'],
buf);
Expand Down

0 comments on commit 67de744

Please sign in to comment.