lib: replace ArrayBuffer.isView by primordial ArrayBuffer

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Vincent Dhennin authored and Michaël Zasso committed 2019-12-01 10:20:10 +01:00
1 parent 6a0dd1cbbd
commit c09e3deac5
1 file changed
+2 -1
+2 -1
View File
@@ -22,6 +22,7 @@
'use strict';
const {
ArrayBufferIsView,
ObjectDefineProperties,
} = primordials;
@@ -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);