Skip to content

Commit

Permalink
crypto: account for disabled SharedArrayBuffer
Browse files Browse the repository at this point in the history
PR-URL: nodejs#50034
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
codebytere authored and debadree25 committed Apr 15, 2024
1 parent c7a26dd commit b8b8724
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/crypto/webidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ function isNonSharedArrayBuffer(V) {
}

function isSharedArrayBuffer(V) {
return ObjectPrototypeIsPrototypeOf(SharedArrayBuffer.prototype, V);
// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.
if (SharedArrayBuffer !== undefined)
return ObjectPrototypeIsPrototypeOf(SharedArrayBuffer.prototype, V);
return false;
}

converters.Uint8Array = (V, opts = kEmptyObject) => {
Expand Down

0 comments on commit b8b8724

Please sign in to comment.