From ef45d7f7fe8caf7614be328dd7c92d7a5b8099a0 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 4 Oct 2023 11:10:53 +0200 Subject: [PATCH] crypto: account for disabled SharedArrayBuffer --- lib/internal/crypto/webidl.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/crypto/webidl.js b/lib/internal/crypto/webidl.js index 9f5340c223902c..61a4cfe4330703 100644 --- a/lib/internal/crypto/webidl.js +++ b/lib/internal/crypto/webidl.js @@ -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) => {