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 <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • 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.