Skip to content

Commit 3f98c06

Browse files
codebyteretargos
authored andcommitted
crypto: account for disabled SharedArrayBuffer
PR-URL: #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]>
1 parent e323a36 commit 3f98c06

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/internal/crypto/webidl.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ function isNonSharedArrayBuffer(V) {
184184
}
185185

186186
function isSharedArrayBuffer(V) {
187-
return ObjectPrototypeIsPrototypeOf(SharedArrayBuffer.prototype, V);
187+
// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.
188+
if (SharedArrayBuffer !== undefined)
189+
return ObjectPrototypeIsPrototypeOf(SharedArrayBuffer.prototype, V);
190+
return false;
188191
}
189192

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

0 commit comments

Comments
 (0)