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 <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
  • Loading branch information
Kawacrepe authored and targos committed Dec 1, 2019
1 parent 6a0dd1c commit c09e3de
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 c09e3de

Please sign in to comment.