crypto: account for disabled SharedArrayBuffer

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Shelley Vohr authored and GitHub committed 2023-10-06 09:17:04 +00:00
1 parent f73650ea52
commit 136a96722a
1 file changed
+4 -1
+4 -1
View File
@@ -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) => {