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 alexfernandez committed Nov 1, 2023
1 parent 7d93004 commit e46a76a
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 e46a76a

Please sign in to comment.