Skip to content

Commit

Permalink
util: text decoding allows SharedArrayBuffer
Browse files Browse the repository at this point in the history
PR-URL: #32203
Fixes: #32199
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
bfarias-godaddy authored and targos committed Apr 22, 2020
1 parent 2e92cb4 commit 58c6422
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const {
} = require('internal/util');

const {
isArrayBuffer,
isAnyArrayBuffer,
isArrayBufferView,
isUint8Array
} = require('internal/util/types');
Expand Down Expand Up @@ -404,7 +404,7 @@ function makeTextDecoderICU() {

decode(input = empty, options = {}) {
validateDecoder(this);
if (isArrayBuffer(input)) {
if (isAnyArrayBuffer(input)) {
input = lazyBuffer().from(input);
} else if (!isArrayBufferView(input)) {
throw new ERR_INVALID_ARG_TYPE('input',
Expand Down Expand Up @@ -469,7 +469,7 @@ function makeTextDecoderJS() {

decode(input = empty, options = {}) {
validateDecoder(this);
if (isArrayBuffer(input)) {
if (isAnyArrayBuffer(input)) {
input = lazyBuffer().from(input);
} else if (isArrayBufferView(input)) {
input = lazyBuffer().from(input.buffer, input.byteOffset,
Expand Down

0 comments on commit 58c6422

Please sign in to comment.